Yea toast

This commit is contained in:
Max Lynch 2015-11-30 12:34:54 -06:00
parent b6e612209a
commit 2d70c6a3d4
87 changed files with 774 additions and 885 deletions

View File

@ -6,6 +6,7 @@ import {
Camera,
Contacts,
Device,
Geolocation,
StatusBar,
Toast
} from 'ionic-native';
@ -25,6 +26,7 @@ export class HomePage {
Camera,
Contacts,
Device,
Geolocation,
StatusBar,
Toast
];

View File

@ -6,8 +6,8 @@
<ion-content>
<ion-list>
<ion-item *ng-for="#method of methods" (click)="doMethod(method)">
<button ion-item *ng-for="#method of methods" (click)="doMethod(method)">
{{method}}()
</ion-item>
</button>
</ion-list>
</ion-content>

BIN
dist/.index.js.swp vendored Normal file

Binary file not shown.

5
dist/cordova.d.ts vendored
View File

@ -1,5 +0,0 @@
export declare class Cordova {
static hasPlugin(pluginRef: string): boolean;
static plugin(pluginRef: string): any;
static promisify(pluginRef: any, pluginName: any, methodName: any, successIndex: any, errorIndex: any): (...args: any[]) => any;
}

42
dist/cordova.js vendored
View File

@ -1,42 +0,0 @@
var util_1 = require('./util');
var Cordova = (function () {
function Cordova() {
}
Cordova.hasPlugin = function (pluginRef) {
return !!this.plugin(pluginRef);
};
Cordova.plugin = function (pluginRef) {
return util_1.get(window, pluginRef);
};
Cordova.promisify = function (pluginRef, pluginName, methodName, successIndex, errorIndex) {
var _this = this;
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
return new Promise(function (resolve, reject) {
if (!window.cordova) {
console.warn('Cordova: tried calling', '"' + pluginName + '.' + methodName + '"', 'but Cordova is not defined. Please make sure you have cordova.js included in your index.html file and you are running in a proper cordova environment');
reject({
error: 'cordova_not_available'
});
return;
}
if (!_this.hasPlugin(pluginRef)) {
console.warn('Cordova: tried calling', '"' + pluginName + '.' + methodName + '"', 'but the ' + pluginName + ' plugin is not installed.');
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova: exec(' + pluginName + ', ' + methodName + ')');
args[successIndex] = resolve;
args[errorIndex] = reject;
util_1.get(window, pluginRef)[methodName].apply(_this, args);
});
};
};
return Cordova;
})();
exports.Cordova = Cordova;

1
dist/index.d.ts vendored
View File

@ -3,5 +3,6 @@ export * from './plugins/ble';
export * from './plugins/camera';
export * from './plugins/contacts';
export * from './plugins/device';
export * from './plugins/geolocation';
export * from './plugins/statusbar';
export * from './plugins/toast';

2
dist/index.js vendored
View File

@ -7,6 +7,7 @@ __export(require('./plugins/ble'));
__export(require('./plugins/camera'));
__export(require('./plugins/contacts'));
__export(require('./plugins/device'));
__export(require('./plugins/geolocation'));
__export(require('./plugins/statusbar'));
__export(require('./plugins/toast'));
var didFireReady = false;
@ -18,3 +19,4 @@ setTimeout(function () {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
}
}, DEVICE_READY_TIMEOUT);
//# sourceMappingURL=index.js.map

1
dist/index.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,iBAAc,uBAAuB,CAAC,EAAA;AACtC,iBAAc,eAAe,CAAC,EAAA;AAC9B,iBAAc,kBAAkB,CAAC,EAAA;AACjC,iBAAc,oBAAoB,CAAC,EAAA;AACnC,iBAAc,kBAAkB,CAAC,EAAA;AACjC,iBAAc,uBAAuB,CAAC,EAAA;AACtC,iBAAc,qBAAqB,CAAC,EAAA;AACpC,iBAAc,iBAAiB,CAAC,EAAA;AAShC,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE;IACrC,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"}

View File

@ -1,8 +0,0 @@
export interface CordovaPlugin {
id: string;
className: string;
plugin: string;
pluginRef: string;
promise?: any;
}
export declare var PluginConfig: CordovaPlugin[];

49
dist/plugin-config.js vendored
View File

@ -1,49 +0,0 @@
exports.PluginConfig = [
{
id: 'device',
className: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device'
},
{
id: 'camera',
className: 'Camera',
plugin: 'cordova-plugin-camera',
promise: ['takePicture'],
pluginRef: 'navigator.camera'
},
{
id: 'statusbar',
className: 'StatusBar',
plugin: 'cordova-plugin-statusbar',
pluginRef: 'StatusBar',
promise: ['show', 'hide', 'styleDefault', 'styleLightContent', 'styleBlackTranslucent', 'styleBlackOpaque']
},
{
id: 'applinks',
className: 'AppLinks',
plugin: 'com.lampa.startapp',
pluginRef: 'navigator.startApp',
promise: ['start', 'check']
},
{
id: 'barcode',
className: 'Barcode',
plugin: 'phonegap-plugin-barcodescanner',
pluginRef: 'cordova.plugins.barcodeScanner',
promise: ['scan', 'encode']
},
{
id: 'camera-roll',
className: 'CameraRoll',
plugin: 'cordova-plugin-camera-roll',
pluginRef: 'CameraRoll',
promise: ['saveToCameraRoll', 'getPhotos']
},
{
id: 'contacts',
className: 'Contacts',
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
},
];

1
dist/plugin.d.ts vendored
View File

@ -1 +0,0 @@
export declare function Plugin(config: any): (cls: any) => any;

18
dist/plugin.js vendored
View File

@ -1,18 +0,0 @@
var PluginDecotor = (function () {
function PluginDecotor(cls, config) {
this.cls = cls;
this.config = config;
}
return PluginDecotor;
})();
function Plugin(config) {
return function (cls) {
for (var _i = 0; _i < config.length; _i++) {
var k = config[_i];
cls[k] = config[k];
}
console.log('Decorated', cls, config);
return cls;
};
}
exports.Plugin = Plugin;

View File

@ -33,3 +33,4 @@ var ActionSheet = (function () {
return ActionSheet;
})();
exports.ActionSheet = ActionSheet;
//# sourceMappingURL=actionsheet.js.map

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

