chore(): don't track dist
This commit is contained in:
parent
3b06f4cfe6
commit
ea0067297c
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
node_modules/
|
||||
.idea
|
||||
dist/
|
||||
|
14
dist/index.d.ts
vendored
14
dist/index.d.ts
vendored
@ -1,14 +0,0 @@
|
||||
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';
|
||||
import { Contacts } from './plugins/contacts';
|
||||
import { Device } from './plugins/device';
|
||||
import { Facebook } from './plugins/facebook';
|
||||
import { Geolocation } from './plugins/geolocation';
|
||||
import { Push } from './plugins/push';
|
||||
import { StatusBar } from './plugins/statusbar';
|
||||
import { Toast } from './plugins/toast';
|
||||
import { TouchID } from './plugins/touchid';
|
||||
export { ActionSheet, BarcodeScanner, BLE, Camera, Calendar, Contacts, Device, Facebook, Geolocation, Push, StatusBar, Toast, TouchID };
|
61
dist/index.js
vendored
61
dist/index.js
vendored
@ -1,61 +0,0 @@
|
||||
var ng1_1 = require('./ng1');
|
||||
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');
|
||||
exports.Camera = camera_1.Camera;
|
||||
var calendar_1 = require('./plugins/calendar');
|
||||
exports.Calendar = calendar_1.Calendar;
|
||||
var contacts_1 = require('./plugins/contacts');
|
||||
exports.Contacts = contacts_1.Contacts;
|
||||
var device_1 = require('./plugins/device');
|
||||
exports.Device = device_1.Device;
|
||||
var facebook_1 = require('./plugins/facebook');
|
||||
exports.Facebook = facebook_1.Facebook;
|
||||
var geolocation_1 = require('./plugins/geolocation');
|
||||
exports.Geolocation = geolocation_1.Geolocation;
|
||||
var push_1 = require('./plugins/push');
|
||||
exports.Push = push_1.Push;
|
||||
var statusbar_1 = require('./plugins/statusbar');
|
||||
exports.StatusBar = statusbar_1.StatusBar;
|
||||
var toast_1 = require('./plugins/toast');
|
||||
exports.Toast = toast_1.Toast;
|
||||
var touchid_1 = require('./plugins/touchid');
|
||||
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,
|
||||
Contacts: contacts_1.Contacts,
|
||||
Device: device_1.Device,
|
||||
Facebook: facebook_1.Facebook,
|
||||
Geolocation: geolocation_1.Geolocation,
|
||||
Push: push_1.Push,
|
||||
StatusBar: statusbar_1.StatusBar,
|
||||
Toast: toast_1.Toast,
|
||||
TouchID: touchid_1.TouchID
|
||||
};
|
||||
// To help developers using cordova, we listen for the device ready event and
|
||||
// log an error if it didn't fire in a reasonable amount of time. Generally,
|
||||
// when this happens, developers should remove and reinstall plugins, since
|
||||
// an inconsistent plugin is often the culprit.
|
||||
var before = +new Date;
|
||||
var didFireReady = false;
|
||||
document.addEventListener('deviceready', function () {
|
||||
console.log('DEVICE READY FIRED AFTER', (+new Date - before), 'ms');
|
||||
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
dist/index.js.map
vendored
1
dist/index.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAA2B,OAAO,CAAC,CAAA;AACnC,kBAAY,EAAE,CAAC;AAEf,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAKlC,4BAA0B,uBAAuB,CAAC,CAAA;AAehD,mBAAW;AAdb,+BAA6B,0BAA0B,CAAC,CAAA;AAetD,sBAAc;AAdhB,oBAAkB,eAAe,CAAC,CAAA;AAehC,WAAG;AAdL,uBAAqB,kBAAkB,CAAC,CAAA;AAetC,cAAM;AAdR,yBAAuB,oBAAoB,CAAC,CAAA;AAe1C,gBAAQ;AAdV,yBAAuB,oBAAoB,CAAC,CAAA;AAe1C,gBAAQ;AAdV,uBAAqB,kBAAkB,CAAC,CAAA;AAetC,cAAM;AAdR,yBAAuB,oBAAoB,CAAC,CAAA;AAe1C,gBAAQ;AAdV,4BAA0B,uBAAuB,CAAC,CAAA;AAehD,mBAAW;AAdb,qBAAmB,gBAAgB,CAAC,CAAA;AAelC,YAAI;AAdN,0BAAwB,qBAAqB,CAAC,CAAA;AAe5C,iBAAS;AAdX,sBAAoB,iBAAiB,CAAC,CAAA;AAepC,aAAK;AAdP,wBAAsB,mBAAmB,CAAC,CAAA;AAexC,eAAO;AAGT,0DAA0D;AAC1D,MAAM,CAAC,aAAa,CAAC,GAAG;IACtB,WAAW,EAAE,yBAAW;IACxB,gBAAA,+BAAc;IACd,GAAG,EAAE,SAAG;IACR,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,QAAQ,EAAE,mBAAQ;IAClB,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,WAAW,EAAE,yBAAW;IACxB,IAAI,EAAE,WAAI;IACV,SAAS,EAAE,qBAAS;IACpB,KAAK,EAAE,aAAK;IACZ,OAAO,EAAE,iBAAO;CACjB,CAAA;AAED,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,+CAA+C;AAC/C,IAAI,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC;AAEvB,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE;IACvC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,CAAC,CAAC,IAAI,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,CAAA;IACnE,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC,CAAA;AAEF,UAAU,CAAC;IACT,EAAE,CAAA,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,0CAA0C,GAAG,oBAAoB,GAAG,0HAA0H,CAAC,CAAC;IAC/M,CAAC;AACH,CAAC,EAAE,oBAAoB,CAAC,CAAC"}
|
0
dist/ionic.native.d.ts
vendored
0
dist/ionic.native.d.ts
vendored
1
dist/ionic.native.js
vendored
1
dist/ionic.native.js
vendored
@ -1 +0,0 @@
|
||||
//# sourceMappingURL=ionic.native.js.map
|
1
dist/ionic.native.js.map
vendored
1
dist/ionic.native.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"ionic.native.js","sourceRoot":"","sources":[],"names":[],"mappings":""}
|
8
dist/ng1.d.ts
vendored
8
dist/ng1.d.ts
vendored
@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Initialize the ngCordova Angular module if we're running in ng1
|
||||
*/
|
||||
export declare function initAngular1(): void;
|
||||
/**
|
||||
* Publish a new Angular 1 service for this plugin.
|
||||
*/
|
||||
export declare function publishAngular1Service(config: any, cls: any): void;
|
24
dist/ng1.js
vendored
24
dist/ng1.js
vendored
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* Initialize the ngCordova Angular module if we're running in ng1
|
||||
*/
|
||||
function initAngular1() {
|
||||
if (window.angular) {
|
||||
window.angular.module('ngCordova', []);
|
||||
}
|
||||
}
|
||||
exports.initAngular1 = initAngular1;
|
||||
/**
|
||||
* Publish a new Angular 1 service for this plugin.
|
||||
*/
|
||||
function publishAngular1Service(config, cls) {
|
||||
var serviceName = '$cordova' + cls.name;
|
||||
console.log('Registering Angular1 service', serviceName);
|
||||
window.angular.module('ngCordova').service(serviceName, [function () {
|
||||
var funcs = {};
|
||||
for (var k in cls) {
|
||||
}
|
||||
return funcs;
|
||||
}]);
|
||||
}
|
||||
exports.publishAngular1Service = publishAngular1Service;
|
||||
//# sourceMappingURL=ng1.js.map
|
1
dist/ng1.js.map
vendored
1
dist/ng1.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"ng1.js","sourceRoot":"","sources":["../src/ng1.ts"],"names":["initAngular1","publishAngular1Service"],"mappings":"AAEA;;GAEG;AACH;IACEA,EAAEA,CAAAA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,CAACA;QAClBA,MAAMA,CAACA,OAAOA,CAACA,MAAMA,CAACA,WAAWA,EAAEA,EAAEA,CAACA,CAACA;IACzCA,CAACA;AACHA,CAACA;AAJe,oBAAY,eAI3B,CAAA;AAED;;GAEG;AACH,gCAAuC,MAAU,EAAE,GAAO;IACxDC,IAAIA,WAAWA,GAAGA,UAAUA,GAAGA,GAAGA,CAACA,IAAIA,CAACA;IACxCA,OAAOA,CAACA,GAAGA,CAACA,8BAA8BA,EAAEA,WAAWA,CAACA,CAACA;IACzDA,MAAMA,CAACA,OAAOA,CAACA,MAAMA,CAACA,WAAWA,CAACA,CAACA,OAAOA,CAACA,WAAWA,EAAEA,CAACA;YACvD,IAAI,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAA,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;YACnB,CAAC;YACD,MAAM,CAAC,KAAK,CAAC;QACf,CAAC,CAACA,CAACA,CAACA;AACNA,CAACA;AATe,8BAAsB,yBASrC,CAAA"}
|
52
dist/plugins/actionsheet.d.ts
vendored
52
dist/plugins/actionsheet.d.ts
vendored
@ -1,52 +0,0 @@
|
||||
/**
|
||||
* The ActionSheet plugin shows a native list of options the user can choose from.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```
|
||||
* import {ActionSheet} from 'ionic-native';
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
* 'title': 'What do you want with this image?',
|
||||
* 'buttonLabels': buttonLabels,
|
||||
* 'addCancelButtonWithLabel': 'Cancel',
|
||||
* 'addDestructiveButtonWithLabel' : 'Delete'
|
||||
* }).then(buttonIndex => {
|
||||
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
export declare class ActionSheet {
|
||||
/**
|
||||
* Show the ActionSheet.
|
||||
* @param {options} options
|
||||
* `buttonLabels`: string[]
|
||||
* `title`: string
|
||||
* `androidTheme` (Android only): number 1-5
|
||||
* `androidEnableCancelButton` (Android only): boolean, default false
|
||||
* `winphoneEnableCancelButton` (WP only): boolean, default false
|
||||
* `addCancelButtonWithLabel`: string
|
||||
* `addDestructiveButtonWithLabel`: string
|
||||
* `position`: [x, y] (iPad pass in [x, y] coords of popover)
|
||||
* @returns {Promise} Returns a Promise that resolves with the index of the
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
static show(options?: {
|
||||
buttonLabels: string[];
|
||||
title?: string;
|
||||
androidTheme?: number;
|
||||
androidEnableCancelButton?: boolean;
|
||||
winphoneEnableCancelButton?: boolean;
|
||||
addCancelButtonWithLabel?: string;
|
||||
addDestructiveButtonWithLabel?: string;
|
||||
position?: number[];
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* Hide the ActionSheet.
|
||||
*/
|
||||
static hide(): Promise<any>;
|
||||
}
|
83
dist/plugins/actionsheet.js
vendored
83
dist/plugins/actionsheet.js
vendored
@ -1,83 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* The ActionSheet plugin shows a native list of options the user can choose from.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```
|
||||
* import {ActionSheet} from 'ionic-native';
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
* 'title': 'What do you want with this image?',
|
||||
* 'buttonLabels': buttonLabels,
|
||||
* 'addCancelButtonWithLabel': 'Cancel',
|
||||
* 'addDestructiveButtonWithLabel' : 'Delete'
|
||||
* }).then(buttonIndex => {
|
||||
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
var ActionSheet = (function () {
|
||||
function ActionSheet() {
|
||||
}
|
||||
/**
|
||||
* Show the ActionSheet.
|
||||
* @param {options} options
|
||||
* `buttonLabels`: string[]
|
||||
* `title`: string
|
||||
* `androidTheme` (Android only): number 1-5
|
||||
* `androidEnableCancelButton` (Android only): boolean, default false
|
||||
* `winphoneEnableCancelButton` (WP only): boolean, default false
|
||||
* `addCancelButtonWithLabel`: string
|
||||
* `addDestructiveButtonWithLabel`: string
|
||||
* `position`: [x, y] (iPad pass in [x, y] coords of popover)
|
||||
* @returns {Promise} Returns a Promise that resolves with the index of the
|
||||
* button pressed (1 based, so 1, 2, 3, etc.)
|
||||
*/
|
||||
ActionSheet.show = function (options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Hide the ActionSheet.
|
||||
*/
|
||||
ActionSheet.hide = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], ActionSheet, "show", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], 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'
|
||||
})
|
||||
], ActionSheet);
|
||||
return ActionSheet;
|
||||
})();
|
||||
exports.ActionSheet = ActionSheet;
|
||||
//# sourceMappingURL=actionsheet.js.map
|
1
dist/plugins/actionsheet.js.map
vendored
1
dist/plugins/actionsheet.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAAAA;IAsDAC,CAACA;IA9CCD;;;;;;;;;;;;;OAaGA;IAEIA,gBAAIA,GADXA,UACYA,OASXA;QACCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAGDF;;OAEGA;IAEIA,gBAAIA,GADXA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IA/BDH;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAgBVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,mBAAIA,QAOVA;IArDHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,qBAAqBA;YAChCA,IAAIA,EAAEA,8DAA8DA;SACrEA,CAACA;oBAiDDA;IAADA,kBAACA;AAADA,CAACA,AAtDD,IAsDC;AAhDY,mBAAW,cAgDvB,CAAA"}
|
21
dist/plugins/barcodescanner.d.ts
vendored
21
dist/plugins/barcodescanner.d.ts
vendored
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* 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 [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* BarcodeScanner.scan().then((barcodeData) => {
|
||||
* // Success! Barcode data is here
|
||||
* }, (err) => {
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export declare class BarcodeScanner {
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
* @return Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
*/
|
||||
static scan(): Promise<any>;
|
||||
}
|
51
dist/plugins/barcodescanner.js
vendored
51
dist/plugins/barcodescanner.js
vendored
@ -1,51 +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 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 [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* BarcodeScanner.scan().then((barcodeData) => {
|
||||
* // Success! Barcode data is here
|
||||
* }, (err) => {
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
var BarcodeScanner = (function () {
|
||||
function BarcodeScanner() {
|
||||
}
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
* @return Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
*/
|
||||
BarcodeScanner.scan = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
__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
1
dist/plugins/barcodescanner.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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;IAwBAC,CAACA;IAjBCD;;;OAGGA;IAEIA,mBAAIA,GADXA;QAEEE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;;IARDF;QAACA,gBAAOA,EAAEA;OACHA,sBAAIA,QAOVA;IAnBHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,gBAAgBA;YACtBA,MAAMA,EAAEA,gCAAgCA;YACxCA,SAASA,EAAEA,gCAAgCA;SAC5CA,CAACA;uBAoBDA;IAADA,qBAACA;AAADA,CAACA,AAxBD,IAwBC;AAnBY,sBAAc,iBAmB1B,CAAA"}
|
337
dist/plugins/ble.d.ts
vendored
337
dist/plugins/ble.d.ts
vendored
@ -1,337 +0,0 @@
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
/**
|
||||
* This plugin enables communication between a phone and Bluetooth Low Energy (BLE) peripherals.
|
||||
*
|
||||
* The plugin provides a simple JavaScript API for iOS and Android.
|
||||
*
|
||||
* - Scan for peripherals
|
||||
* - Connect to a peripheral
|
||||
* - Read the value of a characteristic
|
||||
* - Write new value to a characteristic
|
||||
* - Get notified when characteristic's value changes
|
||||
*
|
||||
* Advertising information is returned when scanning for peripherals. Service, characteristic, and property info is returned when connecting to a peripheral. All access is via service and characteristic UUIDs. The plugin manages handles internally.
|
||||
*
|
||||
* Simultaneous connections to multiple peripherals are supported.
|
||||
*
|
||||
* ## Peripheral Data
|
||||
*
|
||||
* Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning.
|
||||
* ```
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
* "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],
|
||||
* "rssi": -55
|
||||
* }
|
||||
* ```
|
||||
* After connecting, the peripheral object also includes service, characteristic and descriptor information.
|
||||
* ```
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
* "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],
|
||||
* "rssi": -55,
|
||||
* "services": [
|
||||
* "1800",
|
||||
* "1801",
|
||||
* "180f"
|
||||
* ],
|
||||
* "characteristics": [
|
||||
* {
|
||||
* "service": "1800",
|
||||
* "characteristic": "2a00",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "1800",
|
||||
* "characteristic": "2a01",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "1801",
|
||||
* "characteristic": "2a05",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "180f",
|
||||
* "characteristic": "2a19",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ],
|
||||
* "descriptors": [
|
||||
* {
|
||||
* "uuid": "2901"
|
||||
* },
|
||||
* {
|
||||
* "uuid": "2904"
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ## Advertising Data
|
||||
* Bluetooth advertising data is returned in when scanning for devices. The format format varies depending on your platform. On Android advertising data will be the raw advertising bytes. iOS does not allow access to raw advertising data, so a dictionary of data is returned.
|
||||
*
|
||||
* The advertising information for both Android and iOS appears to be a combination of advertising data and scan response data.
|
||||
*
|
||||
* ### Android
|
||||
* ```
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "00:1A:7D:DA:71:13",
|
||||
* "advertising": ArrayBuffer,
|
||||
* "rssi": -37
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Convert the advertising info to a Uint8Array for processing. `var adData = new Uint8Array(peripheral.advertising)`
|
||||
*
|
||||
* ### iOS
|
||||
*
|
||||
* Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future.
|
||||
* ```
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802",
|
||||
* "advertising": {
|
||||
* "kCBAdvDataChannel": 37,
|
||||
* "kCBAdvDataServiceData": {
|
||||
* "FED8": {
|
||||
* "byteLength": 7 // data not shown
|
||||
* }
|
||||
* },
|
||||
* "kCBAdvDataLocalName": "demo",
|
||||
* "kCBAdvDataServiceUUIDs": ["FED8"],
|
||||
* "kCBAdvDataManufacturerData": {
|
||||
* "byteLength": 7 // data not shown
|
||||
* },
|
||||
* "kCBAdvDataTxPowerLevel": 32,
|
||||
* "kCBAdvDataIsConnectable": true
|
||||
* },
|
||||
* "rssi": -53
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ## Typed Arrays
|
||||
*
|
||||
* This plugin uses typed Arrays or ArrayBuffers for sending and receiving data.
|
||||
*
|
||||
* This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving.
|
||||
* ```
|
||||
* // ASCII only
|
||||
* function stringToBytes(string) {
|
||||
* var array = new Uint8Array(string.length);
|
||||
* for (var i = 0, l = string.length; i < l; i++) {
|
||||
* array[i] = string.charCodeAt(i);
|
||||
* }
|
||||
* return array.buffer;
|
||||
* }
|
||||
*
|
||||
* // ASCII only
|
||||
* function bytesToString(buffer) {
|
||||
* return String.fromCharCode.apply(null, new Uint8Array(buffer));
|
||||
* }
|
||||
* ```
|
||||
* You can read more about typed arrays in these articles on [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) and [HTML5 Rocks](http://www.html5rocks.com/en/tutorials/webgl/typed_arrays/).
|
||||
*
|
||||
* ## UUIDs
|
||||
*
|
||||
* UUIDs are always strings and not numbers. Some 16-bit UUIDs, such as '2220' look like integers, but they're not. (The integer 2220 is 0x8AC in hex.) This isn't a problem with 128 bit UUIDs since they look like strings 82b9e6e1-593a-456f-be9b-9215160ebcac. All 16-bit UUIDs should also be passed to methods as strings.
|
||||
*
|
||||
*/
|
||||
export declare class BLE {
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.scan([], 5).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param {number} seconds Number of seconds to run discovery
|
||||
* @return Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
*/
|
||||
static scan(services: string[], seconds: number): Observable<any>;
|
||||
/**
|
||||
* Scan and discover BLE peripherals until `stopScan` is called.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startScan([]).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
*
|
||||
* setTimeout(() => {
|
||||
* BLE.stopScan();
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
static startScan(services: string[]): Observable<any>;
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startScan([]).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* BLE.stopScan().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @return returns a Promise.
|
||||
*/
|
||||
static stopScan(): Promise<any>;
|
||||
/**
|
||||
* Connect to a peripheral.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.connect('12:34:56:78:9A:BC').subscribe(peripheralData => {
|
||||
* console.log(peripheralData);
|
||||
* },
|
||||
* peripheralData => {
|
||||
* console.log('disconnected');
|
||||
* });
|
||||
* ```
|
||||
* @param deviceId {string} UUID or MAC address of the peripheral
|
||||
* @return Returns an Observable that notifies of connect/disconnect.
|
||||
*/
|
||||
static connect(deviceId: string): Observable<any>;
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.disconnect('12:34:56:78:9A:BC').then(() => {
|
||||
* console.log('Disconnected');
|
||||
* });
|
||||
* ```
|
||||
* @param deviceId {string} UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static disconnect(deviceId: string): Promise<any>;
|
||||
/**
|
||||
* Read the value of a characteristic.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static read(deviceId: string, serviceUUID: string, characteristicUUID: string): Promise<any>;
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
* @usage
|
||||
* ```
|
||||
* // send 1 byte to switch a light on
|
||||
* var data = new Uint8Array(1);
|
||||
* data[0] = 1;
|
||||
* BLE.write(device_id, "FF10", "FF11", data.buffer);
|
||||
*
|
||||
* // send a 3 byte value with RGB color
|
||||
* var data = new Uint8Array(3);
|
||||
* data[0] = 0xFF; // red
|
||||
* data[0] = 0x00; // green
|
||||
* data[0] = 0xFF; // blue
|
||||
* BLE.write(device_id, "ccc0", "ccc1", data.buffer);
|
||||
*
|
||||
* // send a 32 bit integer
|
||||
* var data = new Uint32Array(1);
|
||||
* data[0] = counterInput.value;
|
||||
* BLE.write(device_id, SERVICE, CHARACTERISTIC, data.buffer);
|
||||
*
|
||||
* ```
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static write(deviceId: string, serviceUUID: string, characteristicUUID: string, value: ArrayBuffer): Promise<any>;
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static writeWithoutResponse(deviceId: string, serviceUUID: string, characteristicUUID: string, value: ArrayBuffer): Promise<any>;
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startNotification(device_id, "FF10", "FF11").subscribe(buffer => {
|
||||
* console.log(String.fromCharCode.apply(null, new Uint8Array(buffer));
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns an Observable that notifies of characteristic changes.
|
||||
*/
|
||||
static startNotification(deviceId: string, serviceUUID: string, characteristicUUID: string): Observable<any>;
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
static stopNotification(deviceId: string, serviceUUID: string, characteristicUUID: string): Promise<any>;
|
||||
/**
|
||||
* Report the connection status.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.isConnected('FFCA0B09-CB1D-4DC0-A1EF-31AFD3EDFB53').then(
|
||||
* () => { console.log('connected'); },
|
||||
* () => { console.log('not connected'); }
|
||||
* );
|
||||
* ```
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
static isConnected(deviceId: string): Promise<any>;
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.isEnabled().then(
|
||||
* () => { console.log('enabled'); },
|
||||
* () => { console.log('not enabled'); }
|
||||
* );
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
static isEnabled(): Promise<any>;
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
static showBluetoothSettings(): Promise<any>;
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
static enable(): Promise<any>;
|
||||
}
|
520
dist/plugins/ble.js
vendored
520
dist/plugins/ble.js
vendored
@ -1,520 +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 plugin_1 = require('./plugin');
|
||||
var Observable_1 = require('rxjs/Observable');
|
||||
/**
|
||||
* This plugin enables communication between a phone and Bluetooth Low Energy (BLE) peripherals.
|
||||
*
|
||||
* The plugin provides a simple JavaScript API for iOS and Android.
|
||||
*
|
||||
* - Scan for peripherals
|
||||
* - Connect to a peripheral
|
||||
* - Read the value of a characteristic
|
||||
* - Write new value to a characteristic
|
||||
* - Get notified when characteristic's value changes
|
||||
*
|
||||
* Advertising information is returned when scanning for peripherals. Service, characteristic, and property info is returned when connecting to a peripheral. All access is via service and characteristic UUIDs. The plugin manages handles internally.
|
||||
*
|
||||
* Simultaneous connections to multiple peripherals are supported.
|
||||
*
|
||||
* ## Peripheral Data
|
||||
*
|
||||
* Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning.
|
||||
* ```
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
* "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],
|
||||
* "rssi": -55
|
||||
* }
|
||||
* ```
|
||||
* After connecting, the peripheral object also includes service, characteristic and descriptor information.
|
||||
* ```
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
* "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],
|
||||
* "rssi": -55,
|
||||
* "services": [
|
||||
* "1800",
|
||||
* "1801",
|
||||
* "180f"
|
||||
* ],
|
||||
* "characteristics": [
|
||||
* {
|
||||
* "service": "1800",
|
||||
* "characteristic": "2a00",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "1800",
|
||||
* "characteristic": "2a01",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "1801",
|
||||
* "characteristic": "2a05",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "service": "180f",
|
||||
* "characteristic": "2a19",
|
||||
* "properties": [
|
||||
* "Read"
|
||||
* ],
|
||||
* "descriptors": [
|
||||
* {
|
||||
* "uuid": "2901"
|
||||
* },
|
||||
* {
|
||||
* "uuid": "2904"
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ## Advertising Data
|
||||
* Bluetooth advertising data is returned in when scanning for devices. The format format varies depending on your platform. On Android advertising data will be the raw advertising bytes. iOS does not allow access to raw advertising data, so a dictionary of data is returned.
|
||||
*
|
||||
* The advertising information for both Android and iOS appears to be a combination of advertising data and scan response data.
|
||||
*
|
||||
* ### Android
|
||||
* ```
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "00:1A:7D:DA:71:13",
|
||||
* "advertising": ArrayBuffer,
|
||||
* "rssi": -37
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Convert the advertising info to a Uint8Array for processing. `var adData = new Uint8Array(peripheral.advertising)`
|
||||
*
|
||||
* ### iOS
|
||||
*
|
||||
* Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future.
|
||||
* ```
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802",
|
||||
* "advertising": {
|
||||
* "kCBAdvDataChannel": 37,
|
||||
* "kCBAdvDataServiceData": {
|
||||
* "FED8": {
|
||||
* "byteLength": 7 // data not shown
|
||||
* }
|
||||
* },
|
||||
* "kCBAdvDataLocalName": "demo",
|
||||
* "kCBAdvDataServiceUUIDs": ["FED8"],
|
||||
* "kCBAdvDataManufacturerData": {
|
||||
* "byteLength": 7 // data not shown
|
||||
* },
|
||||
* "kCBAdvDataTxPowerLevel": 32,
|
||||
* "kCBAdvDataIsConnectable": true
|
||||
* },
|
||||
* "rssi": -53
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ## Typed Arrays
|
||||
*
|
||||
* This plugin uses typed Arrays or ArrayBuffers for sending and receiving data.
|
||||
*
|
||||
* This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving.
|
||||
* ```
|
||||
* // ASCII only
|
||||
* function stringToBytes(string) {
|
||||
* var array = new Uint8Array(string.length);
|
||||
* for (var i = 0, l = string.length; i < l; i++) {
|
||||
* array[i] = string.charCodeAt(i);
|
||||
* }
|
||||
* return array.buffer;
|
||||
* }
|
||||
*
|
||||
* // ASCII only
|
||||
* function bytesToString(buffer) {
|
||||
* return String.fromCharCode.apply(null, new Uint8Array(buffer));
|
||||
* }
|
||||
* ```
|
||||
* You can read more about typed arrays in these articles on [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) and [HTML5 Rocks](http://www.html5rocks.com/en/tutorials/webgl/typed_arrays/).
|
||||
*
|
||||
* ## UUIDs
|
||||
*
|
||||
* UUIDs are always strings and not numbers. Some 16-bit UUIDs, such as '2220' look like integers, but they're not. (The integer 2220 is 0x8AC in hex.) This isn't a problem with 128 bit UUIDs since they look like strings 82b9e6e1-593a-456f-be9b-9215160ebcac. All 16-bit UUIDs should also be passed to methods as strings.
|
||||
*
|
||||
*/
|
||||
var BLE = (function () {
|
||||
function BLE() {
|
||||
}
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.scan([], 5).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param {number} seconds Number of seconds to run discovery
|
||||
* @return Returns an Observable that notifies of each peripheral that is discovered during the specified time.
|
||||
*/
|
||||
BLE.scan = function (services, seconds) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Scan and discover BLE peripherals until `stopScan` is called.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startScan([]).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
*
|
||||
* setTimeout(() => {
|
||||
* BLE.stopScan();
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
BLE.startScan = function (services) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startScan([]).subscribe(device => {
|
||||
* console.log(JSON.stringify(device));
|
||||
* });
|
||||
* setTimeout(() => {
|
||||
* BLE.stopScan().then(() => { console.log('scan stopped'); });
|
||||
* }, 5000);
|
||||
* ```
|
||||
* @return returns a Promise.
|
||||
*/
|
||||
BLE.stopScan = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Connect to a peripheral.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.connect('12:34:56:78:9A:BC').subscribe(peripheralData => {
|
||||
* console.log(peripheralData);
|
||||
* },
|
||||
* peripheralData => {
|
||||
* console.log('disconnected');
|
||||
* });
|
||||
* ```
|
||||
* @param deviceId {string} UUID or MAC address of the peripheral
|
||||
* @return Returns an Observable that notifies of connect/disconnect.
|
||||
*/
|
||||
BLE.connect = function (deviceId) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.disconnect('12:34:56:78:9A:BC').then(() => {
|
||||
* console.log('Disconnected');
|
||||
* });
|
||||
* ```
|
||||
* @param deviceId {string} UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
BLE.disconnect = function (deviceId) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Read the value of a characteristic.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
BLE.read = function (deviceId, serviceUUID, characteristicUUID) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
* @usage
|
||||
* ```
|
||||
* // send 1 byte to switch a light on
|
||||
* var data = new Uint8Array(1);
|
||||
* data[0] = 1;
|
||||
* BLE.write(device_id, "FF10", "FF11", data.buffer);
|
||||
*
|
||||
* // send a 3 byte value with RGB color
|
||||
* var data = new Uint8Array(3);
|
||||
* data[0] = 0xFF; // red
|
||||
* data[0] = 0x00; // green
|
||||
* data[0] = 0xFF; // blue
|
||||
* BLE.write(device_id, "ccc0", "ccc1", data.buffer);
|
||||
*
|
||||
* // send a 32 bit integer
|
||||
* var data = new Uint32Array(1);
|
||||
* data[0] = counterInput.value;
|
||||
* BLE.write(device_id, SERVICE, CHARACTERISTIC, data.buffer);
|
||||
*
|
||||
* ```
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
BLE.write = function (deviceId, serviceUUID, characteristicUUID, value) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @param {ArrayBuffer} value Data to write to the characteristic, as an ArrayBuffer.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
BLE.writeWithoutResponse = function (deviceId, serviceUUID, characteristicUUID, value) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.startNotification(device_id, "FF10", "FF11").subscribe(buffer => {
|
||||
* console.log(String.fromCharCode.apply(null, new Uint8Array(buffer));
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns an Observable that notifies of characteristic changes.
|
||||
*/
|
||||
BLE.startNotification = function (deviceId, serviceUUID, characteristicUUID) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
*
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @param {string} service_uuid UUID of the BLE service
|
||||
* @param {string} characteristic_uuid UUID of the BLE characteristic
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
BLE.stopNotification = function (deviceId, serviceUUID, characteristicUUID) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Report the connection status.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.isConnected('FFCA0B09-CB1D-4DC0-A1EF-31AFD3EDFB53').then(
|
||||
* () => { console.log('connected'); },
|
||||
* () => { console.log('not connected'); }
|
||||
* );
|
||||
* ```
|
||||
* @param {string} device_id UUID or MAC address of the peripheral
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
BLE.isConnected = function (deviceId) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.isEnabled().then(
|
||||
* () => { console.log('enabled'); },
|
||||
* () => { console.log('not enabled'); }
|
||||
* );
|
||||
* ```
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
BLE.isEnabled = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
BLE.showBluetoothSettings = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
*
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
BLE.enable = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true
|
||||
})
|
||||
], BLE, "scan", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
})
|
||||
], BLE, "startScan", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "stopScan", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'disconnect',
|
||||
clearWithArgs: true
|
||||
})
|
||||
], BLE, "connect", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "disconnect", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "read", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "write", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "writeWithoutResponse", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopNotification',
|
||||
clearWithArgs: true
|
||||
})
|
||||
], BLE, "startNotification", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "stopNotification", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "isConnected", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "isEnabled", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "showBluetoothSettings", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], BLE, "enable", null);
|
||||
BLE = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'BLE',
|
||||
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
dist/plugins/ble.js.map
vendored
1
dist/plugins/ble.js.map
vendored
File diff suppressed because one or more lines are too long
220
dist/plugins/calendar.d.ts
vendored
220
dist/plugins/calendar.d.ts
vendored
@ -1,220 +0,0 @@
|
||||
export interface CalendarOptions {
|
||||
firstReminderMinutes?: number;
|
||||
secondReminderMinutes?: number;
|
||||
recurrence?: string;
|
||||
recurrenceInterval?: number;
|
||||
recurrenceEndDate?: Date;
|
||||
calendarName?: string;
|
||||
calendarId?: number;
|
||||
url?: string;
|
||||
}
|
||||
export interface Calendar {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
/**
|
||||
* This plugin allows you to add events to the Calendar of the mobile device.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin).
|
||||
*
|
||||
*/
|
||||
export declare class Calendar {
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* Calendar.createCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object.
|
||||
* options:
|
||||
* calendarName: string the name of the calendar
|
||||
* calendarColor: string the hex color of the calendar
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static createCalendar(nameOrOptions: string | {
|
||||
calendarName: string;
|
||||
calendarColor: string;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* Calendar.deleteCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string} name Name of the calendar to delete.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static deleteCalendar(name: string): Promise<any>;
|
||||
/**
|
||||
* Returns the default calendar options.
|
||||
*
|
||||
* @return Returns an object with the default calendar options:
|
||||
* firstReminderMinutes: 60,
|
||||
* secondReminderMinutes: null,
|
||||
* recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
* recurrenceInterval: 1, // only used when recurrence is set
|
||||
* recurrenceEndDate: null,
|
||||
* calendarName: null,
|
||||
* calendarId: null,
|
||||
* url: null
|
||||
*/
|
||||
static getCalendarOptions(): CalendarOptions;
|
||||
/**
|
||||
* Silently create an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static createEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>;
|
||||
/**
|
||||
* Silently create an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static createEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>;
|
||||
/**
|
||||
* Interactively create an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static createEventInteractively(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>;
|
||||
/**
|
||||
* Interactively create an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static createEventInteractivelyWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>;
|
||||
/**
|
||||
* Find an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static findEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>;
|
||||
/**
|
||||
* Find an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise that resolves with the event, or rejects with an error.
|
||||
*/
|
||||
static findEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, options?: CalendarOptions): Promise<any>;
|
||||
/**
|
||||
* Find a list of events within the specified date range. (Android only)
|
||||
*
|
||||
* @param {Date} [startDate] The start date
|
||||
* @param {Date} [endDate] The end date
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
static listEventsInRange(startDate: Date, endDate: Date): Promise<any>;
|
||||
/**
|
||||
* Get a list of all calendars.
|
||||
* @return A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
*/
|
||||
static listCalendars(): Promise<any>;
|
||||
/**
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
static findAllEventsInNamedCalendar(calendarName: string): Promise<any>;
|
||||
/**
|
||||
* Modify an event. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} [newTitle] The new event title
|
||||
* @param {string} [newLocation] The new event location
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static modifyEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, newTitle?: string, newLocation?: string, newNotes?: string, newStartDate?: Date, newEndDate?: Date): Promise<any>;
|
||||
/**
|
||||
* Modify an event with additional options. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} [newTitle] The new event title
|
||||
* @param {string} [newLocation] The new event location
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static modifyEventWithOptions(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, newTitle?: string, newLocation?: string, newNotes?: string, newStartDate?: Date, newEndDate?: Date, options?: CalendarOptions): Promise<any>;
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static deleteEvent(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date): Promise<any>;
|
||||
/**
|
||||
* Delete an event from the specified Calendar. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static deleteEventFromNamedCalendar(title?: string, location?: string, notes?: string, startDate?: Date, endDate?: Date, calendarName?: string): Promise<any>;
|
||||
/**
|
||||
* Open the calendar at the specified date.
|
||||
* @return {Date} date
|
||||
*/
|
||||
static openCalendar(date: Date): Promise<any>;
|
||||
}
|
403
dist/plugins/calendar.js
vendored
403
dist/plugins/calendar.js
vendored
@ -1,403 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* This plugin allows you to add events to the Calendar of the mobile device.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin).
|
||||
*
|
||||
*/
|
||||
var Calendar = (function () {
|
||||
function Calendar() {
|
||||
}
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* Calendar.createCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string | Object} nameOrOptions either a string name or a options object.
|
||||
* options:
|
||||
* calendarName: string the name of the calendar
|
||||
* calendarColor: string the hex color of the calendar
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.createCalendar = function (nameOrOptions) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* Calendar.deleteCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @param {string} name Name of the calendar to delete.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.deleteCalendar = function (name) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Returns the default calendar options.
|
||||
*
|
||||
* @return Returns an object with the default calendar options:
|
||||
* firstReminderMinutes: 60,
|
||||
* secondReminderMinutes: null,
|
||||
* recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
* recurrenceInterval: 1, // only used when recurrence is set
|
||||
* recurrenceEndDate: null,
|
||||
* calendarName: null,
|
||||
* calendarId: null,
|
||||
* url: null
|
||||
*/
|
||||
Calendar.getCalendarOptions = function () {
|
||||
return {
|
||||
firstReminderMinutes: 60,
|
||||
secondReminderMinutes: null,
|
||||
recurrence: null,
|
||||
recurrenceInterval: 1,
|
||||
recurrenceEndDate: null,
|
||||
calendarName: null,
|
||||
calendarId: null,
|
||||
url: null
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Silently create an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.createEvent = function (title, location, notes, startDate, endDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Silently create an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.createEventWithOptions = function (title, location, notes, startDate, endDate, options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Interactively create an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.createEventInteractively = function (title, location, notes, startDate, endDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Interactively create an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.createEventInteractivelyWithOptions = function (title, location, notes, startDate, endDate, options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
// deprecated
|
||||
// @Cordova()
|
||||
// static createEventInNamedCalendar(
|
||||
// title?: string,
|
||||
// location?: string,
|
||||
// notes?: string,
|
||||
// startDate?: Date,
|
||||
// endDate?: Date,
|
||||
// calendarName?: string
|
||||
// ) {}
|
||||
/**
|
||||
* Find an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.findEvent = function (title, location, notes, startDate, endDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Find an event with additional options.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise that resolves with the event, or rejects with an error.
|
||||
*/
|
||||
Calendar.findEventWithOptions = function (title, location, notes, startDate, endDate, options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Find a list of events within the specified date range. (Android only)
|
||||
*
|
||||
* @param {Date} [startDate] The start date
|
||||
* @param {Date} [endDate] The end date
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
Calendar.listEventsInRange = function (startDate, endDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Get a list of all calendars.
|
||||
* @return A Promise that resolves with the list of calendars, or rejects with an error.
|
||||
*/
|
||||
Calendar.listCalendars = function () {
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @return Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
Calendar.findAllEventsInNamedCalendar = function (calendarName) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Modify an event. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} [newTitle] The new event title
|
||||
* @param {string} [newLocation] The new event location
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.modifyEvent = function (title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Modify an event with additional options. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} [newTitle] The new event title
|
||||
* @param {string} [newLocation] The new event location
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.modifyEventWithOptions = function (title, location, notes, startDate, endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Delete an event.
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.deleteEvent = function (title, location, notes, startDate, endDate) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Delete an event from the specified Calendar. (iOS only)
|
||||
*
|
||||
* @param {string} [title] The event title
|
||||
* @param {string} [location] The event location
|
||||
* @param {string} [notes] The event notes
|
||||
* @param {Date} [startDate] The event start date
|
||||
* @param {Date} [endDate] The event end date
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Calendar.deleteEventFromNamedCalendar = function (title, location, notes, startDate, endDate, calendarName) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Open the calendar at the specified date.
|
||||
* @return {Date} date
|
||||
*/
|
||||
Calendar.openCalendar = function (date) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "createCalendar", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "deleteCalendar", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], Calendar, "getCalendarOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "createEvent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "createEventWithOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "createEventInteractively", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "createEventInteractivelyWithOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "findEvent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "findEventWithOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "listEventsInRange", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "listCalendars", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "findAllEventsInNamedCalendar", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "modifyEvent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "modifyEventWithOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "deleteEvent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "deleteEventFromNamedCalendar", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Calendar, "openCalendar", null);
|
||||
Calendar = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Calendar',
|
||||
plugin: 'cordova-plugin-calendar',
|
||||
pluginRef: 'plugins.calendar'
|
||||
})
|
||||
], Calendar);
|
||||
return Calendar;
|
||||
})();
|
||||
exports.Calendar = Calendar;
|
||||
//# sourceMappingURL=calendar.js.map
|
1
dist/plugins/calendar.js.map
vendored
1
dist/plugins/calendar.js.map
vendored
File diff suppressed because one or more lines are too long
111
dist/plugins/camera.d.ts
vendored
111
dist/plugins/camera.d.ts
vendored
@ -1,111 +0,0 @@
|
||||
export interface CameraOptions {
|
||||
/** Picture quality in range 0-100. Default is 50 */
|
||||
quality?: number;
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string
|
||||
* FILE_URI : 1, Return image file URI
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
destinationType?: number;
|
||||
/**
|
||||
* Set the source of the picture.
|
||||
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
|
||||
* PHOTOLIBRARY : 0,
|
||||
* CAMERA : 1,
|
||||
* SAVEDPHOTOALBUM : 2
|
||||
*/
|
||||
sourceType?: number;
|
||||
/** Allow simple editing of image before selection. */
|
||||
allowEdit?: boolean;
|
||||
/**
|
||||
* Choose the returned image file's encoding.
|
||||
* Defined in navigator.camera.EncodingType. Default is JPEG
|
||||
* JPEG : 0 Return JPEG encoded image
|
||||
* PNG : 1 Return PNG encoded image
|
||||
*/
|
||||
encodingType?: number;
|
||||
/**
|
||||
* Width in pixels to scale image. Must be used with targetHeight.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetWidth?: number;
|
||||
/**
|
||||
* Height in pixels to scale image. Must be used with targetWidth.
|
||||
* Aspect ratio remains constant.
|
||||
*/
|
||||
targetHeight?: number;
|
||||
/**
|
||||
* Set the type of media to select from. Only works when PictureSourceType
|
||||
* is PHOTOLIBRARY or SAVEDPHOTOALBUM. Defined in nagivator.camera.MediaType
|
||||
* PICTURE: 0 allow selection of still pictures only. DEFAULT.
|
||||
* Will return format specified via DestinationType
|
||||
* VIDEO: 1 allow selection of video only, WILL ALWAYS RETURN FILE_URI
|
||||
* ALLMEDIA : 2 allow selection from all media types
|
||||
*/
|
||||
mediaType?: number;
|
||||
/** Rotate the image to correct for the orientation of the device during capture. */
|
||||
correctOrientation?: boolean;
|
||||
/** Save the image to the photo album on the device after capture. */
|
||||
saveToPhotoAlbum?: boolean;
|
||||
/**
|
||||
* Choose the camera to use (front- or back-facing).
|
||||
* Defined in navigator.camera.Direction. Default is BACK.
|
||||
* FRONT: 0
|
||||
* BACK: 1
|
||||
*/
|
||||
cameraDirection?: number;
|
||||
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
|
||||
popoverOptions?: CameraPopoverOptions;
|
||||
}
|
||||
/**
|
||||
* iOS-only parameters that specify the anchor element location and arrow direction
|
||||
* of the popover when selecting images from an iPad's library or album.
|
||||
*/
|
||||
export interface CameraPopoverOptions {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
/**
|
||||
* Direction the arrow on the popover should point. Defined in Camera.PopoverArrowDirection
|
||||
* Matches iOS UIPopoverArrowDirection constants.
|
||||
* ARROW_UP : 1,
|
||||
* ARROW_DOWN : 2,
|
||||
* ARROW_LEFT : 4,
|
||||
* ARROW_RIGHT : 8,
|
||||
* ARROW_ANY : 15
|
||||
*/
|
||||
arrowDir: number;
|
||||
}
|
||||
/**
|
||||
* 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 {
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions} options
|
||||
* @return Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
static getPicture(options: CameraOptions): Promise<any>;
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static cleanup(): void;
|
||||
}
|
65
dist/plugins/camera.js
vendored
65
dist/plugins/camera.js
vendored
@ -1,65 +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 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() {
|
||||
}
|
||||
/**
|
||||
* Take a picture or video, or load one from the library.
|
||||
* @param {CameraOptions} options
|
||||
* @return Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error.
|
||||
*/
|
||||
Camera.getPicture = function (options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
|
||||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI.
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Camera.cleanup = function () { };
|
||||
;
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
], Camera, "getPicture", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Camera, "cleanup", null);
|
||||
Camera = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Camera',
|
||||
plugin: 'cordova-plugin-camera',
|
||||
pluginRef: 'navigator.camera'
|
||||
})
|
||||
], Camera);
|
||||
return Camera;
|
||||
})();
|
||||
exports.Camera = Camera;
|
||||
//# sourceMappingURL=camera.js.map
|
1
dist/plugins/camera.js.map
vendored
1
dist/plugins/camera.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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;AAsFzC;;;;;;;;;;;;;;GAcG;AACH;IAAAA;IA8BAC,CAACA;IAxBCD;;;;OAIGA;IAIIA,iBAAUA,GAHjBA,UAGkBA,OAAsBA;QACtCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;;IAEDF;;;;OAIGA;IAEIA,cAAOA,GADdA,cACiBG,CAACA;;IAlBlBH;QAACA,gBAAOA,CAACA;YACPA,aAAaA,EAAEA,SAASA;SACzBA,CAACA;OACKA,oBAAUA,QAOhBA;IAODA;QAACA,gBAAOA,EAAEA;OACHA,iBAAOA,QAAIA;IA7BpBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;eA0BDA;IAADA,aAACA;AAADA,CAACA,AA9BD,IA8BC;AAzBY,cAAM,SAyBlB,CAAA"}
|
149
dist/plugins/contacts.d.ts
vendored
149
dist/plugins/contacts.d.ts
vendored
@ -1,149 +0,0 @@
|
||||
export interface ContactProperties {
|
||||
/** A globally unique identifier. */
|
||||
id?: string;
|
||||
/** The name of this Contact, suitable for display to end users. */
|
||||
displayName?: string;
|
||||
/** An object containing all components of a persons name. */
|
||||
name?: ContactName;
|
||||
/** A casual name by which to address the contact. */
|
||||
nickname?: string;
|
||||
/** An array of all the contact's phone numbers. */
|
||||
phoneNumbers?: ContactField[];
|
||||
/** An array of all the contact's email addresses. */
|
||||
emails?: ContactField[];
|
||||
/** An array of all the contact's addresses. */
|
||||
addresses?: ContactAddress[];
|
||||
/** An array of all the contact's IM addresses. */
|
||||
ims?: ContactField[];
|
||||
/** An array of all the contact's organizations. */
|
||||
organizations?: ContactOrganization[];
|
||||
/** The birthday of the contact. */
|
||||
birthday?: Date;
|
||||
/** A note about the contact. */
|
||||
note?: string;
|
||||
/** An array of the contact's photos. */
|
||||
photos?: ContactField[];
|
||||
/** An array of all the user-defined categories associated with the contact. */
|
||||
categories?: ContactField[];
|
||||
/** An array of web pages associated with the contact. */
|
||||
urls?: ContactField[];
|
||||
}
|
||||
export interface Contact extends ContactProperties {
|
||||
/**
|
||||
* Returns a new Contact object that is a deep copy of the calling object, with the id property set to null
|
||||
*/
|
||||
clone(): Contact;
|
||||
/**
|
||||
* Removes the contact from the device contacts database, otherwise executes an error callback with a ContactError object.
|
||||
* @param onSuccess Success callback function invoked on success operation.
|
||||
* @param onError Error callback function, invoked when an error occurs.
|
||||
*/
|
||||
remove(onSuccess?: () => void, onError?: (error: Error) => void): void;
|
||||
/**
|
||||
* Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same id already exists.
|
||||
* @param onSuccess Success callback function invoked on success operation with che Contact object.
|
||||
* @param onError Error callback function, invoked when an error occurs.
|
||||
*/
|
||||
save(onSuccess?: (contact: Contact) => void, onError?: (error: Error) => void): void;
|
||||
}
|
||||
export interface ContactName {
|
||||
/** The complete name of the contact. */
|
||||
formatted?: string;
|
||||
/** The contact's family name. */
|
||||
familyName?: string;
|
||||
/** The contact's given name. */
|
||||
givenName?: string;
|
||||
/** The contact's middle name. */
|
||||
middleName?: string;
|
||||
/** The contact's prefix (example Mr. or Dr.) */
|
||||
honorificPrefix?: string;
|
||||
/** The contact's suffix (example Esq.). */
|
||||
honorificSuffix?: string;
|
||||
}
|
||||
export interface ContactField {
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type: string;
|
||||
/** The value of the field, such as a phone number or email address. */
|
||||
value: string;
|
||||
/** Set to true if this ContactField contains the user's preferred value. */
|
||||
pref: boolean;
|
||||
}
|
||||
export interface ContactAddress {
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The full address formatted for display. */
|
||||
formatted?: string;
|
||||
/** The full street address. */
|
||||
streetAddress?: string;
|
||||
/** The city or locality. */
|
||||
locality?: string;
|
||||
/** The state or region. */
|
||||
region?: string;
|
||||
/** The zip code or postal code. */
|
||||
postalCode?: string;
|
||||
/** The country name. */
|
||||
country?: string;
|
||||
}
|
||||
export interface ContactOrganization {
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
pref?: boolean;
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
type?: string;
|
||||
/** The name of the organization. */
|
||||
name?: string;
|
||||
/** The department the contract works for. */
|
||||
department?: string;
|
||||
/** The contact's title at the organization. */
|
||||
title?: string;
|
||||
}
|
||||
/**
|
||||
* Access and manage Contacts on the device.
|
||||
*
|
||||
* Requires plugin: `cordova-plugin-contacts`
|
||||
* For full info, please see the [Cordova Contacts plugin 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 {
|
||||
/**
|
||||
* Create a new Contact object.
|
||||
*
|
||||
* @param options {Object} Object whose properties the created Contact should have.
|
||||
* @return {Contact} Returns the created contact
|
||||
*/
|
||||
static create(options: ContactProperties): Contact;
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
*
|
||||
* Example: Contacts.find(['*'], { filter: 'Max' }) // will search for a displayName of 'Max'
|
||||
*
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
* A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
|
||||
* A contactFields value of "*" searches all contact fields.
|
||||
*
|
||||
* @param options {Object} the options to query with:
|
||||
* filter: The search string used to find navigator.contacts. (string) (Default: "")
|
||||
* multiple: Determines if the find operation returns multiple navigator.contacts. (Boolean) (Default: false)
|
||||
* desiredFields: Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. (DOMString[]) [Optional]
|
||||
* hasPhoneNumber(Android only): Filters the search to only return contacts with a phone number informed. (Boolean) (Default: false)
|
||||
*
|
||||
* @return Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
static find(fields: string[], options?: any): Promise<Contact[]>;
|
||||
/**
|
||||
* Select a single Contact.
|
||||
* @return Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
static pickContact(): Promise<Contact>;
|
||||
}
|
102
dist/plugins/contacts.js
vendored
102
dist/plugins/contacts.js
vendored
@ -1,102 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Access and manage Contacts on the device.
|
||||
*
|
||||
* Requires plugin: `cordova-plugin-contacts`
|
||||
* For full info, please see the [Cordova Contacts plugin 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() {
|
||||
}
|
||||
/**
|
||||
* Create a new Contact object.
|
||||
*
|
||||
* @param options {Object} Object whose properties the created Contact should have.
|
||||
* @return {Contact} Returns the created contact
|
||||
*/
|
||||
Contacts.create = function (options) {
|
||||
return new Contact();
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
*
|
||||
* Example: Contacts.find(['*'], { filter: 'Max' }) // will search for a displayName of 'Max'
|
||||
*
|
||||
* @param fields {string[]} Contact fields to be used as a search qualifier.
|
||||
* A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
|
||||
* A contactFields value of "*" searches all contact fields.
|
||||
*
|
||||
* @param options {Object} the options to query with:
|
||||
* filter: The search string used to find navigator.contacts. (string) (Default: "")
|
||||
* multiple: Determines if the find operation returns multiple navigator.contacts. (Boolean) (Default: false)
|
||||
* desiredFields: Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. (DOMString[]) [Optional]
|
||||
* hasPhoneNumber(Android only): Filters the search to only return contacts with a phone number informed. (Boolean) (Default: false)
|
||||
*
|
||||
* @return Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
Contacts.find = function (fields, options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Select a single Contact.
|
||||
* @return Returns a Promise that resolves with the selected Contact
|
||||
*/
|
||||
Contacts.pickContact = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], Contacts, "create", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
], Contacts, "find", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Contacts, "pickContact", null);
|
||||
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
|
1
dist/plugins/contacts.js.map
vendored
1
dist/plugins/contacts.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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;AA6LzC;;;;;;;;;;;;;;;;GAgBG;AACH;IAAAA;IA+DAC,CAACA;IAxDCD;;;;;OAKGA;IAIIA,eAAMA,GAHbA,UAGcA,OAA0BA;QACtCE,MAAMA,CAACA,IAAIA,OAAOA,EAAEA,CAACA;IACvBA,CAACA;;IAEDF;;;;;;;;;;;;;;;;OAgBGA;IAKIA,aAAIA,GAJXA,UAIYA,MAAgBA,EAAEA,OAAaA;QACzCG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAYA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAClDA,CAACA;;IAEDH;;;OAGGA;IAEIA,oBAAWA,GADlBA;QAEEI,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAUA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAChDA,CAACA;;IAjDDJ;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kBAAMA,QAEZA;IAmBDA;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OACKA,gBAAIA,QAOVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAOjBA;IA9DHA;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"}
|
37
dist/plugins/device.d.ts
vendored
37
dist/plugins/device.d.ts
vendored
@ -1,37 +0,0 @@
|
||||
export interface Device {
|
||||
/** Get the version of Cordova running on the device. */
|
||||
cordova: string;
|
||||
/**
|
||||
* The device.model returns the name of the device's model or product. The value is set
|
||||
* by the device manufacturer and may be different across versions of the same product.
|
||||
*/
|
||||
model: string;
|
||||
/** Get the device's operating system name. */
|
||||
platform: string;
|
||||
/** Get the device's Universally Unique Identifier (UUID). */
|
||||
uuid: string;
|
||||
/** Get the operating system version. */
|
||||
version: string;
|
||||
/** Get the device's manufacturer. */
|
||||
manufacturer: string;
|
||||
/** Whether the device is running on a simulator. */
|
||||
isVirtual: boolean;
|
||||
/** Get the device hardware serial number. */
|
||||
serial: string;
|
||||
}
|
||||
/**
|
||||
* Access information about the underlying device and platform.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* let info = Device.getDevice();
|
||||
* ```
|
||||
*/
|
||||
export declare class Device {
|
||||
/**
|
||||
* Returns the whole device object.
|
||||
*
|
||||
* @returns {Object} The device object.
|
||||
*/
|
||||
static getDevice(): Device;
|
||||
}
|
40
dist/plugins/device.js
vendored
40
dist/plugins/device.js
vendored
@ -1,40 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Access information about the underlying device and platform.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* let info = Device.getDevice();
|
||||
* ```
|
||||
*/
|
||||
var Device = (function () {
|
||||
function Device() {
|
||||
}
|
||||
/**
|
||||
* Returns the whole device object.
|
||||
*
|
||||
* @returns {Object} The device object.
|
||||
*/
|
||||
Device.getDevice = function () {
|
||||
return window.device;
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.RequiresPlugin
|
||||
], Device, "getDevice", null);
|
||||
Device = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device'
|
||||
})
|
||||
], Device);
|
||||
return Device;
|
||||
})();
|
||||
exports.Device = Device;
|
||||
//# sourceMappingURL=device.js.map
|
1
dist/plugins/device.js.map
vendored
1
dist/plugins/device.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AA4BhD;;;;;;;GAOG;AACH;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"}
|
198
dist/plugins/facebook.d.ts
vendored
198
dist/plugins/facebook.d.ts
vendored
@ -1,198 +0,0 @@
|
||||
/**
|
||||
* Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4).
|
||||
*
|
||||
* #### Installation
|
||||
*
|
||||
* To use the FB plugin, you first have to create a new Facebook App inside of the Facebook developer portal at [https://developers.facebook.com/apps](https://developers.facebook.com/apps).
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Retrieve the `App ID` and `App Name`.
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal.
|
||||
*
|
||||
* ```bash
|
||||
* cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
|
||||
* ```
|
||||
*
|
||||
* After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Click `'Add Platform'`.
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* At this point you'll need to open your project's [`config.xml`](https://cordova.apache.org/docs/en/latest/config_ref/index.html) file, found in the root directory of your project.
|
||||
*
|
||||
* Take note of the `id` for the next step:
|
||||
* ```
|
||||
* <widget id="com.mycompany.testapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
* ```
|
||||
*
|
||||
* You can also edit the `id` to whatever you'd like it to be.
|
||||
*
|
||||
* #### iOS Install
|
||||
* Under 'Bundle ID', add the `id` from your `config.xml` file:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
*
|
||||
* #### Android Install
|
||||
* Under 'Google Play Package Name', add the `id` from your `config.xml` file:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
*
|
||||
* And that's it! You can now make calls to Facebook using the plugin.
|
||||
*
|
||||
* ## Events
|
||||
*
|
||||
* App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads.
|
||||
*
|
||||
* - [iOS] [https://developers.facebook.com/docs/ios/app-events](https://developers.facebook.com/docs/ios/app-events)
|
||||
* - [Android] [https://developers.facebook.com/docs/android/app-events](https://developers.facebook.com/docs/android/app-events)
|
||||
* - [JS] Does not have an Events API, so the plugin functions are empty and will return an automatic success
|
||||
*
|
||||
* Activation events are automatically tracked for you in the plugin.
|
||||
*
|
||||
* Events are listed on the [insights page](https://www.facebook.com/insights/).
|
||||
*
|
||||
* For tracking events, see `logEvent` and `logPurchase`.
|
||||
*
|
||||
*/
|
||||
export declare class Facebook {
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* status: "connected",
|
||||
* authResponse: {
|
||||
* session_key: true,
|
||||
* accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
|
||||
* expiresIn: 5183979,
|
||||
* sig: "...",
|
||||
* secret: "...",
|
||||
* userID: "634565435"
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in.
|
||||
* @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
*/
|
||||
static login(permissions: string[]): Promise<any>;
|
||||
/**
|
||||
* Logout of Facebook.
|
||||
*
|
||||
* For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout)
|
||||
* @return Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
*/
|
||||
static logout(): Promise<any>;
|
||||
/**
|
||||
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
|
||||
*
|
||||
* 1) the user is logged into Facebook and has authenticated your application (connected)
|
||||
* 2) the user is logged into Facebook but has not authenticated your application (not_authorized)
|
||||
* 3) the user is either not logged into Facebook or explicitly logged out of your application so it doesn't attempt to connect to Facebook and thus, we don't know if they've authenticated your application or not (unknown)
|
||||
*
|
||||
* Resolves with a response like:
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* authResponse: {
|
||||
* userID: "12345678912345",
|
||||
* accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
|
||||
* session_Key: true,
|
||||
* expiresIn: "5183738",
|
||||
* sig: "..."
|
||||
* },
|
||||
* status: "connected"
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus)
|
||||
*
|
||||
* @return Returns a Promise that resolves with a status, or rejects with an error
|
||||
*/
|
||||
static getLoginStatus(): Promise<any>;
|
||||
/**
|
||||
* Get a Facebook access token for using Facebook services.
|
||||
*
|
||||
* @return Returns a Promise that resolves with an access token, or rejects with an error
|
||||
*/
|
||||
static getAccessToken(): Promise<string>;
|
||||
/**
|
||||
* Show one of various Facebook dialogs. Example of options for a Share dialog:
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* method: "share",
|
||||
* href: "http://example.com",
|
||||
* caption: "Such caption, very feed.",
|
||||
* description: "Much description",
|
||||
* picture: 'http://example.com/image.png'
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui)
|
||||
* @options {Object} options The dialog options
|
||||
* @return Returns a Promise that resolves with success data, or rejects with an error
|
||||
*/
|
||||
static showDialog(options: any): Promise<any>;
|
||||
/**
|
||||
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
|
||||
*
|
||||
* For more information see:
|
||||
*
|
||||
* Calling the Graph API - https://developers.facebook.com/docs/javascript/reference/FB.api
|
||||
* Graph Explorer - https://developers.facebook.com/tools/explorer
|
||||
* Graph API - https://developers.facebook.com/docs/graph-api
|
||||
*
|
||||
* @param {string} requestPath Graph API endpoint you want to call
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request.
|
||||
* @return Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
*/
|
||||
static api(requestPath: string, permissions: string[]): Promise<any>;
|
||||
/**
|
||||
* Log an event. For more information see the Events section above.
|
||||
*
|
||||
* @param {string} name Name of the event
|
||||
* @param {Object} [params] An object containing extra data to log with the event
|
||||
* @param {number} [valueToSum] any value to be added to added to a sum on each event
|
||||
* @return
|
||||
*/
|
||||
static logEvent(name: string, params?: Object, valueToSum?: number): Promise<any>;
|
||||
/**
|
||||
* Log a purchase. For more information see the Events section above.
|
||||
*
|
||||
* @param {number} value Value of the purchase.
|
||||
* @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217)
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
static logPurchase(value: number, currency: string): Promise<any>;
|
||||
/**
|
||||
* Open App Invite dialog. Does not require login.
|
||||
*
|
||||
* For more information see:
|
||||
*
|
||||
* the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview
|
||||
* the App Links docs - https://developers.facebook.com/docs/applinks
|
||||
*
|
||||
*
|
||||
* @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL.
|
||||
* url: [App Link](https://developers.facebook.com/docs/applinks) to your app
|
||||
* picture: image to be displayed in the App Invite dialog
|
||||
*
|
||||
* @return Returns a Promise that resolves with the result data, or rejects with an error
|
||||
*/
|
||||
static appInvite(options: {
|
||||
url: string;
|
||||
picture: string;
|
||||
}): Promise<any>;
|
||||
}
|
308
dist/plugins/facebook.js
vendored
308
dist/plugins/facebook.js
vendored
@ -1,308 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4).
|
||||
*
|
||||
* #### Installation
|
||||
*
|
||||
* To use the FB plugin, you first have to create a new Facebook App inside of the Facebook developer portal at [https://developers.facebook.com/apps](https://developers.facebook.com/apps).
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Retrieve the `App ID` and `App Name`.
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal.
|
||||
*
|
||||
* ```bash
|
||||
* cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
|
||||
* ```
|
||||
*
|
||||
* After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* Click `'Add Platform'`.
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
* At this point you'll need to open your project's [`config.xml`](https://cordova.apache.org/docs/en/latest/config_ref/index.html) file, found in the root directory of your project.
|
||||
*
|
||||
* Take note of the `id` for the next step:
|
||||
* ```
|
||||
* <widget id="com.mycompany.testapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
* ```
|
||||
*
|
||||
* You can also edit the `id` to whatever you'd like it to be.
|
||||
*
|
||||
* #### iOS Install
|
||||
* Under 'Bundle ID', add the `id` from your `config.xml` file:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
*
|
||||
* #### Android Install
|
||||
* Under 'Google Play Package Name', add the `id` from your `config.xml` file:
|
||||
*
|
||||
* [](https://developers.facebook.com/apps/)
|
||||
*
|
||||
*
|
||||
* And that's it! You can now make calls to Facebook using the plugin.
|
||||
*
|
||||
* ## Events
|
||||
*
|
||||
* App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads.
|
||||
*
|
||||
* - [iOS] [https://developers.facebook.com/docs/ios/app-events](https://developers.facebook.com/docs/ios/app-events)
|
||||
* - [Android] [https://developers.facebook.com/docs/android/app-events](https://developers.facebook.com/docs/android/app-events)
|
||||
* - [JS] Does not have an Events API, so the plugin functions are empty and will return an automatic success
|
||||
*
|
||||
* Activation events are automatically tracked for you in the plugin.
|
||||
*
|
||||
* Events are listed on the [insights page](https://www.facebook.com/insights/).
|
||||
*
|
||||
* For tracking events, see `logEvent` and `logPurchase`.
|
||||
*
|
||||
*/
|
||||
var Facebook = (function () {
|
||||
function Facebook() {
|
||||
}
|
||||
// @Cordova()
|
||||
// static browserInit(appId: number){
|
||||
// return new Promise<any>((res, rej) => {});
|
||||
// }
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* status: "connected",
|
||||
* authResponse: {
|
||||
* session_key: true,
|
||||
* accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
|
||||
* expiresIn: 5183979,
|
||||
* sig: "...",
|
||||
* secret: "...",
|
||||
* userID: "634565435"
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in.
|
||||
* @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
|
||||
*/
|
||||
Facebook.login = function (permissions) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Logout of Facebook.
|
||||
*
|
||||
* For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout)
|
||||
* @return Returns a Promise that resolves on a successful logout, and rejects if logout fails.
|
||||
*/
|
||||
Facebook.logout = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
|
||||
*
|
||||
* 1) the user is logged into Facebook and has authenticated your application (connected)
|
||||
* 2) the user is logged into Facebook but has not authenticated your application (not_authorized)
|
||||
* 3) the user is either not logged into Facebook or explicitly logged out of your application so it doesn't attempt to connect to Facebook and thus, we don't know if they've authenticated your application or not (unknown)
|
||||
*
|
||||
* Resolves with a response like:
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* authResponse: {
|
||||
* userID: "12345678912345",
|
||||
* accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
|
||||
* session_Key: true,
|
||||
* expiresIn: "5183738",
|
||||
* sig: "..."
|
||||
* },
|
||||
* status: "connected"
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus)
|
||||
*
|
||||
* @return Returns a Promise that resolves with a status, or rejects with an error
|
||||
*/
|
||||
Facebook.getLoginStatus = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Get a Facebook access token for using Facebook services.
|
||||
*
|
||||
* @return Returns a Promise that resolves with an access token, or rejects with an error
|
||||
*/
|
||||
Facebook.getAccessToken = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Show one of various Facebook dialogs. Example of options for a Share dialog:
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* method: "share",
|
||||
* href: "http://example.com",
|
||||
* caption: "Such caption, very feed.",
|
||||
* description: "Much description",
|
||||
* picture: 'http://example.com/image.png'
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui)
|
||||
* @options {Object} options The dialog options
|
||||
* @return Returns a Promise that resolves with success data, or rejects with an error
|
||||
*/
|
||||
Facebook.showDialog = function (options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
|
||||
*
|
||||
* For more information see:
|
||||
*
|
||||
* Calling the Graph API - https://developers.facebook.com/docs/javascript/reference/FB.api
|
||||
* Graph Explorer - https://developers.facebook.com/tools/explorer
|
||||
* Graph API - https://developers.facebook.com/docs/graph-api
|
||||
*
|
||||
* @param {string} requestPath Graph API endpoint you want to call
|
||||
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request.
|
||||
* @return Returns a Promise that resolves with the result of the request, or rejects with an error
|
||||
*/
|
||||
Facebook.api = function (requestPath, permissions) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Log an event. For more information see the Events section above.
|
||||
*
|
||||
* @param {string} name Name of the event
|
||||
* @param {Object} [params] An object containing extra data to log with the event
|
||||
* @param {number} [valueToSum] any value to be added to added to a sum on each event
|
||||
* @return
|
||||
*/
|
||||
Facebook.logEvent = function (name, params, valueToSum) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Log a purchase. For more information see the Events section above.
|
||||
*
|
||||
* @param {number} value Value of the purchase.
|
||||
* @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217)
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
Facebook.logPurchase = function (value, currency) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Open App Invite dialog. Does not require login.
|
||||
*
|
||||
* For more information see:
|
||||
*
|
||||
* the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview
|
||||
* the App Links docs - https://developers.facebook.com/docs/applinks
|
||||
*
|
||||
*
|
||||
* @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL.
|
||||
* url: [App Link](https://developers.facebook.com/docs/applinks) to your app
|
||||
* picture: image to be displayed in the App Invite dialog
|
||||
*
|
||||
* @return Returns a Promise that resolves with the result data, or rejects with an error
|
||||
*/
|
||||
Facebook.appInvite = function (options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "login", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "logout", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "getLoginStatus", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "getAccessToken", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "showDialog", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "api", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "logEvent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "logPurchase", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Facebook, "appInvite", null);
|
||||
Facebook = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Facebook',
|
||||
plugin: 'cordova-plugin-facebook4',
|
||||
pluginRef: 'facebookConnectPlugin'
|
||||
})
|
||||
], Facebook);
|
||||
return Facebook;
|
||||
})();
|
||||
exports.Facebook = Facebook;
|
||||
//# sourceMappingURL=facebook.js.map
|
1
dist/plugins/facebook.js.map
vendored
1
dist/plugins/facebook.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../src/plugins/facebook.ts"],"names":["Facebook","Facebook.constructor","Facebook.login","Facebook.logout","Facebook.getLoginStatus","Facebook.getAccessToken","Facebook.showDialog","Facebook.api","Facebook.logEvent","Facebook.logPurchase","Facebook.appInvite"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH;IAAAA;IA6NAC,CAACA;IAtNCD,aAAaA;IACbA,qCAAqCA;IACrCA,+CAA+CA;IAC/CA,IAAIA;IAEJA;;;;;;;;;;;;;;;;;;;OAmBGA;IAEIA,cAAKA,GADZA,UACaA,WAAqBA;QAChCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDF;;;;;OAKGA;IAEIA,eAAMA,GADbA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDH;;;;;;;;;;;;;;;;;;;;;;;;;OAyBGA;IAEIA,uBAAcA,GADrBA;QAEEI,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDJ;;;;OAIGA;IAEIA,uBAAcA,GADrBA;QAEEK,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAASA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC/CA,CAACA;IAEDL;;;;;;;;;;;;;;;;OAgBGA;IAEIA,mBAAUA,GADjBA,UACkBA,OAAYA;QAC5BM,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDN;;;;;;;;;;;;OAYGA;IAEIA,YAAGA,GADVA,UACWA,WAAmBA,EAAEA,WAAqBA;QACnDO,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDP;;;;;;;OAOGA;IAEIA,iBAAQA,GADfA,UACgBA,IAAYA,EAAEA,MAAeA,EAAEA,UAAmBA;QAChEQ,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDR;;;;;;OAMGA;IAEIA,oBAAWA,GADlBA,UACmBA,KAAaA,EAAEA,QAAgBA;QAChDS,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDT;;;;;;;;;;;;;;OAcGA;IAEIA,kBAASA,GADhBA,UACiBA,OAGhBA;QACCU,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IA5LDV;QAACA,gBAAOA,EAAEA;OACHA,iBAAKA,QAOXA;IAQDA;QAACA,gBAAOA,EAAEA;OACHA,kBAAMA,QAOZA;IA4BDA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAOpBA;IAODA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAOpBA;IAmBDA;QAACA,gBAAOA,EAAEA;OACHA,sBAAUA,QAOhBA;IAeDA;QAACA,gBAAOA,EAAEA;OACHA,eAAGA,QAOTA;IAUDA;QAACA,gBAAOA,EAAEA;OACHA,oBAAQA,QAOdA;IASDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAOjBA;IAiBDA;QAACA,gBAAOA,EAAEA;OACHA,qBAASA,QAUfA;IA5NHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;iBAyNDA;IAADA,eAACA;AAADA,CAACA,AA7ND,IA6NC;AAxNY,gBAAQ,WAwNpB,CAAA"}
|
120
dist/plugins/geolocation.d.ts
vendored
120
dist/plugins/geolocation.d.ts
vendored
@ -1,120 +0,0 @@
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
export interface Coordinates {
|
||||
/**
|
||||
* a double representing the position's latitude in decimal degrees.
|
||||
*/
|
||||
latitude: number;
|
||||
/**
|
||||
* A double representing the position's longitude in decimal degrees.
|
||||
*/
|
||||
longitude: number;
|
||||
/**
|
||||
* A double representing the accuracy of the latitude and longitude properties,
|
||||
* expressed in meters.
|
||||
*/
|
||||
accuracy: number;
|
||||
/**
|
||||
* A double representing the position's altitude in metres, relative to sea
|
||||
* level. This value can be null if the implementation cannot provide the data.
|
||||
*/
|
||||
altitude: number;
|
||||
/**
|
||||
* A double representing the accuracy of the altitude expressed in meters.
|
||||
* This value can be null.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
/**
|
||||
* A double representing the direction in which the device is traveling. This
|
||||
* value, specified in degrees, indicates how far off from heading true north
|
||||
* the device is. 0 degrees represents true north, and the direction is
|
||||
* determined clockwise (which means that east is 90 degrees and west is 270
|
||||
* degrees). If speed is 0, heading is NaN. If the device is unable to provide
|
||||
* heading information, this value is null.
|
||||
*/
|
||||
heading: number;
|
||||
/**
|
||||
* A double representing the velocity of the device in meters per second.
|
||||
* This value can be null.
|
||||
*/
|
||||
speed: number;
|
||||
}
|
||||
export interface Geoposition {
|
||||
/**
|
||||
* A Coordinates object defining the current location
|
||||
*/
|
||||
coords: Coordinates;
|
||||
/**
|
||||
* A timestamp representing the time at which the location was retrieved.
|
||||
*/
|
||||
timestamp: number;
|
||||
}
|
||||
export interface GeolocationOptions {
|
||||
/**
|
||||
* Is a positive long value indicating the maximum age in milliseconds of a
|
||||
* possible cached position that is acceptable to return. If set to 0, it
|
||||
* means that the device cannot use a cached position and must attempt to
|
||||
* retrieve the real current position. If set to Infinity the device must
|
||||
* return a cached position regardless of its age. Default: 0.
|
||||
*/
|
||||
maximumAge: number;
|
||||
/**
|
||||
* Is a positive long value representing the maximum length of time
|
||||
* (in milliseconds) the device is allowed to take in order to return a
|
||||
* position. The default value is Infinity, meaning that getCurrentPosition()
|
||||
* won't return until the position is available.
|
||||
*/
|
||||
timeout: number;
|
||||
/**
|
||||
* Indicates the application would like to receive the best possible results.
|
||||
* If true and if the device is able to provide a more accurate position, it
|
||||
* will do so. Note that this can result in slower response times or increased
|
||||
* power consumption (with a GPS chip on a mobile device for example). On the
|
||||
* other hand, if false, the device can take the liberty to save resources by
|
||||
* responding more quickly and/or using less power. Default: false.
|
||||
* @type {boolean}
|
||||
*/
|
||||
enableHighAccuracy: boolean;
|
||||
}
|
||||
/**
|
||||
* Get geolocation data.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* //resp.coords.latitude
|
||||
* //resp.coords.longitude
|
||||
* })
|
||||
*
|
||||
* let watch = Geolocation.watchPosition();
|
||||
* watch.subscribe((data) => {
|
||||
* //data.coords.latitude
|
||||
* //data.coords.longitude
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export declare class Geolocation {
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
*/
|
||||
static getCurrentPosition(options: GeolocationOptions): Promise<Geoposition>;
|
||||
/**
|
||||
* Watch the current device's position. Clear the watch by unsubscribing from
|
||||
* Observable changes.
|
||||
*
|
||||
* ```
|
||||
* var subscription = Geolocation.watchPosition().subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
*
|
||||
* // To stop notifications
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
static watchPosition(options: GeolocationOptions): Observable<Geoposition>;
|
||||
}
|
88
dist/plugins/geolocation.js
vendored
88
dist/plugins/geolocation.js
vendored
@ -1,88 +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 plugin_1 = require('./plugin');
|
||||
var Observable_1 = require('rxjs/Observable');
|
||||
/**
|
||||
* Get geolocation data.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* //resp.coords.latitude
|
||||
* //resp.coords.longitude
|
||||
* })
|
||||
*
|
||||
* let watch = Geolocation.watchPosition();
|
||||
* watch.subscribe((data) => {
|
||||
* //data.coords.latitude
|
||||
* //data.coords.longitude
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
var Geolocation = (function () {
|
||||
function Geolocation() {
|
||||
}
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
|
||||
*/
|
||||
Geolocation.getCurrentPosition = function (options) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Watch the current device's position. Clear the watch by unsubscribing from
|
||||
* Observable changes.
|
||||
*
|
||||
* ```
|
||||
* var subscription = Geolocation.watchPosition().subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
*
|
||||
* // To stop notifications
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @return Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
Geolocation.watchPosition = function (options) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
;
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Geolocation, "getCurrentPosition", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
], Geolocation, "watchPosition", null);
|
||||
Geolocation = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Geolocation',
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
pluginRef: 'navigator.geolocation'
|
||||
})
|
||||
], Geolocation);
|
||||
return Geolocation;
|
||||
})();
|
||||
exports.Geolocation = Geolocation;
|
||||
//# sourceMappingURL=geolocation.js.map
|
1
dist/plugins/geolocation.js.map
vendored
1
dist/plugins/geolocation.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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;AACzC,2BAAyB,iBAAiB,CAAC,CAAA;AA6F3C;;;;;;;;;;;;;;;;GAgBG;AACH;IAAAA;IAmDAC,CAACA;IA7CCD;;;;;OAKGA;IAEIA,8BAAkBA,GADzBA,UAC0BA,OAA2BA;QACnDE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAcA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IACpDA,CAACA;IAEDF;;;;;;;;;;;;;;;OAeGA;IAMIA,yBAAaA,GALpBA,UAKqBA,OAA2BA;QAC9CG,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAcA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IACrDA,CAACA;;IAtCDH;QAACA,gBAAOA,EAAEA;OACHA,iCAAkBA,QAOxBA;IAkBDA;QAACA,gBAAOA,CAACA;YACPA,aAAaA,EAAEA,SAASA;YACxBA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,YAAYA;SAC5BA,CAACA;OACKA,4BAAaA,QAOnBA;IAlDHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,aAAaA;YACnBA,MAAMA,EAAEA,4BAA4BA;YACpCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;oBA+CDA;IAADA,kBAACA;AAADA,CAACA,AAnDD,IAmDC;AA9CY,mBAAW,cA8CvB,CAAA"}
|
20
dist/plugins/plugin.d.ts
vendored
20
dist/plugins/plugin.d.ts
vendored
@ -1,20 +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: string, opts?: any) => (...args: any[]) => any;
|
||||
/**
|
||||
* Class decorator specifying Plugin metadata. Required for all plugins.
|
||||
*/
|
||||
export declare function Plugin(config: any): (cls: any) => any;
|
||||
/**
|
||||
* Wrap a stub function in a call to a Cordova plugin, checking if both Cordova
|
||||
* and the required plugin are installed.
|
||||
*/
|
||||
export declare function Cordova(opts?: any): (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
value: (...args: any[]) => any;
|
||||
};
|
||||
/**
|
||||
* Before calling the original method, ensure Cordova and the plugin are installed.
|
||||
*/
|
||||
export declare function RequiresPlugin(target: Function, key: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any>;
|
189
dist/plugins/plugin.js
vendored
189
dist/plugins/plugin.js
vendored
@ -1,189 +0,0 @@
|
||||
var util_1 = require('../util');
|
||||
var Observable_1 = require('rxjs/Observable');
|
||||
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) {
|
||||
// Try to figure out where the success/error callbacks need to be bound
|
||||
// to our promise resolve/reject handlers.
|
||||
if (opts === void 0) { opts = {}; }
|
||||
// If the plugin method expects myMethod(success, err, options)
|
||||
if (opts.callbackOrder == 'reverse') {
|
||||
// Get those arguments in the order [resolve, reject, ...restOfArgs]
|
||||
args.unshift(reject);
|
||||
args.unshift(resolve);
|
||||
}
|
||||
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) {
|
||||
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
|
||||
if (!window.cordova) {
|
||||
exports.cordovaWarn(pluginObj.name, methodName);
|
||||
reject({
|
||||
error: 'cordova_not_available'
|
||||
});
|
||||
return;
|
||||
}
|
||||
exports.pluginWarn(pluginObj.name, methodName, pluginObj.name);
|
||||
reject({
|
||||
error: 'plugin_not_installed'
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log('Cordova calling', pluginObj.name, methodName, args);
|
||||
// TODO: Illegal invocation needs window context
|
||||
return util_1.get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||
}
|
||||
function getPromise(cb) {
|
||||
if (window.Promise) {
|
||||
console.log('Native promises available...');
|
||||
return new Promise(function (resolve, reject) {
|
||||
cb(resolve, reject);
|
||||
});
|
||||
}
|
||||
else if (window.angular) {
|
||||
var $q_1 = window.angular.injector(['ng']).get('$q');
|
||||
console.log('Loaded $q', $q_1);
|
||||
return $q_1(function (resolve, reject) {
|
||||
cb(resolve, reject);
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular 1/2 or on a recent browser.');
|
||||
}
|
||||
}
|
||||
function wrapPromise(pluginObj, methodName, args, opts) {
|
||||
if (opts === void 0) { opts = {}; }
|
||||
return getPromise(function (resolve, reject) {
|
||||
callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
||||
});
|
||||
}
|
||||
function wrapObservable(pluginObj, methodName, args, opts) {
|
||||
if (opts === void 0) { opts = {}; }
|
||||
return new Observable_1.Observable(function (observer) {
|
||||
var pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
return function () {
|
||||
try {
|
||||
if (opts.clearWithArgs) {
|
||||
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, args);
|
||||
}
|
||||
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].call(pluginObj, pluginResult);
|
||||
}
|
||||
catch (e) {
|
||||
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
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.sync) {
|
||||
return callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||
}
|
||||
else if (opts.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];
|
||||
}
|
||||
cls['installed'] = function () {
|
||||
return !!exports.getPlugin(config.pluginRef);
|
||||
};
|
||||
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;
|
||||
}
|
||||
return originalMethod.apply(this, args);
|
||||
};
|
||||
return descriptor;
|
||||
}
|
||||
exports.RequiresPlugin = RequiresPlugin;
|
||||
//# sourceMappingURL=plugin.js.map
|
1
dist/plugins/plugin.js.map
vendored
1
dist/plugins/plugin.js.map
vendored
File diff suppressed because one or more lines are too long
252
dist/plugins/push.d.ts
vendored
252
dist/plugins/push.d.ts
vendored
@ -1,252 +0,0 @@
|
||||
export declare type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error;
|
||||
export interface RegistrationEventResponse {
|
||||
/**
|
||||
* The registration ID provided by the 3rd party remote push service.
|
||||
*/
|
||||
registrationId: string;
|
||||
}
|
||||
export interface NotificationEventResponse {
|
||||
/**
|
||||
* The text of the push message sent from the 3rd party service.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The optional title of the push message sent from the 3rd party service.
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* The number of messages to be displayed in the badge iOS or message count in the notification shade in Android.
|
||||
* For windows, it represents the value in the badge notification which could be a number or a status glyph.
|
||||
*/
|
||||
count: string;
|
||||
/**
|
||||
* The name of the sound file to be played upon receipt of the notification.
|
||||
*/
|
||||
sound: string;
|
||||
/**
|
||||
* The path of the image file to be displayed in the notification.
|
||||
*/
|
||||
image: string;
|
||||
/**
|
||||
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
|
||||
*/
|
||||
additionalData: NotificationEventAdditionalData;
|
||||
}
|
||||
/**
|
||||
* TODO: document all possible properties (not just Android)
|
||||
*
|
||||
* Loosened up with a dictionary notation, but all non-defined properties need to use (map['prop']) notation
|
||||
*
|
||||
* Ideally the developer would overload (merged declaration) this or create a new interface that would extend this one
|
||||
* so that he could specify any custom code without having to use array notation (map['prop']) for all of them.
|
||||
*/
|
||||
export interface NotificationEventAdditionalData {
|
||||
[name: string]: any;
|
||||
/**
|
||||
* Whether the notification was received while the app was in the foreground
|
||||
*/
|
||||
foreground?: boolean;
|
||||
collapse_key?: string;
|
||||
from?: string;
|
||||
notId?: string;
|
||||
}
|
||||
export interface PushNotification {
|
||||
/**
|
||||
* The event registration will be triggered on each successful registration with the 3rd party push service.
|
||||
* @param event
|
||||
* @param callback
|
||||
*/
|
||||
on(event: "registration", callback: (response: RegistrationEventResponse) => any): void;
|
||||
/**
|
||||
* The event notification will be triggered each time a push notification is received by a 3rd party push service on the device.
|
||||
* @param event
|
||||
* @param callback
|
||||
*/
|
||||
on(event: "notification", callback: (response: NotificationEventResponse) => any): void;
|
||||
/**
|
||||
* The event error will trigger when an internal error occurs and the cache is aborted.
|
||||
* @param event
|
||||
* @param callback
|
||||
*/
|
||||
on(event: "error", callback: (response: Error) => any): void;
|
||||
/**
|
||||
*
|
||||
* @param event Name of the event to listen to. See below(above) for all the event names.
|
||||
* @param callback is called when the event is triggered.
|
||||
* @param event
|
||||
* @param callback
|
||||
*/
|
||||
on(event: string, callback: (response: EventResponse) => any): void;
|
||||
off(event: "registration", callback: (response: RegistrationEventResponse) => any): void;
|
||||
off(event: "notification", callback: (response: NotificationEventResponse) => any): void;
|
||||
off(event: "error", callback: (response: Error) => any): void;
|
||||
/**
|
||||
* As stated in the example, you will have to store your event handler if you are planning to remove it.
|
||||
* @param event Name of the event type. The possible event names are the same as for the push.on function.
|
||||
* @param callback handle to the function to get removed.
|
||||
* @param event
|
||||
* @param callback
|
||||
*/
|
||||
off(event: string, callback: (response: EventResponse) => any): void;
|
||||
/**
|
||||
* The unregister method is used when the application no longer wants to receive push notifications.
|
||||
* Beware that this cleans up all event handlers previously registered,
|
||||
* so you will need to re-register them if you want them to function again without an application reload.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
unregister(successHandler: () => any, errorHandler?: () => any): void;
|
||||
/**
|
||||
* Set the badge count visible when the app is not running
|
||||
*
|
||||
* The count is an integer indicating what number should show up in the badge.
|
||||
* Passing 0 will clear the badge.
|
||||
* Each notification event contains a data.count value which can be used to set the badge to correct number.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
* @param count
|
||||
*/
|
||||
setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count?: number): void;
|
||||
/**
|
||||
* Get the current badge count visible when the app is not running
|
||||
* successHandler gets called with an integer which is the current badge count
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
getApplicationIconBadgeNumber(successHandler: (count: number) => any, errorHandler: () => any): void;
|
||||
/**
|
||||
* iOS only
|
||||
* Tells the OS that you are done processing a background push notification.
|
||||
* successHandler gets called when background push processing is successfully completed.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
*/
|
||||
finish(successHandler: () => any, errorHandler: () => any): void;
|
||||
}
|
||||
export interface iOSPushOptions {
|
||||
/**
|
||||
* Maps to the project number in the Google Developer Console. Setting this
|
||||
* uses GCM for notifications instead of native.
|
||||
*/
|
||||
senderID: string;
|
||||
/**
|
||||
* Whether to use prod or sandbox GCM setting.
|
||||
*/
|
||||
gcmSandbox?: boolean | string;
|
||||
/**
|
||||
* If true the device shows an alert on receipt of notification.
|
||||
* **Note**: the value you set this option to the first time you call the init
|
||||
* method will be how the application always acts. Once this is set
|
||||
* programmatically in the init method it can only be changed manually by the
|
||||
* user in Settings>Notifications>App Name. This is normal iOS behaviour.
|
||||
*/
|
||||
alert?: boolean | string;
|
||||
/**
|
||||
* If true the device sets the badge number on receipt of notification.
|
||||
* **Note**: the value you set this option to the first time you call the init
|
||||
* method will be how the application always acts. Once this is set
|
||||
* programmatically in the init method it can only be changed manually by the
|
||||
* user in Settings>Notifications>App Name. This is normal iOS behaviour.
|
||||
*/
|
||||
badge?: boolean | string;
|
||||
/**
|
||||
* If true the device plays a sound on receipt of notification.
|
||||
* **Note**: the value you set this option to the first time you call the init
|
||||
* method will be how the application always acts. Once this is set
|
||||
* programmatically in the init method it can only be changed manually by the
|
||||
* user in Settings>Notifications>App Name. This is normal iOS behaviour.
|
||||
*/
|
||||
sound?: boolean | string;
|
||||
/**
|
||||
* If true the badge will be cleared on app startup.
|
||||
*/
|
||||
clearBadge?: boolean | string;
|
||||
/**
|
||||
* If the array contains one or more strings each string will be used to
|
||||
* subscribe to a GcmPubSub topic.
|
||||
* **Note**: only usable in conjunction with `senderID`.
|
||||
*/
|
||||
topics?: string[];
|
||||
}
|
||||
export interface AndroidPushOptions {
|
||||
/**
|
||||
* Maps to the project number in the Google Developer Console.
|
||||
*/
|
||||
senderID: string;
|
||||
/**
|
||||
* The name of a drawable resource to use as the small-icon. The name should
|
||||
* not include the extension.
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* Sets the background color of the small icon on Android 5.0 and greater.
|
||||
* [Supported Formats](http://developer.android.com/intl/ru/reference/android/graphics/Color.html#parseColor(java.lang.String))
|
||||
*/
|
||||
iconColor?: string;
|
||||
/**
|
||||
* If true it plays the sound specified in the push data or the default system
|
||||
* sound.
|
||||
*/
|
||||
sound?: boolean | string;
|
||||
/**
|
||||
* If true the device vibrates on receipt of notification.
|
||||
*/
|
||||
vibrate?: boolean | string;
|
||||
/**
|
||||
* If true the app clears all pending notifications when it is closed.
|
||||
*/
|
||||
clearNotifications?: boolean | string;
|
||||
/**
|
||||
* If true will always show a notification, even when the app is on the
|
||||
* foreground.
|
||||
*/
|
||||
forceShow?: boolean | string;
|
||||
/**
|
||||
* If the array contains one or more strings each string will be used to
|
||||
* subscribe to a GcmPubSub topic.
|
||||
*/
|
||||
topics: string[];
|
||||
}
|
||||
export interface PushOptions {
|
||||
ios?: iOSPushOptions;
|
||||
android?: AndroidPushOptions;
|
||||
windows?: {};
|
||||
}
|
||||
/**
|
||||
* Register and receive push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `phonegap-plugin-push`. For more info, please see the [Push plugin docs](https://github.com/phonegap/phonegap-plugin-push).
|
||||
*
|
||||
*
|
||||
* For TypeScript users, see the [Push plugin docs about using TypeScript for custom notifications](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md).
|
||||
*/
|
||||
export declare class Push {
|
||||
/**
|
||||
* Initialize the plugin on the native side.
|
||||
*
|
||||
* ```
|
||||
* var push = Push.init({
|
||||
* android: {
|
||||
* senderID: "12345679"
|
||||
* },
|
||||
* ios: {
|
||||
* alert: "true",
|
||||
* badge: true,
|
||||
* sound: 'false'
|
||||
* },
|
||||
* windows: {}
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param {PushOptions} options The Push [options](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#parameters).
|
||||
* @return {PushNotification} Returns a new [PushNotification](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#pushonevent-callback) object.
|
||||
*/
|
||||
static init(options: PushOptions): PushNotification;
|
||||
/**
|
||||
* Check whether the push notification permission has been granted.
|
||||
* @return {Promise} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
|
||||
*/
|
||||
static hasPermission(): Promise<{
|
||||
isEnabled: boolean;
|
||||
}>;
|
||||
}
|
72
dist/plugins/push.js
vendored
72
dist/plugins/push.js
vendored
@ -1,72 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Register and receive push notifications.
|
||||
*
|
||||
* Requires Cordova plugin: `phonegap-plugin-push`. For more info, please see the [Push plugin docs](https://github.com/phonegap/phonegap-plugin-push).
|
||||
*
|
||||
*
|
||||
* For TypeScript users, see the [Push plugin docs about using TypeScript for custom notifications](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md).
|
||||
*/
|
||||
var Push = (function () {
|
||||
function Push() {
|
||||
}
|
||||
/**
|
||||
* Initialize the plugin on the native side.
|
||||
*
|
||||
* ```
|
||||
* var push = Push.init({
|
||||
* android: {
|
||||
* senderID: "12345679"
|
||||
* },
|
||||
* ios: {
|
||||
* alert: "true",
|
||||
* badge: true,
|
||||
* sound: 'false'
|
||||
* },
|
||||
* windows: {}
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param {PushOptions} options The Push [options](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#parameters).
|
||||
* @return {PushNotification} Returns a new [PushNotification](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#pushonevent-callback) object.
|
||||
*/
|
||||
Push.init = function (options) {
|
||||
return new PushNotification();
|
||||
};
|
||||
/**
|
||||
* Check whether the push notification permission has been granted.
|
||||
* @return {Promise} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
|
||||
*/
|
||||
Push.hasPermission = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], Push, "init", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Push, "hasPermission", null);
|
||||
Push = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'Push',
|
||||
plugin: 'phonegap-plugin-push',
|
||||
pluginRef: 'PushNotification'
|
||||
})
|
||||
], Push);
|
||||
return Push;
|
||||
})();
|
||||
exports.Push = Push;
|
||||
//# sourceMappingURL=push.js.map
|
1
dist/plugins/push.js.map
vendored
1
dist/plugins/push.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/plugins/push.ts"],"names":["Push","Push.constructor","Push.init","Push.hasPermission"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAuPzC;;;;;;;GAOG;AACH;IAAAA;IA+CAC,CAACA;IAxCCD;;;;;;;;;;;;;;;;;;;OAmBGA;IAIIA,SAAIA,GAHXA,UAGYA,OAAoBA;QAC9BE,MAAMA,CAACA,IAAIA,gBAAgBA,EAAEA,CAACA;IAChCA,CAACA;IAEDF;;;OAGGA;IAEIA,kBAAaA,GADpBA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAyBA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC/DA,CAACA;IAnBDH;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,YAAIA,QAEVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,qBAAaA,QAOnBA;IA9CHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,MAAMA;YACZA,MAAMA,EAAEA,sBAAsBA;YAC9BA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;aA2CDA;IAADA,WAACA;AAADA,CAACA,AA/CD,IA+CC;AA1CY,YAAI,OA0ChB,CAAA"}
|
59
dist/plugins/statusbar.d.ts
vendored
59
dist/plugins/statusbar.d.ts
vendored
@ -1,59 +0,0 @@
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
||||
*/
|
||||
export declare class StatusBar {
|
||||
/**
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
||||
*/
|
||||
static overlaysWebView(doesOverlay: boolean): void;
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
static styleDefault(): void;
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
static styleLightContent(): void;
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
static styleBlackTranslucent(): void;
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
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 {string} colorName 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 {string} hexString The hex value of the color.
|
||||
*/
|
||||
static backgroundColorByHexString(hexString: string): void;
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*/
|
||||
static hide(): void;
|
||||
/**
|
||||
* Show the StatusBar
|
||||
*/
|
||||
static show(): void;
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
static isVisible(): any;
|
||||
}
|
137
dist/plugins/statusbar.js
vendored
137
dist/plugins/statusbar.js
vendored
@ -1,137 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
||||
*/
|
||||
var StatusBar = (function () {
|
||||
function StatusBar() {
|
||||
}
|
||||
/**
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
||||
*/
|
||||
StatusBar.overlaysWebView = function (doesOverlay) { };
|
||||
;
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
StatusBar.styleDefault = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
StatusBar.styleLightContent = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
StatusBar.styleBlackTranslucent = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
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 {string} colorName 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 {string} hexString The hex value of the color.
|
||||
*/
|
||||
StatusBar.backgroundColorByHexString = function (hexString) { };
|
||||
;
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*/
|
||||
StatusBar.hide = function () { };
|
||||
;
|
||||
/**
|
||||
* Show the StatusBar
|
||||
*/
|
||||
StatusBar.show = function () { };
|
||||
;
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
StatusBar.isVisible = function () {
|
||||
return window.StatusBar.isVisible;
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "overlaysWebView", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleDefault", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleLightContent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleBlackTranslucent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleBlackOpaque", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "backgroundColorByName", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "backgroundColorByHexString", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "hide", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "show", null);
|
||||
__decorate([
|
||||
plugin_1.RequiresPlugin
|
||||
], StatusBar, "isVisible", null);
|
||||
StatusBar = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'StatusBar',
|
||||
plugin: 'cordova-plugin-statusbar',
|
||||
pluginRef: 'StatusBar'
|
||||
})
|
||||
], StatusBar);
|
||||
return StatusBar;
|
||||
})();
|
||||
exports.StatusBar = StatusBar;
|
||||
//# sourceMappingURL=statusbar.js.map
|
1
dist/plugins/statusbar.js.map
vendored
1
dist/plugins/statusbar.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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","StatusBar.isVisible"],"mappings":";;;;;;AAAA,uBAA8C,UAAU,CAAC,CAAA;AAIzD;;;;GAIG;AACH;IAAAA;IAiGAC,CAACA;IA3FCD;;;;;OAKGA;IAIIA,yBAAeA,GAHtBA,UAGuBA,WAAoBA,IAAEE,CAACA;;IAE9CF;;OAEGA;IAIIA,sBAAYA,GAHnBA,cAGsBG,CAACA;;IAEvBH;;OAEGA;IAIIA,2BAAiBA,GAHxBA,cAG2BI,CAACA;;IAE5BJ;;OAEGA;IAIIA,+BAAqBA,GAH5BA,cAG+BK,CAACA;;IAEhCL;;OAEGA;IAIIA,0BAAgBA,GAHvBA,cAG0BM,CAACA;;IAE3BN;;;;;;;OAOGA;IAIIA,+BAAqBA,GAH5BA,UAG6BA,SAAiBA,IAAEO,CAACA;;IAEjDP;;;;;;OAMGA;IAIIA,oCAA0BA,GAHjCA,UAGkCA,SAAiBA,IAAEQ,CAACA;;IAEtDR;;OAEGA;IAIIA,cAAIA,GAHXA,cAGcS,CAACA;;IAEfT;;MAEEA;IAIKA,cAAIA,GAHXA,cAGcU,CAACA;;IAEfV;;OAEGA;IAEIA,mBAASA,GADhBA;QAEEW,MAAMA,CAACA,MAAMA,CAACA,SAASA,CAACA,SAASA,CAACA;IACpCA,CAACA;IApFDX;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,4BAAeA,QAAwBA;IAK9CA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,yBAAYA,QAAIA;IAKvBA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,8BAAiBA,QAAIA;IAK5BA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kCAAqBA,QAAIA;IAKhCA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,6BAAgBA,QAAIA;IAU3BA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kCAAqBA,QAAqBA;IASjDA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,uCAA0BA,QAAqBA;IAKtDA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,iBAAIA,QAAIA;IAKfA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,iBAAIA,QAAIA;IAKfA;QAACA,uBAAcA;OACRA,sBAASA,QAEfA;IAhGHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,WAAWA;YACjBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,WAAWA;SACvBA,CAACA;kBA6FDA;IAADA,gBAACA;AAADA,CAACA,AAjGD,IAiGC;AA5FY,iBAAS,YA4FrB,CAAA"}
|
70
dist/plugins/toast.d.ts
vendored
70
dist/plugins/toast.d.ts
vendored
@ -1,70 +0,0 @@
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
export interface ToastOptions {
|
||||
message?: string;
|
||||
duration?: string;
|
||||
position?: string;
|
||||
addPixelsY?: number;
|
||||
}
|
||||
/**
|
||||
* This plugin allows you to show a native Toast (a little text popup) on iOS, Android and WP8. It's great for showing a non intrusive native notification which is guaranteed always in the viewport of the browser.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin).
|
||||
*/
|
||||
export declare class Toast {
|
||||
/**
|
||||
* Show a native toast for the given duration at the specified position.
|
||||
*
|
||||
* @param {string} message The message to display.
|
||||
* @param {string} duration Duration to show the toast, either 'short' or 'long'.
|
||||
* @param {string} position Where to position the toast, either 'top', 'center', or 'bottom'.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static show(message: string, duration: string, position: string): Observable<any>;
|
||||
/**
|
||||
* Manually hide any currently visible toast.
|
||||
* @return {Promise} Returns a Promise that resolves on success.
|
||||
*/
|
||||
static hide(): Promise<any>;
|
||||
/**
|
||||
* Show a native toast with the given options.
|
||||
*
|
||||
* @param {Object} options Options for showing a toast. Available options:
|
||||
* message The message to display.
|
||||
* duration Duration to show the toast, either 'short' or 'long'.
|
||||
* position Where to position the toast, either 'top', 'center', or 'bottom'.
|
||||
* addPixelsY Offset in pixels to move the toast up or down from its specified position.
|
||||
*
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showWithOptions(options: ToastOptions): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'top')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showShortTop(message: string): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'center')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showShortCenter(message: string): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'bottom')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showShortBottom(message: string): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'top')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showLongTop(message: string): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'center')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showLongCenter(message: string): Observable<any>;
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'bottom')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
static showLongBottom(message: string): Observable<any>;
|
||||
}
|
198
dist/plugins/toast.js
vendored
198
dist/plugins/toast.js
vendored
@ -1,198 +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 plugin_1 = require('./plugin');
|
||||
var Observable_1 = require('rxjs/Observable');
|
||||
/**
|
||||
* This plugin allows you to show a native Toast (a little text popup) on iOS, Android and WP8. It's great for showing a non intrusive native notification which is guaranteed always in the viewport of the browser.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin).
|
||||
*/
|
||||
var Toast = (function () {
|
||||
function Toast() {
|
||||
}
|
||||
/**
|
||||
* Show a native toast for the given duration at the specified position.
|
||||
*
|
||||
* @param {string} message The message to display.
|
||||
* @param {string} duration Duration to show the toast, either 'short' or 'long'.
|
||||
* @param {string} position Where to position the toast, either 'top', 'center', or 'bottom'.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.show = function (message, duration, position) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Manually hide any currently visible toast.
|
||||
* @return {Promise} Returns a Promise that resolves on success.
|
||||
*/
|
||||
Toast.hide = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Show a native toast with the given options.
|
||||
*
|
||||
* @param {Object} options Options for showing a toast. Available options:
|
||||
* message The message to display.
|
||||
* duration Duration to show the toast, either 'short' or 'long'.
|
||||
* position Where to position the toast, either 'top', 'center', or 'bottom'.
|
||||
* addPixelsY Offset in pixels to move the toast up or down from its specified position.
|
||||
*
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showWithOptions = function (options) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'top')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showShortTop = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'center')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showShortCenter = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'short', 'bottom')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showShortBottom = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'top')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showLongTop = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'center')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showLongCenter = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
/**
|
||||
* Shorthand for `show(message, 'long', 'bottom')`.
|
||||
* @return {Observable} Returns an Observable that notifies first on success and then when tapped, rejects on error.
|
||||
*/
|
||||
Toast.showLongBottom = function (message) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable_1.Observable(function (observer) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "show", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], Toast, "hide", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showWithOptions", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showShortTop", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showShortCenter", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showShortBottom", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showLongTop", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showLongCenter", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'hide'
|
||||
})
|
||||
], Toast, "showLongBottom", null);
|
||||
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
dist/plugins/toast.js.map
vendored
1
dist/plugins/toast.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/plugins/toast.ts"],"names":["Toast","Toast.constructor","Toast.show","Toast.hide","Toast.showWithOptions","Toast.showShortTop","Toast.showShortCenter","Toast.showShortBottom","Toast.showLongTop","Toast.showLongCenter","Toast.showLongBottom"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AACzC,2BAAyB,iBAAiB,CAAC,CAAA;AAQ3C;;;;GAIG;AACH;IAAAA;IAwKAC,CAACA;IAhKCD;;;;;;;OAOGA;IAKIA,UAAIA,GAJXA,UAIYA,OAAeA,EAAEA,QAAgBA,EAAEA,QAAgBA;QAC7DE,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDF;;;OAGGA;IAEIA,UAAIA,GADXA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDH;;;;;;;;;;OAUGA;IAKIA,qBAAeA,GAJtBA,UAIuBA,OAAqBA;QAC1CI,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDJ;;;OAGGA;IAKIA,kBAAYA,GAJnBA,UAIoBA,OAAeA;QACjCK,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDL;;;OAGGA;IAKIA,qBAAeA,GAJtBA,UAIuBA,OAAeA;QACpCM,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDN;;;OAGGA;IAKIA,qBAAeA,GAJtBA,UAIuBA,OAAeA;QACpCO,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDP;;;OAGGA;IAKIA,iBAAWA,GAJlBA,UAImBA,OAAeA;QAChCQ,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDR;;;OAGGA;IAKIA,oBAAcA,GAJrBA,UAIsBA,OAAeA;QACnCS,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAEDT;;;OAGGA;IAKIA,oBAAcA,GAJrBA,UAIsBA,OAAeA;QACnCU,4EAA4EA;QAC5EA,oEAAoEA;QACpEA,2EAA2EA;QAC3EA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,uBAAUA,CAAMA,UAAAA,QAAQA,IAAKA,CAACA,CAACA,CAACA;IAC7CA,CAACA;IAvJDV;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,aAAIA,QAOVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,aAAIA,QAOVA;IAaDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,wBAAeA,QAOrBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,qBAAYA,QAOlBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,wBAAeA,QAOrBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,wBAAeA,QAOrBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,oBAAWA,QAOjBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,uBAAcA,QAOpBA;IAMDA;QAACA,gBAAOA,CAACA;YACPA,UAAUA,EAAEA,IAAIA;YAChBA,aAAaA,EAAEA,MAAMA;SACtBA,CAACA;OACKA,uBAAcA,QAOpBA;IAvKHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,OAAOA;YACbA,MAAMA,EAAEA,wBAAwBA;YAChCA,SAASA,EAAEA,eAAeA;YAC1BA,IAAIA,EAAEA,yDAAyDA;SAChEA,CAACA;cAmKDA;IAADA,YAACA;AAADA,CAACA,AAxKD,IAwKC;AAlKY,aAAK,QAkKjB,CAAA"}
|
49
dist/plugins/touchid.d.ts
vendored
49
dist/plugins/touchid.d.ts
vendored
@ -1,49 +0,0 @@
|
||||
/**
|
||||
* Scan the fingerprint of a user with the TouchID sensor.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-touch-id`. For more info, please see the [TouchID plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-touch-id).
|
||||
*
|
||||
* ### Error Codes
|
||||
*
|
||||
* The plugin will reject for various reasons. Your app will most likely need to respond to the cases differently.
|
||||
*
|
||||
* Here is a list of some of the error codes:
|
||||
*
|
||||
* `-1` - Fingerprint scan failed more than 3 times
|
||||
* `-2` or `-128` - User tapped the 'Cancel' button
|
||||
* `-3` - User tapped the 'Enter Passcode' or 'Enter Password' button
|
||||
* `-4` - The scan was cancelled by the system (Home button for example)
|
||||
* `-6` - TouchID is not Available
|
||||
* `-8` - TouchID is locked out from too many tries
|
||||
*
|
||||
*/
|
||||
export declare class TouchID {
|
||||
/**
|
||||
* Whether TouchID is available or not.
|
||||
*
|
||||
* @return {Promise} Returns a Promise that resolves if yes, rejects if no.
|
||||
*/
|
||||
isAvailable(): Promise<any>;
|
||||
/**
|
||||
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, brings up standard system passcode screen.
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
static verifyFingerprint(message: string): Promise<any>;
|
||||
/**
|
||||
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
static verifyFingerprintWithCustomPasswordFallback(message: string): Promise<any>;
|
||||
/**
|
||||
* Show TouchID dialog with custom 'Enter Password' message and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @param {string} enterPasswordLabel Custom text for the 'Enter Password' button
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
static verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(message: string, enterPasswordLabel: string): Promise<any>;
|
||||
}
|
110
dist/plugins/touchid.js
vendored
110
dist/plugins/touchid.js
vendored
@ -1,110 +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 plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Scan the fingerprint of a user with the TouchID sensor.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-touch-id`. For more info, please see the [TouchID plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-touch-id).
|
||||
*
|
||||
* ### Error Codes
|
||||
*
|
||||
* The plugin will reject for various reasons. Your app will most likely need to respond to the cases differently.
|
||||
*
|
||||
* Here is a list of some of the error codes:
|
||||
*
|
||||
* `-1` - Fingerprint scan failed more than 3 times
|
||||
* `-2` or `-128` - User tapped the 'Cancel' button
|
||||
* `-3` - User tapped the 'Enter Passcode' or 'Enter Password' button
|
||||
* `-4` - The scan was cancelled by the system (Home button for example)
|
||||
* `-6` - TouchID is not Available
|
||||
* `-8` - TouchID is locked out from too many tries
|
||||
*
|
||||
*/
|
||||
var TouchID = (function () {
|
||||
function TouchID() {
|
||||
}
|
||||
/**
|
||||
* Whether TouchID is available or not.
|
||||
*
|
||||
* @return {Promise} Returns a Promise that resolves if yes, rejects if no.
|
||||
*/
|
||||
TouchID.prototype.isAvailable = function () {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, brings up standard system passcode screen.
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
TouchID.verifyFingerprint = function (message) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Show TouchID dialog and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
TouchID.verifyFingerprintWithCustomPasswordFallback = function (message) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
/**
|
||||
* Show TouchID dialog with custom 'Enter Password' message and wait for a fingerprint scan. If user taps 'Enter Password' button, rejects with code '-3' (see above).
|
||||
*
|
||||
* @param {string} message The message to display
|
||||
* @param {string} enterPasswordLabel Custom text for the 'Enter Password' button
|
||||
* @return {Promise} Returns a Promise the resolves if the fingerprint scan was successful, rejects with an error code (see above).
|
||||
*/
|
||||
TouchID.verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel = function (message, enterPasswordLabel) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise(function (res, rej) { });
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], TouchID.prototype, "isAvailable", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], TouchID, "verifyFingerprint", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], TouchID, "verifyFingerprintWithCustomPasswordFallback", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
], TouchID, "verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel", null);
|
||||
TouchID = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'TouchID',
|
||||
plugin: 'cordova-plugin-touch-id',
|
||||
pluginRef: 'plugins.touchid',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-touch-id'
|
||||
})
|
||||
], TouchID);
|
||||
return TouchID;
|
||||
})();
|
||||
exports.TouchID = TouchID;
|
||||
//# sourceMappingURL=touchid.js.map
|
1
dist/plugins/touchid.js.map
vendored
1
dist/plugins/touchid.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"touchid.js","sourceRoot":"","sources":["../../src/plugins/touchid.ts"],"names":["TouchID","TouchID.constructor","TouchID.isAvailable","TouchID.verifyFingerprint","TouchID.verifyFingerprintWithCustomPasswordFallback","TouchID.verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAAAA;IAuEAC,CAACA;IA/DCD;;;;OAIGA;IAEHA,6BAAWA,GADXA;QAEEE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;;IAEDF;;;;;OAKGA;IAEIA,yBAAiBA,GADxBA,UACyBA,OAAeA;QACtCG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDH;;;;;OAKGA;IAEIA,mDAA2CA,GADlDA,UACmDA,OAAeA;QAChEI,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDJ;;;;;;OAMGA;IAEIA,wEAAgEA,GADvEA,UACwEA,OAAeA,EAAEA,kBAA0BA;QACjHK,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAzDDL;QAACA,gBAAOA,EAAEA;OACVA,gCAAWA,QAOVA;IAQDA;QAACA,gBAAOA,EAAEA;OACHA,4BAAiBA,QAOvBA;IAQDA;QAACA,gBAAOA,EAAEA;OACHA,sDAA2CA,QAOjDA;IASDA;QAACA,gBAAOA,EAAEA;OACHA,2EAAgEA,QAOtEA;IAtEHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,SAASA;YACfA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,iBAAiBA;YAC5BA,IAAIA,EAAEA,2DAA2DA;SAClEA,CAACA;gBAkEDA;IAADA,cAACA;AAADA,CAACA,AAvED,IAuEC;AAjEY,eAAO,UAiEnB,CAAA"}
|
1
dist/util.d.ts
vendored
1
dist/util.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare function get(obj: any, path: any): any;
|
12
dist/util.js
vendored
12
dist/util.js
vendored
@ -1,12 +0,0 @@
|
||||
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
dist/util.js.map
vendored
1
dist/util.js.map
vendored
@ -1 +0,0 @@
|
||||
{"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"}
|
Loading…
Reference in New Issue
Block a user