mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +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
|
||||
* @description
|
||||
@ -80,6 +86,7 @@ export interface BarcodeScannerOptions {
|
||||
* ```
|
||||
* @interfaces
|
||||
* BarcodeScannerOptions
|
||||
* BarcodeScanResult
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BarcodeScanner',
|
||||
@ -111,7 +118,7 @@ export class BarcodeScanner extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
scan(options?: BarcodeScannerOptions): Promise<any> { return; }
|
||||
scan(options?: BarcodeScannerOptions): Promise<BarcodeScanResult> { return; }
|
||||
|
||||
/**
|
||||
* Encodes data into a barcode.
|
||||
|
Loading…
Reference in New Issue
Block a user