@ -0,0 +1 @@
{"version":3,"file":"actionsheet.js","sourceRoot":"","sources":["../../src/plugins/actionsheet.ts"],"names":["ActionSheet","ActionSheet.constructor","ActionSheet.show","ActionSheet.hide"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAYAC,CAACA;IAJQD,gBAAIA,GADXA,UACYA,OAAWA,IAAEE,CAACA;;IAGnBF,gBAAIA,GADXA,UACYA,OAAWA,IAAEG,CAACA;;IAJ1BH,sBACOA,mBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,mBAAIA,kCAAJA,mBAAIA,IAAeA;IAE1BA,sBACOA,mBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,mBAAIA,kCAAJA,mBAAIA,IAAeA;IAX5BA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,qBAAqBA;YAChCA,IAAIA,EAAEA,8DAA8DA;SACrEA,CAACA;oBAODA;IAADA,kBAACA;AAADA,CAACA,AAZD,IAYC;AANY,mBAAW,cAMvB,CAAA"}

1
dist/plugins/ble.js vendored
View File

@ -68,3 +68,4 @@ var BLE = (function () {
return BLE;
})();
exports.BLE = BLE;
//# sourceMappingURL=ble.js.map

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

@ -0,0 +1 @@
{"version":3,"file":"ble.js","sourceRoot":"","sources":["../../src/plugins/ble.ts"],"names":["BLE","BLE.constructor","BLE.scan","BLE.startScan","BLE.stopScan","BLE.connect","BLE.disconnect","BLE.read","BLE.write","BLE.writeWithoutResponse"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IA8BAC,CAACA;IAtBQD,QAAIA,GADXA,UACYA,QAAcA,EAAEA,OAAcA,IAAGE,CAACA;IAGvCF,aAASA,GADhBA,UACiBA,QAAcA,IAAEG,CAACA;;IAG3BH,YAAQA,GADfA,cACkBI,CAACA;;IAGZJ,WAAOA,GADdA,UACeA,QAAeA,IAAEK,CAACA;;IAG1BL,cAAUA,GADjBA,UACkBA,QAAeA,IAAEM,CAACA;;IAG7BN,QAAIA,GADXA,UACYA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,IAAEO,CAACA;;IAGtEP,SAAKA,GADZA,UACaA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,EAAEA,KAAiBA,IAAEQ,CAACA;;IAG1FR,wBAAoBA,GAD3BA,UAC4BA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,EAAEA,KAAiBA,IAAES,CAACA;;IAtBhHT,sBACOA,WAAIA;;YADVA,gBAAOA,EAAEA;WACHA,WAAIA,kCAAJA,WAAIA,IAAmCA;IAE9CA,sBACOA,gBAASA;;YADfA,gBAAOA,EAAEA;WACHA,gBAASA,kCAATA,gBAASA,IAAkBA;IAElCA,sBACOA,eAAQA;;YADdA,gBAAOA,EAAEA;WACHA,eAAQA,kCAARA,eAAQA,IAAIA;IAEnBA,sBACOA,cAAOA;;YADbA,gBAAOA,EAAEA;WACHA,cAAOA,kCAAPA,cAAOA,IAAmBA;IAEjCA,sBACOA,iBAAUA;;YADhBA,gBAAOA,EAAEA;WACHA,iBAAUA,kCAAVA,iBAAUA,IAAmBA;IAEpCA,sBACOA,WAAIA;;YADVA,gBAAOA,EAAEA;WACHA,WAAIA,kCAAJA,WAAIA,IAAkEA;IAE7EA,sBACOA,YAAKA;;YADXA,gBAAOA,EAAEA;WACHA,YAAKA,kCAALA,YAAKA,IAAqFA;IAEjGA,sBACOA,2BAAoBA;;YAD1BA,gBAAOA,EAAEA;WACHA,2BAAoBA,kCAApBA,2BAAoBA,IAAqFA;IA7BlHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,oBAAoBA;YAC1BA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,KAAKA;YAChBA,UAAUA,EAAEA,mDAAmDA;SAChEA,CAACA;YAyBDA;IAADA,UAACA;AAADA,CAACA,AA9BD,IA8BC;AAxBY,WAAG,MAwBf,CAAA"}

View File

@ -35,3 +35,4 @@ var Camera = (function () {
return Camera;
})();
exports.Camera = Camera;
//# sourceMappingURL=camera.js.map

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

@ -0,0 +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,sBAIOA,oBAAUA;;YAJhBA,gBAAOA,CAACA;gBACPA,6DAA6DA;gBAC7DA,aAAaA,EAAEA,SAASA;aACzBA,CAACA;WACKA,oBAAUA,kCAAVA,oBAAUA,IAAeA;IAEhCA,sBACOA,iBAAOA;;YADbA,gBAAOA,EAAEA;WACHA,iBAAOA,kCAAPA,iBAAOA,IAAIA;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

@ -45,3 +45,4 @@ var Contacts = (function () {
return Contacts;
})();
exports.Contacts = Contacts;
//# sourceMappingURL=contacts.js.map

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

@ -0,0 +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,sBAKOA,kBAAMA;;YALZA,gBAAOA,CAACA;gBACPA,YAAYA,EAAEA,CAACA;gBACfA,UAAUA,EAAEA,CAACA;aACdA,CAACA;WAEKA,kBAAMA,kCAANA,kBAAMA,IAAgCA;IAE7CA,sBAIOA,gBAAIA;;YAJVA,gBAAOA,CAACA;gBACPA,YAAYA,EAAEA,CAACA;gBACfA,UAAUA,EAAEA,CAACA;aACdA,CAACA;WACKA,gBAAIA,kCAAJA,gBAAIA,IAAgCA;IAE3CA,sBACOA,uBAAWA;;YADjBA,gBAAOA,EAAEA;WACHA,uBAAWA,kCAAXA,uBAAWA,IAAIA;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"}

View File

@ -27,3 +27,4 @@ var Device = (function () {
return Device;
})();
exports.Device = Device;
//# sourceMappingURL=device.js.map

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

@ -0,0 +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,sBACOA,mBAASA;;YADfA,uBAAcA;WACRA,mBAASA,kCAATA,mBAASA,IAEfA;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"}

View File

@ -1,2 +0,0 @@
export declare class File {
}

View File

@ -1,3 +1,4 @@
export declare class Device {
static getCurrentPosition: any;
static getCurrentPosition(options: any): void;
static watchPosition(options: any): void;
}

View File

@ -1,4 +1,4 @@
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
@ -10,9 +10,21 @@ var plugin_1 = require('./plugin');
var Device = (function () {
function Device() {
}
__decorate([
plugin_1.Cordova()
], Device, "getCurrentPosition");
Device.getCurrentPosition = function (options) { };
;
Device.watchPosition = function (options) { };
;
Object.defineProperty(Device, "getCurrentPosition",
__decorate([
plugin_1.Cordova()
], Device, "getCurrentPosition", Object.getOwnPropertyDescriptor(Device, "getCurrentPosition")));
Object.defineProperty(Device, "watchPosition",
__decorate([
plugin_1.Cordova({
observable: true,
clearFunction: 'clearWatch()'
})
], Device, "watchPosition", Object.getOwnPropertyDescriptor(Device, "watchPosition")));
Device = __decorate([
plugin_1.Plugin({
name: 'Geolocation',
@ -23,3 +35,4 @@ var Device = (function () {
return Device;
})();
exports.Device = Device;
//# sourceMappingURL=geolocation.js.map

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

@ -0,0 +1 @@
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../src/plugins/geolocation.ts"],"names":["Device","Device.constructor","Device.getCurrentPosition","Device.watchPosition"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAMzC;IAAAA;IAeAC,CAACA;IARQD,yBAAkBA,GADzBA,UAC0BA,OAAWA,IAAEE,CAACA;;IAOjCF,oBAAaA,GAJpBA,UAIqBA,OAAWA,IAAEG,CAACA;;IARnCH,sBACOA,4BAAkBA;;YADxBA,gBAAOA,EAAEA;WACHA,4BAAkBA,kCAAlBA,4BAAkBA,IAAeA;IAGxCA,sBAIOA,uBAAaA;;YAJnBA,gBAAOA,CAACA;gBACPA,UAAUA,EAAEA,IAAIA;gBAChBA,aAAaA,EAAEA,cAAcA;aAC9BA,CAACA;WACKA,uBAAaA,kCAAbA,uBAAaA,IAAeA;IAdrCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;eAWDA;IAADA,aAACA;AAADA,CAACA,AAfD,IAeC;AAVY,cAAM,SAUlB,CAAA"}

View File

@ -2,7 +2,7 @@ export declare const getPlugin: (pluginRef: string) => any;
export declare const isInstalled: (pluginRef: string) => boolean;
export declare const pluginWarn: (pluginName: string, method: string, plugin: string) => void;
export declare const cordovaWarn: (pluginName: string, method: string) => void;
export declare const wrap: (pluginObj: any, methodName: any, opts?: any) => (...args: any[]) => any;
export declare const wrap: (pluginObj: any, methodName: string, opts?: any) => (...args: any[]) => any;
/**
* Class decorator specifying Plugin metadata. Required for all plugins.
*/

101
dist/plugins/plugin.js vendored
View File

@ -1,4 +1,5 @@
var util_1 = require('../util');
var Rx_1 = require('@reactivex/rxjs/dist/cjs/Rx');
exports.getPlugin = function (pluginRef) {
return util_1.get(window, pluginRef);
};
@ -23,52 +24,73 @@ exports.cordovaWarn = function (pluginName, method) {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}
};
function callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject) {
if (opts === void 0) { opts = {}; }
if (!window.cordova) {
exports.cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
});
return;
}
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
// If the plugin method expects myMethod(success, err, options)
if (opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
}
else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, 0, resolve);
args.splice(opts.errorIndex, 0, reject);
}
else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
var pluginInstance = exports.getPlugin(pluginObj.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
return util_1.get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
}
function wrapPromise(pluginObj, methodName, args, opts) {
if (opts === void 0) { opts = {}; }
return new Promise(function (resolve, reject) {
callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
});
}
function wrapObservable(pluginObj, methodName, args, opts) {
if (opts === void 0) { opts = {}; }
return Rx_1.Observable.create(function (observer) {
var pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.onNext, observer.onError);
return function () {
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, pluginResult);
};
});
}
exports.wrap = function (pluginObj, methodName, opts) {
if (opts === void 0) { opts = {}; }
console.log('Wrap', pluginObj.name, methodName);
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
console.log('Wrap CALLED', pluginObj.name, methodName, args);
return new Promise(function (resolve, reject) {
if (!window.cordova) {
exports.cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
});
return;
}
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
// If the plugin method expects myMethod(success, err, options)
if (opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
}
else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, resolve);
args.splice(opts.errorIndex, reject);
}
else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
var pluginInstance = exports.getPlugin(pluginObj.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
util_1.get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
});
if (opts.observable) {
console.log("Wrapping observable");
return wrapObservable(pluginObj, methodName, args, opts);
}
else {
return wrapPromise(pluginObj, methodName, args, opts);
}
};
};
/**
@ -129,3 +151,4 @@ function RequiresPlugin(target, key, descriptor) {
return descriptor;
}
exports.RequiresPlugin = RequiresPlugin;
//# sourceMappingURL=plugin.js.map

1
dist/plugins/plugin.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -74,3 +74,4 @@ var StatusBar = (function () {
return StatusBar;
})();
exports.StatusBar = StatusBar;
//# sourceMappingURL=statusbar.js.map

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

@ -0,0 +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,sBACOA,4BAAeA;;YADrBA,gBAAOA,EAAEA;WACHA,4BAAeA,kCAAfA,4BAAeA,IAAqBA;IAC3CA,sBACOA,yBAAYA;;YADlBA,gBAAOA,EAAEA;WACHA,yBAAYA,kCAAZA,yBAAYA,IAAIA;IACvBA,sBACOA,8BAAiBA;;YADvBA,gBAAOA,EAAEA;WACHA,8BAAiBA,kCAAjBA,8BAAiBA,IAAIA;IAC5BA,sBACOA,kCAAqBA;;YAD3BA,gBAAOA,EAAEA;WACHA,kCAAqBA,kCAArBA,kCAAqBA,IAAIA;IAChCA,sBACOA,6BAAgBA;;YADtBA,gBAAOA,EAAEA;WACHA,6BAAgBA,kCAAhBA,6BAAgBA,IAAIA;IAC3BA,sBACOA,kCAAqBA;;YAD3BA,gBAAOA,EAAEA;WACHA,kCAAqBA,kCAArBA,kCAAqBA,IAAoBA;IAChDA,sBACOA,uCAA0BA;;YADhCA,gBAAOA,EAAEA;WACHA,uCAA0BA,kCAA1BA,uCAA0BA,IAAoBA;IACrDA,sBACOA,iBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,iBAAIA,kCAAJA,iBAAIA,IAAIA;IACfA,sBACOA,iBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,iBAAIA,kCAAJA,iBAAIA,IAAIA;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"}

View File

@ -33,3 +33,4 @@ var Toast = (function () {
return Toast;
})();
exports.Toast = Toast;
//# sourceMappingURL=toast.js.map

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

@ -0,0 +1 @@
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/plugins/toast.ts"],"names":["Toast","Toast.constructor","Toast.hide","Toast.showWithOptions"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAYAC,CAACA;IAJQD,UAAIA,GADXA,cACcE,CAACA;;IAGRF,qBAAeA,GADtBA,UACuBA,OAAWA,IAAEG,CAACA;;IAJrCH,sBACOA,aAAIA;;YADVA,gBAAOA,EAAEA;WACHA,aAAIA,kCAAJA,aAAIA,IAAIA;IAEfA,sBACOA,wBAAeA;;YADrBA,gBAAOA,EAAEA;WACHA,wBAAeA,kCAAfA,wBAAeA,IAAeA;IAXvCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,OAAOA;YACbA,MAAMA,EAAEA,wBAAwBA;YAChCA,SAASA,EAAEA,eAAeA;YAC1BA,IAAIA,EAAEA,yDAAyDA;SAChEA,CAACA;cAODA;IAADA,YAACA;AAADA,CAACA,AAZD,IAYC;AANY,aAAK,QAMjB,CAAA"}

View File

0
dist/src/cordova.js vendored
View File

7
dist/src/index.d.ts vendored
View File

@ -1,7 +0,0 @@
export * from './plugins/actionsheet';
export * from './plugins/ble';
export * from './plugins/camera';
export * from './plugins/contacts';
export * from './plugins/device';
export * from './plugins/statusbar';
export * from './plugins/toast';

View File

@ -1,8 +0,0 @@
export interface CordovaPlugin {
id: string;
className: string;
plugin: string;
pluginRef: string;
promise?: any;
}
export declare var PluginConfig: CordovaPlugin[];

View File

@ -1,49 +0,0 @@
exports.PluginConfig = [
{
id: 'device',
className: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device'
},
{
id: 'camera',
className: 'Camera',
plugin: 'cordova-plugin-camera',
promise: ['takePicture'],
pluginRef: 'navigator.camera'
},
{
id: 'statusbar',
className: 'StatusBar',
plugin: 'cordova-plugin-statusbar',
pluginRef: 'StatusBar',
promise: ['show', 'hide', 'styleDefault', 'styleLightContent', 'styleBlackTranslucent', 'styleBlackOpaque']
},
{
id: 'applinks',
className: 'AppLinks',
plugin: 'com.lampa.startapp',
pluginRef: 'navigator.startApp',
promise: ['start', 'check']
},
{
id: 'barcode',
className: 'Barcode',
plugin: 'phonegap-plugin-barcodescanner',
pluginRef: 'cordova.plugins.barcodeScanner',
promise: ['scan', 'encode']
},
{
id: 'camera-roll',
className: 'CameraRoll',
plugin: 'cordova-plugin-camera-roll',
pluginRef: 'CameraRoll',
promise: ['saveToCameraRoll', 'getPhotos']
},
{
id: 'contacts',
className: 'Contacts',
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
},
];

View File

@ -1,4 +0,0 @@
export declare class ActionSheet {
static show(options: any): void;
static hide(options: any): void;
}

View File

@ -1,41 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var ActionSheet = (function () {
function ActionSheet() {
}
ActionSheet.show = function (options) { };
;
ActionSheet.hide = function (options) { };
;
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], ActionSheet, "show", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], ActionSheet, "hide", null);
ActionSheet = __decorate([
plugin_1.Plugin({
name: 'ActionSheet',
plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet'
}),
__metadata('design:paramtypes', [])
], ActionSheet);
return ActionSheet;
})();
exports.ActionSheet = ActionSheet;

View File

@ -1,10 +0,0 @@
export declare class BLE {
static scan(services: any[], seconds: number): void;
static startScan(services: any[]): void;
static stopScan(): void;
static connect(deviceId: string): void;
static disconnect(deviceId: string): void;
static read(deviceId: string, serviceUUID: string, characteristicUUID: string): void;
static write(deviceId: string, serviceUUID: string, characteristicUUID: string, value: ArrayBuffer): void;
static writeWithoutResponse(deviceId: string, serviceUUID: string, characteristicUUID: string, value: ArrayBuffer): void;
}

View File

@ -1,91 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var BLE = (function () {
function BLE() {
}
BLE.scan = function (services, seconds) { };
BLE.startScan = function (services) { };
;
BLE.stopScan = function () { };
;
BLE.connect = function (deviceId) { };
;
BLE.disconnect = function (deviceId) { };
;
BLE.read = function (deviceId, serviceUUID, characteristicUUID) { };
;
BLE.write = function (deviceId, serviceUUID, characteristicUUID, value) { };
;
BLE.writeWithoutResponse = function (deviceId, serviceUUID, characteristicUUID, value) { };
;
__decorate([
plugin_1.Cordova({
successIndex: 2,
errIndex: 3
}),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Array, Number]),
__metadata('design:returntype', void 0)
], BLE, "scan", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Array]),
__metadata('design:returntype', void 0)
], BLE, "startScan", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], BLE, "stopScan", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String]),
__metadata('design:returntype', void 0)
], BLE, "connect", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String]),
__metadata('design:returntype', void 0)
], BLE, "disconnect", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String, String, String]),
__metadata('design:returntype', void 0)
], BLE, "read", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String, String, String, ArrayBuffer]),
__metadata('design:returntype', void 0)
], BLE, "write", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String, String, String, ArrayBuffer]),
__metadata('design:returntype', void 0)
], BLE, "writeWithoutResponse", null);
BLE = __decorate([
plugin_1.Plugin({
name: 'BluetoothLowEnergy',
plugin: 'cordova-plugin-ble-central',
pluginRef: 'ble',
pluginRepo: 'https://github.com/don/cordova-plugin-ble-central'
}),
__metadata('design:paramtypes', [])
], BLE);
return BLE;
})();
exports.BLE = BLE;

View File

@ -1,4 +0,0 @@
export declare class Camera {
static getPicture(options: any): void;
static cleanup(): void;
}

View File

@ -1,42 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var Camera = (function () {
function Camera() {
}
Camera.getPicture = function (options) { };
;
Camera.cleanup = function () { };
;
__decorate([
plugin_1.Cordova({
callbackOrder: 'reverse'
}),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], Camera, "getPicture", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], Camera, "cleanup", null);
Camera = __decorate([
plugin_1.Plugin({
name: 'Camera',
plugin: 'cordova-plugin-camera',
pluginRef: 'navigator.camera'
}),
__metadata('design:paramtypes', [])
], Camera);
return Camera;
})();
exports.Camera = Camera;

View File

@ -1,3 +0,0 @@
export declare class Device {
static getDevice(): any;
}

View File

@ -1,33 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var Device = (function () {
function Device() {
}
Device.getDevice = function () {
return window.device;
};
__decorate([
plugin_1.RequiresPlugin,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], Device, "getDevice", null);
Device = __decorate([
plugin_1.Plugin({
name: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device'
}),
__metadata('design:paramtypes', [])
], Device);
return Device;
})();
exports.Device = Device;

View File

@ -1,2 +0,0 @@
export declare class File {
}

View File

@ -1,24 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var File = (function () {
function File() {
}
File = __decorate([
plugin_1.Plugin({
name: 'File',
plugin: 'cordova-plugin-file',
pluginRef: 'cordova.file'
}),
__metadata('design:paramtypes', [])
], File);
return File;
})();
exports.File = File;

View File

@ -1,3 +0,0 @@
export declare class Device {
static getCurrentPosition(options: any): void;
}

View File

@ -1,32 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var Device = (function () {
function Device() {
}
Device.getCurrentPosition = function (options) { };
;
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], Device, "getCurrentPosition", null);
Device = __decorate([
plugin_1.Plugin({
name: 'Geolocation',
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation'
}),
__metadata('design:paramtypes', [])
], Device);
return Device;
})();
exports.Device = Device;

View File

@ -1,10 +0,0 @@
export declare const getPlugin: (pluginRef: string) => any;
export declare const isInstalled: (pluginRef: string) => boolean;
export declare const pluginWarn: (pluginName: string, method: string, plugin: string) => void;
export declare const cordovaWarn: (pluginName: string, method: string) => void;
export declare const wrap: (pluginObj: any, methodName: any, opts?: any) => (...args: any[]) => any;
export declare function Plugin(config: any): (cls: any) => any;
export declare function Cordova(opts?: any): (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
value: (...args: any[]) => any;
};
export declare function RequiresPlugin(target: Function, key: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any>;

View File

@ -1,11 +0,0 @@
export declare class StatusBar {
static overlaysWebView(doOverlay: boolean): void;
static styleDefault(): void;
static styleLightContent(): void;
static styleBlackTranslucent(): void;
static styleBlackOpaque(): void;
static backgroundColorByName(colorName: string): void;
static backgroundColorByHexString(hexString: string): void;
static hide(): void;
static show(): void;
}

View File

@ -1,96 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var StatusBar = (function () {
function StatusBar() {
}
StatusBar.overlaysWebView = function (doOverlay) { };
;
StatusBar.styleDefault = function () { };
;
StatusBar.styleLightContent = function () { };
;
StatusBar.styleBlackTranslucent = function () { };
;
StatusBar.styleBlackOpaque = function () { };
;
StatusBar.backgroundColorByName = function (colorName) { };
;
StatusBar.backgroundColorByHexString = function (hexString) { };
;
StatusBar.hide = function () { };
;
StatusBar.show = function () { };
;
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Boolean]),
__metadata('design:returntype', void 0)
], StatusBar, "overlaysWebView", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "styleDefault", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "styleLightContent", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "styleBlackTranslucent", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "styleBlackOpaque", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String]),
__metadata('design:returntype', void 0)
], StatusBar, "backgroundColorByName", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String]),
__metadata('design:returntype', void 0)
], StatusBar, "backgroundColorByHexString", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "hide", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], StatusBar, "show", null);
StatusBar = __decorate([
plugin_1.Plugin({
name: 'StatusBar',
plugin: 'cordova-plugin-statusbar',
pluginRef: 'StatusBar'
}),
__metadata('design:paramtypes', [])
], StatusBar);
return StatusBar;
})();
exports.StatusBar = StatusBar;

View File

@ -1,4 +0,0 @@
export declare class Toast {
static hide(): void;
static showWithOptions(options: any): void;
}

View File

@ -1,41 +0,0 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var plugin_1 = require('./plugin');
var Toast = (function () {
function Toast() {
}
Toast.hide = function () { };
;
Toast.showWithOptions = function (options) { };
;
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], Toast, "hide", null);
__decorate([
plugin_1.Cordova(),
__metadata('design:type', Function),
__metadata('design:paramtypes', [Object]),
__metadata('design:returntype', void 0)
], Toast, "showWithOptions", null);
Toast = __decorate([
plugin_1.Plugin({
name: 'Toast',
plugin: 'cordova-plugin-x-toast',
pluginRef: 'plugins.toast',
repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin'
}),
__metadata('design:paramtypes', [])
], Toast);
return Toast;
})();
exports.Toast = Toast;

1
dist/src/util.d.ts vendored
View File

@ -1 +0,0 @@
export declare function get(obj: any, path: any): any;

1
dist/util.js vendored
View File

@ -9,3 +9,4 @@ function get(obj, path) {
}
exports.get = get;
;
//# sourceMappingURL=util.js.map

1
dist/util.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":["get"],"mappings":"AAAA,aAAoB,GAAG,EAAE,IAAI;IAC3BA,GAAGA,CAAAA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,IAAIA,GAAGA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,CAACA,EAAEA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QACvEA,EAAEA,CAAAA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;YAACA,MAAMA,CAACA,IAAIA,CAACA;QAACA,CAACA;QACzBA,GAAGA,GAAGA,GAAGA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrBA,CAACA;IACDA,MAAMA,CAACA,GAAGA,CAACA;AACbA,CAACA;AANe,WAAG,MAMlB,CAAA;AAAA,CAAC"}

View File

@ -11,7 +11,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc --experimentalDecorators"
"build": "tsc -w --module commonjs --sourcemap --outDir dist/ --experimentalDecorators -d node_modules/@reactivex/rxjs/typings/es6-shim/es6-shim.d.ts src/index.ts --target ES5"
},
"repository": {
"type": "git",

View File

@ -1,20 +1,22 @@
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var DEVICE_READY_TIMEOUT = 2000;
__export(require('./plugins/actionsheet'));
__export(require('./plugins/ble'));
__export(require('./plugins/camera'));
__export(require('./plugins/contacts'));
__export(require('./plugins/device'));
__export(require('./plugins/statusbar'));
__export(require('./plugins/toast'));
var didFireReady = false;
window.addEventListener('deviceready', function () {
didFireReady = true;
});
setTimeout(function () {
if (!didFireReady && window.cordova) {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
}
}, DEVICE_READY_TIMEOUT);
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var DEVICE_READY_TIMEOUT = 2000;
__export(require('./plugins/actionsheet'));
__export(require('./plugins/ble'));
__export(require('./plugins/camera'));
__export(require('./plugins/contacts'));
__export(require('./plugins/device'));
__export(require('./plugins/geolocation'));
__export(require('./plugins/statusbar'));
__export(require('./plugins/toast'));
var didFireReady = false;
window.addEventListener('deviceready', function () {
didFireReady = true;
});
setTimeout(function () {
if (!didFireReady && window.cordova) {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
}
}, DEVICE_READY_TIMEOUT);
//# sourceMappingURL=index.js.map

1
src/index.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,iBAAc,uBAAuB,CAAC,EAAA;AACtC,iBAAc,eAAe,CAAC,EAAA;AAC9B,iBAAc,kBAAkB,CAAC,EAAA;AACjC,iBAAc,oBAAoB,CAAC,EAAA;AACnC,iBAAc,kBAAkB,CAAC,EAAA;AACjC,iBAAc,uBAAuB,CAAC,EAAA;AACtC,iBAAc,qBAAqB,CAAC,EAAA;AACpC,iBAAc,iBAAiB,CAAC,EAAA;AAShC,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE;IACrC,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"}

View File

@ -5,6 +5,7 @@ export * from './plugins/ble';
export * from './plugins/camera';
export * from './plugins/contacts';
export * from './plugins/device';
export * from './plugins/geolocation';
export * from './plugins/statusbar';
export * from './plugins/toast';

View File

@ -0,0 +1,36 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var ActionSheet = (function () {
function ActionSheet() {
}
ActionSheet.show = function (options) { };
;
ActionSheet.hide = function (options) { };
;
Object.defineProperty(ActionSheet, "show",
__decorate([
plugin_1.Cordova()
], ActionSheet, "show", Object.getOwnPropertyDescriptor(ActionSheet, "show")));
Object.defineProperty(ActionSheet, "hide",
__decorate([
plugin_1.Cordova()
], ActionSheet, "hide", Object.getOwnPropertyDescriptor(ActionSheet, "hide")));
ActionSheet = __decorate([
plugin_1.Plugin({
name: 'ActionSheet',
plugin: 'cordova-plugin-actionsheet',
pluginRef: 'plugins.actionsheet',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet'
})
], ActionSheet);
return ActionSheet;
})();
exports.ActionSheet = ActionSheet;
//# sourceMappingURL=actionsheet.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"actionsheet.js","sourceRoot":"","sources":["actionsheet.ts"],"names":["ActionSheet","ActionSheet.constructor","ActionSheet.show","ActionSheet.hide"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAYAC,CAACA;IAJQD,gBAAIA,GADXA,UACYA,OAAWA,IAAEE,CAACA;;IAGnBF,gBAAIA,GADXA,UACYA,OAAWA,IAAEG,CAACA;;IAJ1BH,sBACOA,mBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,mBAAIA,kCAAJA,mBAAIA,IAAeA;IAE1BA,sBACOA,mBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,mBAAIA,kCAAJA,mBAAIA,IAAeA;IAX5BA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,qBAAqBA;YAChCA,IAAIA,EAAEA,8DAA8DA;SACrEA,CAACA;oBAODA;IAADA,kBAACA;AAADA,CAACA,AAZD,IAYC;AANY,mBAAW,cAMvB,CAAA"}

71
src/plugins/ble.js Normal file
View File

@ -0,0 +1,71 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var BLE = (function () {
function BLE() {
}
BLE.scan = function (services, seconds) { };
BLE.startScan = function (services) { };
;
BLE.stopScan = function () { };
;
BLE.connect = function (deviceId) { };
;
BLE.disconnect = function (deviceId) { };
;
BLE.read = function (deviceId, serviceUUID, characteristicUUID) { };
;
BLE.write = function (deviceId, serviceUUID, characteristicUUID, value) { };
;
BLE.writeWithoutResponse = function (deviceId, serviceUUID, characteristicUUID, value) { };
;
Object.defineProperty(BLE, "scan",
__decorate([
plugin_1.Cordova()
], BLE, "scan", Object.getOwnPropertyDescriptor(BLE, "scan")));
Object.defineProperty(BLE, "startScan",
__decorate([
plugin_1.Cordova()
], BLE, "startScan", Object.getOwnPropertyDescriptor(BLE, "startScan")));
Object.defineProperty(BLE, "stopScan",
__decorate([
plugin_1.Cordova()
], BLE, "stopScan", Object.getOwnPropertyDescriptor(BLE, "stopScan")));
Object.defineProperty(BLE, "connect",
__decorate([
plugin_1.Cordova()
], BLE, "connect", Object.getOwnPropertyDescriptor(BLE, "connect")));
Object.defineProperty(BLE, "disconnect",
__decorate([
plugin_1.Cordova()
], BLE, "disconnect", Object.getOwnPropertyDescriptor(BLE, "disconnect")));
Object.defineProperty(BLE, "read",
__decorate([
plugin_1.Cordova()
], BLE, "read", Object.getOwnPropertyDescriptor(BLE, "read")));
Object.defineProperty(BLE, "write",
__decorate([
plugin_1.Cordova()
], BLE, "write", Object.getOwnPropertyDescriptor(BLE, "write")));
Object.defineProperty(BLE, "writeWithoutResponse",
__decorate([
plugin_1.Cordova()
], BLE, "writeWithoutResponse", Object.getOwnPropertyDescriptor(BLE, "writeWithoutResponse")));
BLE = __decorate([
plugin_1.Plugin({
name: 'BluetoothLowEnergy',
plugin: 'cordova-plugin-ble-central',
pluginRef: 'ble',
pluginRepo: 'https://github.com/don/cordova-plugin-ble-central'
})
], BLE);
return BLE;
})();
exports.BLE = BLE;
//# sourceMappingURL=ble.js.map

1
src/plugins/ble.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"ble.js","sourceRoot":"","sources":["ble.ts"],"names":["BLE","BLE.constructor","BLE.scan","BLE.startScan","BLE.stopScan","BLE.connect","BLE.disconnect","BLE.read","BLE.write","BLE.writeWithoutResponse"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IA8BAC,CAACA;IAtBQD,QAAIA,GADXA,UACYA,QAAcA,EAAEA,OAAcA,IAAGE,CAACA;IAGvCF,aAASA,GADhBA,UACiBA,QAAcA,IAAEG,CAACA;;IAG3BH,YAAQA,GADfA,cACkBI,CAACA;;IAGZJ,WAAOA,GADdA,UACeA,QAAeA,IAAEK,CAACA;;IAG1BL,cAAUA,GADjBA,UACkBA,QAAeA,IAAEM,CAACA;;IAG7BN,QAAIA,GADXA,UACYA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,IAAEO,CAACA;;IAGtEP,SAAKA,GADZA,UACaA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,EAAEA,KAAiBA,IAAEQ,CAACA;;IAG1FR,wBAAoBA,GAD3BA,UAC4BA,QAAeA,EAAEA,WAAkBA,EAAEA,kBAAyBA,EAAEA,KAAiBA,IAAES,CAACA;;IAtBhHT,sBACOA,WAAIA;;YADVA,gBAAOA,EAAEA;WACHA,WAAIA,kCAAJA,WAAIA,IAAmCA;IAE9CA,sBACOA,gBAASA;;YADfA,gBAAOA,EAAEA;WACHA,gBAASA,kCAATA,gBAASA,IAAkBA;IAElCA,sBACOA,eAAQA;;YADdA,gBAAOA,EAAEA;WACHA,eAAQA,kCAARA,eAAQA,IAAIA;IAEnBA,sBACOA,cAAOA;;YADbA,gBAAOA,EAAEA;WACHA,cAAOA,kCAAPA,cAAOA,IAAmBA;IAEjCA,sBACOA,iBAAUA;;YADhBA,gBAAOA,EAAEA;WACHA,iBAAUA,kCAAVA,iBAAUA,IAAmBA;IAEpCA,sBACOA,WAAIA;;YADVA,gBAAOA,EAAEA;WACHA,WAAIA,kCAAJA,WAAIA,IAAkEA;IAE7EA,sBACOA,YAAKA;;YADXA,gBAAOA,EAAEA;WACHA,YAAKA,kCAALA,YAAKA,IAAqFA;IAEjGA,sBACOA,2BAAoBA;;YAD1BA,gBAAOA,EAAEA;WACHA,2BAAoBA,kCAApBA,2BAAoBA,IAAqFA;IA7BlHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,oBAAoBA;YAC1BA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,KAAKA;YAChBA,UAAUA,EAAEA,mDAAmDA;SAChEA,CAACA;YAyBDA;IAADA,UAACA;AAADA,CAACA,AA9BD,IA8BC;AAxBY,WAAG,MAwBf,CAAA"}

38
src/plugins/camera.js Normal file
View File

@ -0,0 +1,38 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var Camera = (function () {
function Camera() {
}
Camera.getPicture = function (options) { };
;
Camera.cleanup = function () { };
;
Object.defineProperty(Camera, "getPicture",
__decorate([
plugin_1.Cordova({
// Not sure why this plugin has the success/err come first...
callbackOrder: 'reverse'
})
], Camera, "getPicture", Object.getOwnPropertyDescriptor(Camera, "getPicture")));
Object.defineProperty(Camera, "cleanup",
__decorate([
plugin_1.Cordova()
], Camera, "cleanup", Object.getOwnPropertyDescriptor(Camera, "cleanup")));
Camera = __decorate([
plugin_1.Plugin({
name: 'Camera',
plugin: 'cordova-plugin-camera',
pluginRef: 'navigator.camera'
})
], Camera);
return Camera;
})();
exports.Camera = Camera;
//# sourceMappingURL=camera.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"camera.js","sourceRoot":"","sources":["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,sBAIOA,oBAAUA;;YAJhBA,gBAAOA,CAACA;gBACPA,6DAA6DA;gBAC7DA,aAAaA,EAAEA,SAASA;aACzBA,CAACA;WACKA,oBAAUA,kCAAVA,oBAAUA,IAAeA;IAEhCA,sBACOA,iBAAOA;;YADbA,gBAAOA,EAAEA;WACHA,iBAAOA,kCAAPA,iBAAOA,IAAIA;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"}

48
src/plugins/contacts.js Normal file
View File

@ -0,0 +1,48 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var Contacts = (function () {
function Contacts() {
}
Contacts.create = function (fields, options) { };
;
Contacts.find = function (fields, options) { };
;
Contacts.pickContact = function () { };
;
Object.defineProperty(Contacts, "create",
__decorate([
plugin_1.Cordova({
successIndex: 1,
errorIndex: 2
})
], Contacts, "create", Object.getOwnPropertyDescriptor(Contacts, "create")));
Object.defineProperty(Contacts, "find",
__decorate([
plugin_1.Cordova({
successIndex: 1,
errorIndex: 2
})
], Contacts, "find", Object.getOwnPropertyDescriptor(Contacts, "find")));
Object.defineProperty(Contacts, "pickContact",
__decorate([
plugin_1.Cordova()
], Contacts, "pickContact", Object.getOwnPropertyDescriptor(Contacts, "pickContact")));
Contacts = __decorate([
plugin_1.Plugin({
name: 'Contacts',
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts'
})
], Contacts);
return Contacts;
})();
exports.Contacts = Contacts;
//# sourceMappingURL=contacts.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["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,sBAKOA,kBAAMA;;YALZA,gBAAOA,CAACA;gBACPA,YAAYA,EAAEA,CAACA;gBACfA,UAAUA,EAAEA,CAACA;aACdA,CAACA;WAEKA,kBAAMA,kCAANA,kBAAMA,IAAgCA;IAE7CA,sBAIOA,gBAAIA;;YAJVA,gBAAOA,CAACA;gBACPA,YAAYA,EAAEA,CAACA;gBACfA,UAAUA,EAAEA,CAACA;aACdA,CAACA;WACKA,gBAAIA,kCAAJA,gBAAIA,IAAgCA;IAE3CA,sBACOA,uBAAWA;;YADjBA,gBAAOA,EAAEA;WACHA,uBAAWA,kCAAXA,uBAAWA,IAAIA;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"}

30
src/plugins/device.js Normal file
View File

@ -0,0 +1,30 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var Device = (function () {
function Device() {
}
Device.getDevice = function () {
return window.device;
};
Object.defineProperty(Device, "getDevice",
__decorate([
plugin_1.RequiresPlugin
], Device, "getDevice", Object.getOwnPropertyDescriptor(Device, "getDevice")));
Device = __decorate([
plugin_1.Plugin({
name: 'Device',
plugin: 'cordova-plugin-device',
pluginRef: 'device'
})
], Device);
return Device;
})();
exports.Device = Device;
//# sourceMappingURL=device.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"device.js","sourceRoot":"","sources":["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,sBACOA,mBAASA;;YADfA,uBAAcA;WACRA,mBAASA,kCAATA,mBAASA,IAEfA;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"}

View File

@ -1,4 +1,4 @@
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
@ -20,3 +20,4 @@ var File = (function () {
return File;
})();
exports.File = File;
//# sourceMappingURL=file.js.map

1
src/plugins/file.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"file.js","sourceRoot":"","sources":["file.ts"],"names":["File","File.constructor"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAIzC;IAAAA;IAMAC,CAACA;IANDD;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,MAAMA;YACZA,MAAMA,EAAEA,qBAAqBA;YAC7BA,SAASA,EAAEA,cAAcA;SAC1BA,CAACA;aAEDA;IAADA,WAACA;AAADA,CAACA,AAND,IAMC;AADY,YAAI,OAChB,CAAA"}

View File

@ -0,0 +1,38 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var Device = (function () {
function Device() {
}
Device.getCurrentPosition = function (options) { };
;
Device.watchPosition = function (options) { };
;
Object.defineProperty(Device, "getCurrentPosition",
__decorate([
plugin_1.Cordova()
], Device, "getCurrentPosition", Object.getOwnPropertyDescriptor(Device, "getCurrentPosition")));
Object.defineProperty(Device, "watchPosition",
__decorate([
plugin_1.Cordova({
observable: true,
clearFunction: 'clearWatch()'
})
], Device, "watchPosition", Object.getOwnPropertyDescriptor(Device, "watchPosition")));
Device = __decorate([
plugin_1.Plugin({
name: 'Geolocation',
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation'
})
], Device);
return Device;
})();
exports.Device = Device;
//# sourceMappingURL=geolocation.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["geolocation.ts"],"names":["Device","Device.constructor","Device.getCurrentPosition","Device.watchPosition"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAMzC;IAAAA;IAeAC,CAACA;IARQD,yBAAkBA,GADzBA,UAC0BA,OAAWA,IAAEE,CAACA;;IAOjCF,oBAAaA,GAJpBA,UAIqBA,OAAWA,IAAEG,CAACA;;IARnCH,sBACOA,4BAAkBA;;YADxBA,gBAAOA,EAAEA;WACHA,4BAAkBA,kCAAlBA,4BAAkBA,IAAeA;IAGxCA,sBAIOA,uBAAaA;;YAJnBA,gBAAOA,CAACA;gBACPA,UAAUA,EAAEA,IAAIA;gBAChBA,aAAaA,EAAEA,cAAcA;aAC9BA,CAACA;WACKA,uBAAaA,kCAAbA,uBAAaA,IAAeA;IAdrCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;eAWDA;IAADA,aAACA;AAADA,CAACA,AAfD,IAeC;AAVY,cAAM,SAUlB,CAAA"}

View File

@ -1,5 +1,7 @@
import {Plugin, Cordova} from './plugin';
declare var Promise;
declare var window;
@Plugin({
@ -12,7 +14,9 @@ export class Device {
static getCurrentPosition(options:any){};
// Do this with observables
// @Cordova()
// static watchPosition;
@Cordova({
observable: true,
clearFunction: 'clearWatch()'
})
static watchPosition(options:any){};
}

View File

@ -1,114 +1,154 @@
var util_1 = require('../util');
exports.getPlugin = function (pluginRef) {
return util_1.get(window, pluginRef);
};
exports.isInstalled = function (pluginRef) {
return !!exports.getPlugin(pluginRef);
};
exports.pluginWarn = function (pluginName, method, plugin) {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method +
', but the ' + pluginName + ' plugin is not installed. Install the ' +
plugin + ' plugin');
}
else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed. Install the ' + plugin + ' plugin');
}
};
exports.cordovaWarn = function (pluginName, method) {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}
else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}
};
exports.wrap = function (pluginObj, methodName, opts) {
if (opts === void 0) { opts = {}; }
console.log('Wrap', pluginObj.name, methodName);
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
console.log('Wrap CALLED', pluginObj.name, methodName, args);
return new Promise(function (resolve, reject) {
if (!window.cordova) {
exports.cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
});
return;
}
if (opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
}
else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
args.splice(opts.successIndex, resolve);
args.splice(opts.errorIndex, reject);
}
else {
args.push(resolve);
args.push(reject);
}
var pluginInstance = exports.getPlugin(pluginObj.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
util_1.get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
});
};
};
function Plugin(config) {
return function (cls) {
for (var k in config) {
cls[k] = config[k];
}
return cls;
};
}
exports.Plugin = Plugin;
function Cordova(opts) {
if (opts === void 0) { opts = {}; }
return function (target, methodName, descriptor) {
var originalMethod = descriptor.value;
return {
value: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
return exports.wrap(this, methodName, opts).apply(this, args);
}
};
};
}
exports.Cordova = Cordova;
function RequiresPlugin(target, key, descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
console.log('Calling', this);
if (!window.cordova) {
exports.cordovaWarn(this.name, null);
return;
}
var pluginInstance = exports.getPlugin(this.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(this.name, null, this.name);
return;
}
originalMethod.apply(this, args);
};
return descriptor;
}
exports.RequiresPlugin = RequiresPlugin;
var util_1 = require('../util');
var Rx_1 = require('@reactivex/rxjs/dist/cjs/Rx');
exports.getPlugin = function (pluginRef) {
return util_1.get(window, pluginRef);
};
exports.isInstalled = function (pluginRef) {
return !!exports.getPlugin(pluginRef);
};
exports.pluginWarn = function (pluginName, method, plugin) {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method +
', but the ' + pluginName + ' plugin is not installed. Install the ' +
plugin + ' plugin');
}
else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed. Install the ' + plugin + ' plugin');
}
};
exports.cordovaWarn = function (pluginName, method) {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}
else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
}
};
function callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject) {
if (opts === void 0) { opts = {}; }
if (!window.cordova) {
exports.cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
});
return;
}
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
// If the plugin method expects myMethod(success, err, options)
if (opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
}
else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, 0, resolve);
args.splice(opts.errorIndex, 0, reject);
}
else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
var pluginInstance = exports.getPlugin(pluginObj.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
return util_1.get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
}
function wrapPromise(pluginObj, methodName, args, opts) {
if (opts === void 0) { opts = {}; }
return new Promise(function (resolve, reject) {
callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
});
}
function wrapObservable(pluginObj, methodName, args, opts) {
if (opts === void 0) { opts = {}; }
return Rx_1.Observable.create(function (observer) {
var pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.onNext, observer.onError);
return function () {
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, pluginResult);
};
});
}
exports.wrap = function (pluginObj, methodName, opts) {
if (opts === void 0) { opts = {}; }
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
if (opts.observable) {
console.log("Wrapping observable");
return wrapObservable(pluginObj, methodName, args, opts);
}
else {
return wrapPromise(pluginObj, methodName, args, opts);
}
};
};
/**
* Class decorator specifying Plugin metadata. Required for all plugins.
*/
function Plugin(config) {
return function (cls) {
// Add these fields to the class
for (var k in config) {
cls[k] = config[k];
}
return cls;
};
}
exports.Plugin = Plugin;
/**
* Wrap a stub function in a call to a Cordova plugin, checking if both Cordova
* and the required plugin are installed.
*/
function Cordova(opts) {
if (opts === void 0) { opts = {}; }
return function (target, methodName, descriptor) {
var originalMethod = descriptor.value;
return {
value: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
return exports.wrap(this, methodName, opts).apply(this, args);
}
};
};
}
exports.Cordova = Cordova;
/**
* Before calling the original method, ensure Cordova and the plugin are installed.
*/
function RequiresPlugin(target, key, descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
console.log('Calling', this);
if (!window.cordova) {
exports.cordovaWarn(this.name, null);
return;
}
var pluginInstance = exports.getPlugin(this.pluginRef);
if (!pluginInstance) {
exports.pluginWarn(this.name, null, this.name);
return;
}
originalMethod.apply(this, args);
};
return descriptor;
}
exports.RequiresPlugin = RequiresPlugin;
//# sourceMappingURL=plugin.js.map

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,8 @@ import {get} from '../util';
declare var window;
declare var Promise;
import {Observable} from '@reactivex/rxjs/dist/cjs/Rx';
export const getPlugin = function(pluginRef: string): any {
return get(window, pluginRef);
@ -27,52 +29,73 @@ export const cordovaWarn = function(pluginName: string, method: string) {
}
}
export const wrap = function(pluginObj, methodName, opts: any = {}) {
console.log('Wrap', pluginObj.name, methodName);
return (...args) => {
console.log('Wrap CALLED', pluginObj.name, methodName, args);
return new Promise((resolve, reject) => {
if(!window.cordova) {
cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
})
return;
}
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
// If the plugin method expects myMethod(success, err, options)
if(opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
} else if(typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, resolve);
args.splice(opts.errorIndex, reject);
} else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
let pluginInstance = getPlugin(pluginObj.pluginRef);
if(!pluginInstance) {
pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
function callCordovaPlugin(pluginObj:any, methodName:string, args:any[], opts:any={}, resolve:any, reject:any) {
if(!window.cordova) {
cordovaWarn(pluginObj.name, methodName);
reject({
error: 'cordova_not_available'
})
return;
}
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
// If the plugin method expects myMethod(success, err, options)
if(opts.callbackOrder == 'reverse') {
args[0] = resolve;
args[1] = reject;
} else if(typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, 0, resolve);
args.splice(opts.errorIndex, 0, reject);
} else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
args.push(resolve);
args.push(reject);
}
let pluginInstance = getPlugin(pluginObj.pluginRef);
if(!pluginInstance) {
pluginWarn(pluginObj.name, methodName, pluginObj.name);
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova calling', pluginObj.name, methodName, args);
return get(window, pluginObj.pluginRef)[methodName].apply(pluginObj, args);
}
function wrapPromise(pluginObj:any, methodName:string, args:any[], opts:any={}) {
return new Promise((resolve, reject) => {
callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
})
}
function wrapObservable(pluginObj:any, methodName:string, args:any[], opts:any = {}) {
return Observable.create((observer) => {
let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.onNext, observer.onError);
return () => {
return get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, pluginResult);
}
});
}
export const wrap = function(pluginObj:any, methodName:string, opts:any = {}) {
return (...args) => {
if(opts.observable) {
console.log("Wrapping observable");
return wrapObservable(pluginObj, methodName, args, opts);
} else {
return wrapPromise(pluginObj, methodName, args, opts);
}
}
}

