BarcodeScanner

This commit is contained in:
Rickard Ekman 2016-02-02 15:35:45 +01:00
parent 536a8e5898
commit c94fe23d2a
25 changed files with 318 additions and 7 deletions

View File

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

3
dist/index.d.ts vendored
View File

@ -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 };

3
dist/index.js vendored
View File

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

2
dist/index.js.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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AAW,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"}

17
dist/plugins/barcodescanner.d.ts vendored Normal file
View File

@ -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;
}

40
dist/plugins/barcodescanner.js vendored Normal file
View File

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

1
dist/plugins/barcodescanner.js.map vendored Normal file
View File

@ -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"}

View File

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

View File

@ -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() {
}

View File

@ -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"}
{"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"}

View File

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

View File

@ -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() {
}

View File

@ -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"}
{"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"}

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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"}
{"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"}

View File

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

View File

@ -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() {
}

View File

@ -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"}
{"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"}

View File

@ -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;
}

View File

@ -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([

View File

@ -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"}
{"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"}

View File

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

View File

@ -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){};
}

View File

@ -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",