diff --git a/demo/www/app/home/home.js b/demo/www/app/home/home.js index 8ebf84f41..37ff7bf2a 100644 --- a/demo/www/app/home/home.js +++ b/demo/www/app/home/home.js @@ -2,6 +2,7 @@ import {Page, NavController} from 'ionic/ionic' import { ActionSheet, + BarcodeScanner, BLE, Camera, Calendar, @@ -26,6 +27,7 @@ export class HomePage { this.plugins = [ ActionSheet, + BarcodeScanner, BLE, Camera, Calendar, diff --git a/dist/index.d.ts b/dist/index.d.ts index 02a90bfd3..a814f870e 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,4 +1,5 @@ import { ActionSheet } from './plugins/actionsheet'; +import { BarcodeScanner } from './plugins/barcodescanner'; import { BLE } from './plugins/ble'; import { Camera } from './plugins/camera'; import { Calendar } from './plugins/calendar'; @@ -10,4 +11,4 @@ import { Push } from './plugins/push'; import { StatusBar } from './plugins/statusbar'; import { Toast } from './plugins/toast'; import { TouchID } from './plugins/touchid'; -export { ActionSheet, BLE, Camera, Calendar, Contacts, Device, Facebook, Geolocation, Push, StatusBar, Toast, TouchID }; +export { ActionSheet, BarcodeScanner, BLE, Camera, Calendar, Contacts, Device, Facebook, Geolocation, Push, StatusBar, Toast, TouchID }; diff --git a/dist/index.js b/dist/index.js index df3dfc068..173f12dd3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3,6 +3,8 @@ ng1_1.initAngular1(); var DEVICE_READY_TIMEOUT = 2000; var actionsheet_1 = require('./plugins/actionsheet'); exports.ActionSheet = actionsheet_1.ActionSheet; +var barcodescanner_1 = require('./plugins/barcodescanner'); +exports.BarcodeScanner = barcodescanner_1.BarcodeScanner; var ble_1 = require('./plugins/ble'); exports.BLE = ble_1.BLE; var camera_1 = require('./plugins/camera'); @@ -28,6 +30,7 @@ exports.TouchID = touchid_1.TouchID; // Window export to use outside of a module loading system window['IonicNative'] = { ActionSheet: actionsheet_1.ActionSheet, + BarcodeScanner: barcodescanner_1.BarcodeScanner, BLE: ble_1.BLE, Camera: camera_1.Camera, Calendar: calendar_1.Calendar, diff --git a/dist/index.js.map b/dist/index.js.map index 634dc610c..4c57b3acd 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAA2B,OAAO,CAAC,CAAA;AACnC,kBAAY,EAAE,CAAC;AAEf,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAKlC,4BAA0B,uBAAuB,CAAC,CAAA;AAchD,mBAAW;AAbb,oBAAkB,eAAe,CAAC,CAAA;AAchC,WAAG;AAbL,uBAAqB,kBAAkB,CAAC,CAAA;AActC,cAAM;AAbR,yBAAuB,oBAAoB,CAAC,CAAA;AAc1C,gBAAQ;AAbV,yBAAuB,oBAAoB,CAAC,CAAA;AAc1C,gBAAQ;AAbV,uBAAqB,kBAAkB,CAAC,CAAA;AActC,cAAM;AAbR,yBAAuB,oBAAoB,CAAC,CAAA;AAc1C,gBAAQ;AAbV,4BAA0B,uBAAuB,CAAC,CAAA;AAchD,mBAAW;AAbb,qBAAmB,gBAAgB,CAAC,CAAA;AAclC,YAAI;AAbN,0BAAwB,qBAAqB,CAAC,CAAA;AAc5C,iBAAS;AAbX,sBAAoB,iBAAiB,CAAC,CAAA;AAcpC,aAAK;AAbP,wBAAsB,mBAAmB,CAAC,CAAA;AAcxC,eAAO;AAGT,0DAA0D;AAC1D,MAAM,CAAC,aAAa,CAAC,GAAG;IACtB,WAAW,EAAE,yBAAW;IACxB,GAAG,EAAE,SAAG;IACR,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,QAAQ,EAAE,mBAAQ;IAClB,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,WAAW,EAAE,yBAAW;IACxB,IAAI,EAAE,WAAI;IACV,SAAS,EAAE,qBAAS;IACpB,KAAK,EAAE,aAAK;IACZ,OAAO,EAAE,iBAAO;CACjB,CAAA;AAED,6EAA6E;AAC7E,4EA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AAC,CAAA;AAe5C,iBAAS;AAdX,sBAAoB,iBAAiB,CAAC,CAAA;AAepC,aAAK;AAdP,wBAAsB,mBAAmB,CAAC,CAAA;AAexC,eAAO;AAGT,0DAA0D;AAC1D,MAAM,CAAC,aAAa,CAAC,GAAG;IACtB,WAAW,EAAE,yBAAW;IACxB,gBAAA,+BAAc;IACd,GAAG,EAAE,SAAG;IACR,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,QAAQ,EAAE,mBAAQ;IAClB,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,WAAW,EAAE,yBAAW;IACxB,IAAI,EAAE,WAAI;IACV,SAAS,EAAE,qBAAS;IACpB,KAAK,EAAE,aAAK;IACZ,OAAO,EAAE,iBAAO;CACjB,CAAA;AAED,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,+CAA+C;AAC/C,IAAI,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC;AAEvB,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE;IACvC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,CAAC,CAAC,IAAI,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,CAAA;IACnE,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC,CAAA;AAEF,UAAU,CAAC;IACT,EAAE,CAAA,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,0CAA0C,GAAG,oBAAoB,GAAG,0HAA0H,CAAC,CAAC;IAC/M,CAAC;AACH,CAAC,EAAE,oBAAoB,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/plugins/barcodescanner.d.ts b/dist/plugins/barcodescanner.d.ts new file mode 100644 index 000000000..db0e9bd91 --- /dev/null +++ b/dist/plugins/barcodescanner.d.ts @@ -0,0 +1,17 @@ +/** + * 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). + * + * @usage + * ```js + * BarcodeScanner.scan(options).then((barcodeData) => { + * // Success! Barcode data is here + * }, (err) => { + * // An error occurred + * }); + * ``` + */ +export declare class BarcodeScanner { + static scan(options: any): void; +} diff --git a/dist/plugins/barcodescanner.js b/dist/plugins/barcodescanner.js new file mode 100644 index 000000000..9a8aefcf5 --- /dev/null +++ b/dist/plugins/barcodescanner.js @@ -0,0 +1,40 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var plugin_1 = require('./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). + * + * @usage + * ```js + * BarcodeScanner.scan(options).then((barcodeData) => { + * // Success! Barcode data is here + * }, (err) => { + * // An error occurred + * }); + * ``` + */ +var BarcodeScanner = (function () { + function BarcodeScanner() { + } + BarcodeScanner.scan = function (options) { }; + ; + __decorate([ + plugin_1.Cordova() + ], BarcodeScanner, "scan", null); + BarcodeScanner = __decorate([ + plugin_1.Plugin({ + name: 'BarcodeScanner', + plugin: 'phonegap-plugin-barcodescanner', + pluginRef: 'cordova.plugins.barcodeScanner' + }) + ], BarcodeScanner); + return BarcodeScanner; +})(); +exports.BarcodeScanner = BarcodeScanner; +//# sourceMappingURL=barcodescanner.js.map \ No newline at end of file diff --git a/dist/plugins/barcodescanner.js.map b/dist/plugins/barcodescanner.js.map new file mode 100644 index 000000000..a0c201145 --- /dev/null +++ b/dist/plugins/barcodescanner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"barcodescanner.js","sourceRoot":"","sources":["../../src/plugins/barcodescanner.ts"],"names":["BarcodeScanner","BarcodeScanner.constructor","BarcodeScanner.scan"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;GAaG;AACH;IAAAA;IAQAC,CAACA;IADQD,mBAAIA,GADXA,UACYA,OAAWA,IAAEE,CAACA;;IAD1BF;QAACA,gBAAOA,EAAEA;OACHA,sBAAIA,QAAeA;IAP5BA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,gBAAgBA;YACtBA,MAAMA,EAAEA,gCAAgCA;YACxCA,SAASA,EAAEA,gCAAgCA;SAC5CA,CAACA;uBAIDA;IAADA,qBAACA;AAADA,CAACA,AARD,IAQC;AAHY,sBAAc,iBAG1B,CAAA"} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index bdad2bc11..542073f07 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ const DEVICE_READY_TIMEOUT = 2000; declare var window; import {ActionSheet} from './plugins/actionsheet'; +import {BarcodeScanner} from './plugins/barcodescanner'; import {BLE} from './plugins/ble'; import {Camera} from './plugins/camera'; import {Calendar} from './plugins/calendar'; @@ -21,6 +22,7 @@ import {TouchID} from './plugins/touchid'; export { ActionSheet, + BarcodeScanner, BLE, Camera, Calendar, @@ -37,6 +39,7 @@ export { // Window export to use outside of a module loading system window['IonicNative'] = { ActionSheet: ActionSheet, + BarcodeScanner, BLE: BLE, Camera: Camera, Calendar: Calendar, diff --git a/src/plugins/barcodescanner.ts b/src/plugins/barcodescanner.ts new file mode 100644 index 000000000..0a9172cb7 --- /dev/null +++ b/src/plugins/barcodescanner.ts @@ -0,0 +1,25 @@ +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). + * + * @usage + * ```js + * BarcodeScanner.scan(options).then((barcodeData) => { + * // Success! Barcode data is here + * }, (err) => { + * // An error occurred + * }); + * ``` + */ +@Plugin({ + name: 'BarcodeScanner', + plugin: 'phonegap-plugin-barcodescanner', + pluginRef: 'cordova.plugins.barcodeScanner' +}) +export class BarcodeScanner { + @Cordova() + static scan(options:any){}; +} diff --git a/tsconfig.json b/tsconfig.json index 2293a3e48..41a31ad02 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "src/index.ts", "src/ng1.ts", "src/plugins/actionsheet.ts", + "src/plugins/barcodescanner.ts", "src/plugins/ble.ts", "src/plugins/calendar.ts", "src/plugins/camera.ts",