77
src/plugins/statusbar.js Normal file
View File

@ -0,0 +1,77 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var StatusBar = (function () {
function StatusBar() {
}
StatusBar.overlaysWebView = function (doOverlay) { };
;
StatusBar.styleDefault = function () { };
;
StatusBar.styleLightContent = function () { };
;
StatusBar.styleBlackTranslucent = function () { };
;
StatusBar.styleBlackOpaque = function () { };
;
StatusBar.backgroundColorByName = function (colorName) { };
;
StatusBar.backgroundColorByHexString = function (hexString) { };
;
StatusBar.hide = function () { };
;
StatusBar.show = function () { };
;
Object.defineProperty(StatusBar, "overlaysWebView",
__decorate([
plugin_1.Cordova()
], StatusBar, "overlaysWebView", Object.getOwnPropertyDescriptor(StatusBar, "overlaysWebView")));
Object.defineProperty(StatusBar, "styleDefault",
__decorate([
plugin_1.Cordova()
], StatusBar, "styleDefault", Object.getOwnPropertyDescriptor(StatusBar, "styleDefault")));
Object.defineProperty(StatusBar, "styleLightContent",
__decorate([
plugin_1.Cordova()
], StatusBar, "styleLightContent", Object.getOwnPropertyDescriptor(StatusBar, "styleLightContent")));
Object.defineProperty(StatusBar, "styleBlackTranslucent",
__decorate([
plugin_1.Cordova()
], StatusBar, "styleBlackTranslucent", Object.getOwnPropertyDescriptor(StatusBar, "styleBlackTranslucent")));
Object.defineProperty(StatusBar, "styleBlackOpaque",
__decorate([
plugin_1.Cordova()
], StatusBar, "styleBlackOpaque", Object.getOwnPropertyDescriptor(StatusBar, "styleBlackOpaque")));
Object.defineProperty(StatusBar, "backgroundColorByName",
__decorate([
plugin_1.Cordova()
], StatusBar, "backgroundColorByName", Object.getOwnPropertyDescriptor(StatusBar, "backgroundColorByName")));
Object.defineProperty(StatusBar, "backgroundColorByHexString",
__decorate([
plugin_1.Cordova()
], StatusBar, "backgroundColorByHexString", Object.getOwnPropertyDescriptor(StatusBar, "backgroundColorByHexString")));
Object.defineProperty(StatusBar, "hide",
__decorate([
plugin_1.Cordova()
], StatusBar, "hide", Object.getOwnPropertyDescriptor(StatusBar, "hide")));
Object.defineProperty(StatusBar, "show",
__decorate([
plugin_1.Cordova()
], StatusBar, "show", Object.getOwnPropertyDescriptor(StatusBar, "show")));
StatusBar = __decorate([
plugin_1.Plugin({
name: 'StatusBar',
plugin: 'cordova-plugin-statusbar',
pluginRef: 'StatusBar'
})
], StatusBar);
return StatusBar;
})();
exports.StatusBar = StatusBar;
//# sourceMappingURL=statusbar.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["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,sBACOA,4BAAeA;;YADrBA,gBAAOA,EAAEA;WACHA,4BAAeA,kCAAfA,4BAAeA,IAAqBA;IAC3CA,sBACOA,yBAAYA;;YADlBA,gBAAOA,EAAEA;WACHA,yBAAYA,kCAAZA,yBAAYA,IAAIA;IACvBA,sBACOA,8BAAiBA;;YADvBA,gBAAOA,EAAEA;WACHA,8BAAiBA,kCAAjBA,8BAAiBA,IAAIA;IAC5BA,sBACOA,kCAAqBA;;YAD3BA,gBAAOA,EAAEA;WACHA,kCAAqBA,kCAArBA,kCAAqBA,IAAIA;IAChCA,sBACOA,6BAAgBA;;YADtBA,gBAAOA,EAAEA;WACHA,6BAAgBA,kCAAhBA,6BAAgBA,IAAIA;IAC3BA,sBACOA,kCAAqBA;;YAD3BA,gBAAOA,EAAEA;WACHA,kCAAqBA,kCAArBA,kCAAqBA,IAAoBA;IAChDA,sBACOA,uCAA0BA;;YADhCA,gBAAOA,EAAEA;WACHA,uCAA0BA,kCAA1BA,uCAA0BA,IAAoBA;IACrDA,sBACOA,iBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,iBAAIA,kCAAJA,iBAAIA,IAAIA;IACfA,sBACOA,iBAAIA;;YADVA,gBAAOA,EAAEA;WACHA,iBAAIA,kCAAJA,iBAAIA,IAAIA;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"}

