diff --git a/src/@ionic-native/plugins/barcode-scanner/index.ts b/src/@ionic-native/plugins/barcode-scanner/index.ts index f55f76a01..467d613cf 100644 --- a/src/@ionic-native/plugins/barcode-scanner/index.ts +++ b/src/@ionic-native/plugins/barcode-scanner/index.ts @@ -1,8 +1,7 @@ import { Injectable } from '@angular/core'; -import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface BarcodeScannerOptions { - /** * Prefer front camera. Supported on iOS and Android. */ @@ -52,11 +51,26 @@ export interface BarcodeScannerOptions { * Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only. */ resultDisplayDuration?: number; - } 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'; + 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; } @@ -77,10 +91,10 @@ export interface BarcodeScanResult { * ... * * - * this.barcodeScanner.scan().then((barcodeData) => { - * // Success! Barcode data is here - * }, (err) => { - * // An error occurred + * this.barcodeScanner.scan().then(barcodeData => { + * console.log('Barcode data', barcodeData); + * }).catch(err => { + * console.log('Error', err); * }); * ``` * @interfaces @@ -96,7 +110,6 @@ export interface BarcodeScanResult { }) @Injectable() export class BarcodeScanner extends IonicNativePlugin { - Encode: { TEXT_TYPE: string; EMAIL_TYPE: string; @@ -117,7 +130,9 @@ export class BarcodeScanner extends IonicNativePlugin { @Cordova({ callbackOrder: 'reverse' }) - scan(options?: BarcodeScannerOptions): Promise { return; } + scan(options?: BarcodeScannerOptions): Promise { + return; + } /** * Encodes data into a barcode. @@ -127,6 +142,7 @@ export class BarcodeScanner extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - encode(type: string, data: any): Promise { return; } - + encode(type: string, data: any): Promise { + return; + } }