refactor(barcode-scanner): improve typings (#1437)

This commit is contained in:
Robert Coie 2017-04-28 06:35:33 -07:00 committed by Ibby Hadeed
parent 4ca4f9443d
commit 1123299274

View File

@ -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.