36
src/plugins/toast.js Normal file
View File

@ -0,0 +1,36 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var plugin_1 = require('./plugin');
var Toast = (function () {
function Toast() {
}
Toast.hide = function () { };
;
Toast.showWithOptions = function (options) { };
;
Object.defineProperty(Toast, "hide",
__decorate([
plugin_1.Cordova()
], Toast, "hide", Object.getOwnPropertyDescriptor(Toast, "hide")));
Object.defineProperty(Toast, "showWithOptions",
__decorate([
plugin_1.Cordova()
], Toast, "showWithOptions", Object.getOwnPropertyDescriptor(Toast, "showWithOptions")));
Toast = __decorate([
plugin_1.Plugin({
name: 'Toast',
plugin: 'cordova-plugin-x-toast',
pluginRef: 'plugins.toast',
repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin'
})
], Toast);
return Toast;
})();
exports.Toast = Toast;
//# sourceMappingURL=toast.js.map

1
src/plugins/toast.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"toast.js","sourceRoot":"","sources":["toast.ts"],"names":["Toast","Toast.constructor","Toast.hide","Toast.showWithOptions"],"mappings":";;;;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAYAC,CAACA;IAJQD,UAAIA,GADXA,cACcE,CAACA;;IAGRF,qBAAeA,GADtBA,UACuBA,OAAWA,IAAEG,CAACA;;IAJrCH,sBACOA,aAAIA;;YADVA,gBAAOA,EAAEA;WACHA,aAAIA,kCAAJA,aAAIA,IAAIA;IAEfA,sBACOA,wBAAeA;;YADrBA,gBAAOA,EAAEA;WACHA,wBAAeA,kCAAfA,wBAAeA,IAAeA;IAXvCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,OAAOA;YACbA,MAAMA,EAAEA,wBAAwBA;YAChCA,SAASA,EAAEA,eAAeA;YAC1BA,IAAIA,EAAEA,yDAAyDA;SAChEA,CAACA;cAODA;IAADA,YAACA;AAADA,CAACA,AAZD,IAYC;AANY,aAAK,QAMjB,CAAA"}

