From c94fe23d2a561583ef633ff0179d458d45c1b535 Mon Sep 17 00:00:00 2001 From: Rickard Ekman Date: Tue, 2 Feb 2016 15:35:45 +0100 Subject: [PATCH] BarcodeScanner --- demo/www/app/home/home.js | 2 ++ dist/index.d.ts | 3 +- dist/index.js | 3 ++ dist/index.js.map | 2 +- dist/plugins/barcodescanner.d.ts | 17 +++++++++++ dist/plugins/barcodescanner.js | 40 ++++++++++++++++++++++++++ dist/plugins/barcodescanner.js.map | 1 + dist/plugins/camera.d.ts | 15 ++++++++++ dist/plugins/camera.js | 15 ++++++++++ dist/plugins/camera.js.map | 2 +- dist/plugins/contacts.d.ts | 17 +++++++++++ dist/plugins/contacts.js | 17 +++++++++++ dist/plugins/contacts.js.map | 2 +- dist/plugins/device.d.ts | 14 +++++++++ dist/plugins/device.js | 14 +++++++++ dist/plugins/device.js.map | 2 +- dist/plugins/geolocation.d.ts | 17 +++++++++++ dist/plugins/geolocation.js | 17 +++++++++++ dist/plugins/geolocation.js.map | 2 +- dist/plugins/statusbar.d.ts | 46 ++++++++++++++++++++++++++++++ dist/plugins/statusbar.js | 46 ++++++++++++++++++++++++++++++ dist/plugins/statusbar.js.map | 2 +- src/index.ts | 3 ++ src/plugins/barcodescanner.ts | 25 ++++++++++++++++ tsconfig.json | 1 + 25 files changed, 318 insertions(+), 7 deletions(-) create mode 100644 dist/plugins/barcodescanner.d.ts create mode 100644 dist/plugins/barcodescanner.js create mode 100644 dist/plugins/barcodescanner.js.map create mode 100644 src/plugins/barcodescanner.ts diff --git a/demo/www/app/home/home.js b/demo/www/app/home/home.js index 8ebf84f41a..37ff7bf2ae 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 02a90bfd3a..a814f870e5 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 df3dfc068f..173f12dd3d 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 634dc610cc..4c57b3acd8 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,u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AQ;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 0000000000..db0e9bd915 --- /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 0000000000..9a8aefcf55 --- /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 0000000000..a0c2011458 --- /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/dist/plugins/camera.d.ts b/dist/plugins/camera.d.ts index f433acec78..c447d9bca6 100644 --- a/dist/plugins/camera.d.ts +++ b/dist/plugins/camera.d.ts @@ -1,3 +1,18 @@ +/** + * Take a photo or capture video. + * + * Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). + * + * @usage + * ```js + * Camera.getPicture(options).then((imageData) => { + * // imageData is either a base64 encoded string or a file URI + * // If it's base64: + * let base64Image = "data:image/jpeg;base64," + imageData; + * }, (err) => { + * }); + * ``` + */ export declare class Camera { static getPicture(options: any): void; static cleanup(): void; diff --git a/dist/plugins/camera.js b/dist/plugins/camera.js index f6072b2e99..971b75aa09 100644 --- a/dist/plugins/camera.js +++ b/dist/plugins/camera.js @@ -5,6 +5,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Take a photo or capture video. + * + * Requires Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). + * + * @usage + * ```js + * Camera.getPicture(options).then((imageData) => { + * // imageData is either a base64 encoded string or a file URI + * // If it's base64: + * let base64Image = "data:image/jpeg;base64," + imageData; + * }, (err) => { + * }); + * ``` + */ var Camera = (function () { function Camera() { } diff --git a/dist/plugins/camera.js.map b/dist/plugins/camera.js.map index 5aad4c7e14..dbc535bf07 100644 --- a/dist/plugins/camera.js.map +++ b/dist/plugins/camera.js.map @@ -1 +1 @@ -{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../src/plugins/camera.ts"],"names":["Camera","Camera.constructor","Camera.getPicture","Camera.cleanup"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAcAC,CAACA;IAJQD,iBAAUA,GAJjBA,UAIkBA,OAAWA,IAAEE,CAACA;;IAGzBF,cAAOA,GADdA,cACiBG,CAACA;;IAPlBH;QAACA,gBAAOA,CAACA;YACPA,6DAA6DA;YAC7DA,aAAaA,EAAEA,SAASA;SACzBA,CAACA;OACKA,oBAAUA,QAAeA;IAEhCA;QAACA,gBAAOA,EAAEA;OACHA,iBAAOA,QAAIA;IAbpBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;eAUDA;IAADA,aAACA;AAADA,CAACA,AAdD,IAcC;AATY,cAAM,SASlB,CAAA"} \ No newline at end of file +{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../src/plugins/camera.ts"],"names":["Camera","Camera.constructor","Camera.getPicture","Camera.cleanup"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;GAcG;AACH;IAAAA;IAcAC,CAACA;IAJQD,iBAAUA,GAJjBA,UAIkBA,OAAWA,IAAEE,CAACA;;IAGzBF,cAAOA,GADdA,cACiBG,CAACA;;IAPlBH;QAACA,gBAAOA,CAACA;YACPA,6DAA6DA;YAC7DA,aAAaA,EAAEA,SAASA;SACzBA,CAACA;OACKA,oBAAUA,QAAeA;IAEhCA;QAACA,gBAAOA,EAAEA;OACHA,iBAAOA,QAAIA;IAbpBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;eAUDA;IAADA,aAACA;AAADA,CAACA,AAdD,IAcC;AATY,cAAM,SASlB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/contacts.d.ts b/dist/plugins/contacts.d.ts index 9ae332ce1a..c38e6ca3b4 100644 --- a/dist/plugins/contacts.d.ts +++ b/dist/plugins/contacts.d.ts @@ -1,3 +1,20 @@ +/** + * Access and manage Contacts on the device. + * + * Requires plugin: `cordova-plugin-contacts` + * For full info, please see the [Cordova Contacts Docs](https://github.com/apache/cordova-plugin-contacts) + * + * @usage + * + * ```js + * Contacts.save({ + * displayName: "Mr. Ionitron" + * }).then((contact) => {}, (err) => {}) + * ``` + * + * See the `save()` docs for a full list of fields. + * + */ export declare class Contacts { static create(fields: string[], options: any): void; static find(fields: string[], options: any): void; diff --git a/dist/plugins/contacts.js b/dist/plugins/contacts.js index 6c472824b2..64eb4c73e7 100644 --- a/dist/plugins/contacts.js +++ b/dist/plugins/contacts.js @@ -5,6 +5,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Access and manage Contacts on the device. + * + * Requires plugin: `cordova-plugin-contacts` + * For full info, please see the [Cordova Contacts Docs](https://github.com/apache/cordova-plugin-contacts) + * + * @usage + * + * ```js + * Contacts.save({ + * displayName: "Mr. Ionitron" + * }).then((contact) => {}, (err) => {}) + * ``` + * + * See the `save()` docs for a full list of fields. + * + */ var Contacts = (function () { function Contacts() { } diff --git a/dist/plugins/contacts.js.map b/dist/plugins/contacts.js.map index 2f5997d6d0..2e8a19bd8d 100644 --- a/dist/plugins/contacts.js.map +++ b/dist/plugins/contacts.js.map @@ -1 +1 @@ -{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/plugins/contacts.ts"],"names":["Contacts","Contacts.constructor","Contacts.create","Contacts.find","Contacts.pickContact"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAsBAC,CAACA;IAVQD,eAAMA,GALbA,UAKcA,MAAeA,EAAEA,OAAWA,IAAEE,CAACA;;IAMtCF,aAAIA,GAJXA,UAIYA,MAAeA,EAAEA,OAAWA,IAAEG,CAACA;;IAGpCH,oBAAWA,GADlBA,cACqBI,CAACA;;IAdtBJ;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OAEKA,kBAAMA,QAAgCA;IAE7CA;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OACKA,gBAAIA,QAAgCA;IAE3CA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAAIA;IArBxBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,oBAAoBA;YAC/BA,IAAIA,EAAEA,mDAAmDA;SAC1DA,CAACA;iBAiBDA;IAADA,eAACA;AAADA,CAACA,AAtBD,IAsBC;AAhBY,gBAAQ,WAgBpB,CAAA"} \ No newline at end of file +{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/plugins/contacts.ts"],"names":["Contacts","Contacts.constructor","Contacts.create","Contacts.find","Contacts.pickContact"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;;GAgBG;AAEH;IAAAA;IA+DAC,CAACA;IAzBQD,eAAMA,GA/BbA,UA+BcA,MAAeA,EAAEA,OAAWA,IAAEE,CAACA;;IAqBtCF,aAAIA,GAnBXA,UAmBYA,MAAeA,EAAEA,OAAWA,IAAEG,CAACA;;IAGpCH,oBAAWA,GADlBA,cACqBI,CAACA;;IAvDtBJ;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OA4BKA,kBAAMA,QAAgCA;IAE7CA;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OAgBKA,gBAAIA,QAAgCA;IAE3CA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAAIA;IA9DxBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,oBAAoBA;YAC/BA,IAAIA,EAAEA,mDAAmDA;SAC1DA,CAACA;iBA0DDA;IAADA,eAACA;AAADA,CAACA,AA/DD,IA+DC;AAzDY,gBAAQ,WAyDpB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/device.d.ts b/dist/plugins/device.d.ts index 3e06c17bab..4055a41db3 100644 --- a/dist/plugins/device.d.ts +++ b/dist/plugins/device.d.ts @@ -1,3 +1,17 @@ +/** + * Access information about the underlying device and platform. + * + * @usage + * ```js + * let info = Device.getDevice(); + * // Device sits below + * ``` + */ export declare class Device { + /** + * Returns the whole device object. + * @see https://github.com/apache/cordova-plugin-device + * @returns {Object} The device object. + */ static getDevice(): any; } diff --git a/dist/plugins/device.js b/dist/plugins/device.js index fef6fb922f..5c2b09762c 100644 --- a/dist/plugins/device.js +++ b/dist/plugins/device.js @@ -5,9 +5,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Access information about the underlying device and platform. + * + * @usage + * ```js + * let info = Device.getDevice(); + * // Device sits below + * ``` + */ var Device = (function () { function Device() { } + /** + * Returns the whole device object. + * @see https://github.com/apache/cordova-plugin-device + * @returns {Object} The device object. + */ Device.getDevice = function () { return window.device; }; diff --git a/dist/plugins/device.js.map b/dist/plugins/device.js.map index 6d9146ffb0..4b18c76308 100644 --- a/dist/plugins/device.js.map +++ b/dist/plugins/device.js.map @@ -1 +1 @@ -{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AAIhD;IAAAA;IAWAC,CAACA;IAHQD,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAVHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAODA;IAADA,aAACA;AAADA,CAACA,AAXD,IAWC;AANY,cAAM,SAMlB,CAAA"} \ No newline at end of file +{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AAKhD;;;;;;;;GAQG;AAEH;IAAAA;IAgBAC,CAACA;IATDD;;;;OAIGA;IAEMA,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAfHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAYDA;IAADA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,cAAM,SAWlB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/geolocation.d.ts b/dist/plugins/geolocation.d.ts index af91f15c91..f4bc1d853f 100644 --- a/dist/plugins/geolocation.d.ts +++ b/dist/plugins/geolocation.d.ts @@ -1,3 +1,20 @@ +/** + * Get geolocation data. + * + * @usage + * ```js + * Geolocation.getCurrentPosition().then((resp) => { + * //resp.coords.latitude + * //resp.coords.longitude + * }) + * + * let watch = Geolocation.watchPosition(); + * watch.source.subscribe((data) => { + * //data.coords.latitude + * //data.coords.longitude + * }) + * ``` + */ export declare class Geolocation { static getCurrentPosition(options: any): void; static watchPosition(options: any): void; diff --git a/dist/plugins/geolocation.js b/dist/plugins/geolocation.js index ab15f94a6b..f18a77823c 100644 --- a/dist/plugins/geolocation.js +++ b/dist/plugins/geolocation.js @@ -5,6 +5,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Get geolocation data. + * + * @usage + * ```js + * Geolocation.getCurrentPosition().then((resp) => { + * //resp.coords.latitude + * //resp.coords.longitude + * }) + * + * let watch = Geolocation.watchPosition(); + * watch.source.subscribe((data) => { + * //data.coords.latitude + * //data.coords.longitude + * }) + * ``` + */ var Geolocation = (function () { function Geolocation() { } diff --git a/dist/plugins/geolocation.js.map b/dist/plugins/geolocation.js.map index 3ec0bff52a..a7a34091ed 100644 --- a/dist/plugins/geolocation.js.map +++ b/dist/plugins/geolocation.js.map @@ -1 +1 @@ -{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../src/plugins/geolocation.ts"],"names":["Geolocation","Geolocation.constructor","Geolocation.getCurrentPosition","Geolocation.watchPosition"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAMzC;IAAAA;IAgBAC,CAACA;IATQD,8BAAkBA,GADzBA,UAC0BA,OAAWA,IAAEE,CAACA;;IAQjCF,yBAAaA,GALpBA,UAKqBA,OAAWA,IAAEG,CAACA;;IATnCH;QAACA,gBAAOA,EAAEA;OACHA,iCAAkBA,QAAeA;IAGxCA;QAACA,gBAAOA,CAACA;YACPA,aAAaA,EAAEA,SAASA;YACxBA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,cAAcA;SAC9BA,CAACA;OACKA,4BAAaA,QAAeA;IAfrCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;oBAYDA;IAADA,kBAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,mBAAW,cAWvB,CAAA"} \ No newline at end of file +{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../src/plugins/geolocation.ts"],"names":["Geolocation","Geolocation.constructor","Geolocation.getCurrentPosition","Geolocation.watchPosition"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAOzC;;;;;;;;;;;;;;;;GAgBG;AACH;IAAAA;IAgBAC,CAACA;IATQD,8BAAkBA,GADzBA,UAC0BA,OAAWA,IAAEE,CAACA;;IAQjCF,yBAAaA,GALpBA,UAKqBA,OAAWA,IAAEG,CAACA;;IATnCH;QAACA,gBAAOA,EAAEA;OACHA,iCAAkBA,QAAeA;IAGxCA;QAACA,gBAAOA,CAACA;YACPA,aAAaA,EAAEA,SAASA;YACxBA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,cAAcA;SAC9BA,CAACA;OACKA,4BAAaA,QAAeA;IAfrCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;oBAYDA;IAADA,kBAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,mBAAW,cAWvB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/statusbar.d.ts b/dist/plugins/statusbar.d.ts index dad04fa798..803b1acdd7 100644 --- a/dist/plugins/statusbar.d.ts +++ b/dist/plugins/statusbar.d.ts @@ -1,11 +1,57 @@ +/** + * Manage the appearance of the native status bar. + * + * @usage + * ```js + * StatusBar.hide(); // Hide the bar + * + * StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds + * ``` + */ export declare class StatusBar { + /** + * Set whether the status bar overlays the main app view. The default + * is true. + * + * @param doesOverlay whether the status bar overlays the main app view. + */ static overlaysWebView(doOverlay: boolean): void; static styleDefault(): void; static styleLightContent(): void; static styleBlackTranslucent(): void; static styleBlackOpaque(): void; + /** + * Set the status bar to a specific named color. Valid options: + * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown. + * + * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * + * @param name the name of the color (from above) + */ static backgroundColorByName(colorName: string): void; + /** + * Set the status bar to a specific hex color (CSS shorthand supported!). + * + * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * + * @param hex the hex value of the color. + */ static backgroundColorByHexString(hexString: string): void; + /** + * Hide the StatusBar + * + * Options: + * + * StatusBar.DEFAULT + * StatusBar.LIGHT_CONTENT + * StatusBar.BLACK_TRANSLUCENT + * StatusBar.BLACK_OPAQUE + * + * @param style the style from above + */ static hide(): void; + /** + * Show the StatusBar + */ static show(): void; } diff --git a/dist/plugins/statusbar.js b/dist/plugins/statusbar.js index 956f413b90..8a1d33f426 100644 --- a/dist/plugins/statusbar.js +++ b/dist/plugins/statusbar.js @@ -5,9 +5,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Manage the appearance of the native status bar. + * + * @usage + * ```js + * StatusBar.hide(); // Hide the bar + * + * StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds + * ``` + */ var StatusBar = (function () { function StatusBar() { } + /** + * Set whether the status bar overlays the main app view. The default + * is true. + * + * @param doesOverlay whether the status bar overlays the main app view. + */ StatusBar.overlaysWebView = function (doOverlay) { }; ; StatusBar.styleDefault = function () { }; @@ -18,12 +34,42 @@ var StatusBar = (function () { ; StatusBar.styleBlackOpaque = function () { }; ; + /** + * Set the status bar to a specific named color. Valid options: + * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown. + * + * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * + * @param name the name of the color (from above) + */ StatusBar.backgroundColorByName = function (colorName) { }; ; + /** + * Set the status bar to a specific hex color (CSS shorthand supported!). + * + * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * + * @param hex the hex value of the color. + */ StatusBar.backgroundColorByHexString = function (hexString) { }; ; + /** + * Hide the StatusBar + * + * Options: + * + * StatusBar.DEFAULT + * StatusBar.LIGHT_CONTENT + * StatusBar.BLACK_TRANSLUCENT + * StatusBar.BLACK_OPAQUE + * + * @param style the style from above + */ StatusBar.hide = function () { }; ; + /** + * Show the StatusBar + */ StatusBar.show = function () { }; ; __decorate([ diff --git a/dist/plugins/statusbar.js.map b/dist/plugins/statusbar.js.map index 12c0ba3455..3b87a03679 100644 --- a/dist/plugins/statusbar.js.map +++ b/dist/plugins/statusbar.js.map @@ -1 +1 @@ -{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/plugins/statusbar.ts"],"names":["StatusBar","StatusBar.constructor","StatusBar.overlaysWebView","StatusBar.styleDefault","StatusBar.styleLightContent","StatusBar.styleBlackTranslucent","StatusBar.styleBlackOpaque","StatusBar.backgroundColorByName","StatusBar.backgroundColorByHexString","StatusBar.hide","StatusBar.show"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAwBAC,CAACA;IAjBQD,yBAAeA,GADtBA,UACuBA,SAAiBA,IAAEE,CAACA;;IAEpCF,sBAAYA,GADnBA,cACsBG,CAACA;;IAEhBH,2BAAiBA,GADxBA,cAC2BI,CAACA;;IAErBJ,+BAAqBA,GAD5BA,cAC+BK,CAACA;;IAEzBL,0BAAgBA,GADvBA,cAC0BM,CAACA;;IAEpBN,+BAAqBA,GAD5BA,UAC6BA,SAAgBA,IAAEO,CAACA;;IAEzCP,oCAA0BA,GADjCA,UACkCA,SAAgBA,IAAEQ,CAACA;;IAE9CR,cAAIA,GADXA,cACcS,CAACA;;IAERT,cAAIA,GADXA,cACcU,CAACA;;IAjBfV;QAACA,gBAAOA,EAAEA;OACHA,4BAAeA,QAAqBA;IAC3CA;QAACA,gBAAOA,EAAEA;OACHA,yBAAYA,QAAIA;IACvBA;QAACA,gBAAOA,EAAEA;OACHA,8BAAiBA,QAAIA;IAC5BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAIA;IAChCA;QAACA,gBAAOA,EAAEA;OACHA,6BAAgBA,QAAIA;IAC3BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAoBA;IAChDA;QAACA,gBAAOA,EAAEA;OACHA,uCAA0BA,QAAoBA;IACrDA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IACfA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IAvBjBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,WAAWA;YACjBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,WAAWA;SACvBA,CAACA;kBAoBDA;IAADA,gBAACA;AAADA,CAACA,AAxBD,IAwBC;AAnBY,iBAAS,YAmBrB,CAAA"} \ No newline at end of file +{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/plugins/statusbar.ts"],"names":["StatusBar","StatusBar.constructor","StatusBar.overlaysWebView","StatusBar.styleDefault","StatusBar.styleLightContent","StatusBar.styleBlackTranslucent","StatusBar.styleBlackOpaque","StatusBar.backgroundColorByName","StatusBar.backgroundColorByHexString","StatusBar.hide","StatusBar.show"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAGzC;;;;;;;;;GASG;AACH;IAAAA;IAoEAC,CAACA;IA9DCD;;;;;OAKGA;IAEIA,yBAAeA,GADtBA,UACuBA,SAAiBA,IAAEE,CAACA;;IAGpCF,sBAAYA,GADnBA,cACsBG,CAACA;;IAGhBH,2BAAiBA,GADxBA,cAC2BI,CAACA;;IAGrBJ,+BAAqBA,GAD5BA,cAC+BK,CAACA;;IAGzBL,0BAAgBA,GADvBA,cAC0BM,CAACA;;IAE3BN;;;;;;;OAOGA;IAEIA,+BAAqBA,GAD5BA,UAC6BA,SAAgBA,IAAEO,CAACA;;IAEhDP;;;;;;OAMGA;IAEIA,oCAA0BA,GADjCA,UACkCA,SAAgBA,IAAEQ,CAACA;;IAErDR;;;;;;;;;;;OAWGA;IAEIA,cAAIA,GADXA,cACcS,CAACA;;IAEfT;;MAEEA;IAEKA,cAAIA,GADXA,cACcU,CAACA;;IAvDfV;QAACA,gBAAOA,EAAEA;OACHA,4BAAeA,QAAqBA;IAE3CA;QAACA,gBAAOA,EAAEA;OACHA,yBAAYA,QAAIA;IAEvBA;QAACA,gBAAOA,EAAEA;OACHA,8BAAiBA,QAAIA;IAE5BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAIA;IAEhCA;QAACA,gBAAOA,EAAEA;OACHA,6BAAgBA,QAAIA;IAU3BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAoBA;IAShDA;QAACA,gBAAOA,EAAEA;OACHA,uCAA0BA,QAAoBA;IAcrDA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IAKfA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IAnEjBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,WAAWA;YACjBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,WAAWA;SACvBA,CAACA;kBAgEDA;IAADA,gBAACA;AAADA,CAACA,AApED,IAoEC;AA/DY,iBAAS,YA+DrB,CAAA"} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index bdad2bc110..542073f074 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 0000000000..0a9172cb76 --- /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 2293a3e480..41a31ad026 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",