mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
refactor(barcode-scanner): improve typings (#1437)
This commit is contained in:
parent
4ca4f9443d
commit
1123299274
@ -56,6 +56,12 @@ export interface BarcodeScannerOptions {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BarcodeScanResult {
|
||||||
|
format: "QR_CODE" | "DATA_MATRIX" | "UPC_E" | "UPC_A" | "EAN_8" | "EAN_13" | "CODE_128" | "CODE_39" | "CODE_93" | "CODABAR" | "ITF" | "RSS14" | "RSS_EXPANDED" | "PDF417" | "AZTEC" | "MSI";
|
||||||
|
cancelled: boolean;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Barcode Scanner
|
* @name Barcode Scanner
|
||||||
* @description
|
* @description
|
||||||
@ -80,6 +86,7 @@ export interface BarcodeScannerOptions {
|
|||||||
* ```
|
* ```
|
||||||
* @interfaces
|
* @interfaces
|
||||||
* BarcodeScannerOptions
|
* BarcodeScannerOptions
|
||||||
|
* BarcodeScanResult
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'BarcodeScanner',
|
pluginName: 'BarcodeScanner',
|
||||||
@ -111,7 +118,7 @@ export class BarcodeScanner extends IonicNativePlugin {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
callbackOrder: 'reverse'
|
callbackOrder: 'reverse'
|
||||||
})
|
})
|
||||||
scan(options?: BarcodeScannerOptions): Promise<any> { return; }
|
scan(options?: BarcodeScannerOptions): Promise<BarcodeScanResult> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes data into a barcode.
|
* Encodes data into a barcode.
|
||||||
|
Loading…
Reference in New Issue
Block a user