View File

@ -1,11 +1,12 @@
function get(obj, path) {
for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
if (!obj) {
return null;
}
obj = obj[path[i]];
}
return obj;
}
exports.get = get;
;
function get(obj, path) {
for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
if (!obj) {
return null;
}
obj = obj[path[i]];
}
return obj;
}
exports.get = get;
;
//# sourceMappingURL=util.js.map

1
src/util.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":["get"],"mappings":"AAAA,aAAoB,GAAG,EAAE,IAAI;IAC3BA,GAAGA,CAAAA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,IAAIA,GAAGA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,CAACA,EAAEA,GAAGA,GAAGA,IAAIA,CAACA,MAAMA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QACvEA,EAAEA,CAAAA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;YAACA,MAAMA,CAACA,IAAIA,CAACA;QAACA,CAACA;QACzBA,GAAGA,GAAGA,GAAGA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrBA,CAACA;IACDA,MAAMA,CAACA,GAAGA,CAACA;AACbA,CAACA;AANe,WAAG,MAMlB,CAAA;AAAA,CAAC"}

View File

@ -5,15 +5,26 @@
"noImplicitAny": false,
"outDir": "dist",
"rootDir": ".",
"sourceMap": false,
"sourceMap": true,
"declaration": true
},
"exclude": [
"node_modules"
],
"filesGlob": [
"src/**/*.ts"
],
"files": [
"src/index.ts",
"src/plugin-config.ts",
"src/plugins/actionsheet.ts",
"src/plugins/ble.ts",
"src/plugins/camera.ts",
"src/plugins/contacts.ts",
"src/plugins/device.ts",
"src/plugins/file.ts",
"src/plugins/geolocation.ts",
"src/plugins/plugin.ts",
"src/plugins/statusbar.ts",
"src/plugins/toast.ts",
"src/util.ts"
],