chore(): update barcodescanner

This commit is contained in:
Tim Lancina
2016-02-07 16:12:13 -06:00
parent 6fcba5cc3f
commit 6688c4d91d
8 changed files with 64 additions and 28 deletions
+18 -3
View File
@@ -3,11 +3,11 @@ import {Plugin, Cordova} from './plugin';
/**
* The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you.
*
* Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BardcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
* Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
*
* @usage
* ```js
* BarcodeScanner.scan(options).then((barcodeData) => {
* BarcodeScanner.scan().then((barcodeData) => {
* // Success! Barcode data is here
* }, (err) => {
* // An error occurred
@@ -20,6 +20,21 @@ import {Plugin, Cordova} from './plugin';
pluginRef: 'cordova.plugins.barcodeScanner'
})
export class BarcodeScanner {
/**
* Open the barcode scanner.
*/
@Cordova()
static scan(options:any){};
static scan(){
// This Promise is replaced by one from the @Cordova decorator that wraps
// the plugin's callbacks. We provide a dummy one here so TypeScript
// knows that the correct return type is Promise, because there's no way
// for it to know the return type from a decorator.
// See https://github.com/Microsoft/TypeScript/issues/4881
return new Promise<any>((res, rej) => {});
};
// Not well supported
// @Cordova()
// static encode(type, data){};
}