mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e42f4d0079 | ||
|
|
cabe327e9b | ||
|
|
98d22a3079 | ||
|
|
3fffab6d6c | ||
|
|
60defd3e50 | ||
|
|
c79ffc4434 | ||
|
|
ec5e27be4b | ||
|
|
cf347cd369 | ||
|
|
28f316e408 | ||
|
|
9986e0d0b3 | ||
|
|
8b809de568 | ||
|
|
fa1f718412 | ||
|
|
3fabc4d72c | ||
|
|
3a11d290e5 | ||
|
|
700fb47b73 | ||
|
|
61dc8aa18e | ||
|
|
c3f92e92c2 | ||
|
|
54d2c46742 | ||
|
|
114a74d3ba | ||
|
|
b2d29dbde5 | ||
|
|
36bfe38a4c | ||
|
|
d4e2c10006 | ||
|
|
ae6a3cda7a | ||
|
|
d5ac89996f | ||
|
|
a4216fd8ca | ||
|
|
a38adf53c3 | ||
|
|
bd7ebaee3b | ||
|
|
d92fb1da8b | ||
|
|
acb7cd862d | ||
|
|
1976c38dc7 | ||
|
|
e522a25968 | ||
|
|
ad84e758be | ||
|
|
427527a129 | ||
|
|
3ba72e9f15 | ||
|
|
a693740f1a | ||
|
|
2a98be594a | ||
|
|
0787f69884 | ||
|
|
dadaf5831e | ||
|
|
2f9c5e6674 | ||
|
|
d02688971d | ||
|
|
95ca373e10 | ||
|
|
4abb6ec78e | ||
|
|
59a382d6df | ||
|
|
80d9fe2211 | ||
|
|
8b48d6c275 | ||
|
|
585d4ff37b | ||
|
|
6ba1d4908b | ||
|
|
3a8e958684 | ||
|
|
1358411b80 | ||
|
|
e26783b8c6 | ||
|
|
fff1dc45e2 |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,3 +1,37 @@
|
||||
<a name="2.2.12"></a>
|
||||
## [2.2.12](https://github.com/driftyco/ionic-native/compare/v2.2.11...v2.2.12) (2016-12-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **camera-preview:** parameter size is optional ([#871](https://github.com/driftyco/ionic-native/issues/871)) ([61dc8aa](https://github.com/driftyco/ionic-native/commit/61dc8aa))
|
||||
* **diagnostic:** permissionStatus gets values from plugin in runtime ([9986e0d](https://github.com/driftyco/ionic-native/commit/9986e0d)), closes [#872](https://github.com/driftyco/ionic-native/issues/872)
|
||||
* **network:** update API ([ec5e27b](https://github.com/driftyco/ionic-native/commit/ec5e27b))
|
||||
* **sms:** fix callback index when omitting options param ([114a74d](https://github.com/driftyco/ionic-native/commit/114a74d)), closes [#858](https://github.com/driftyco/ionic-native/issues/858)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **admob:** update api and docs ([6ba1d49](https://github.com/driftyco/ionic-native/commit/6ba1d49))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.11"></a>
|
||||
## [2.2.11](https://github.com/driftyco/ionic-native/compare/v2.2.10...v2.2.11) (2016-12-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cordova-property:** fixes static properties of classes ([7ae6e10](https://github.com/driftyco/ionic-native/commit/7ae6e10))
|
||||
* **device:** fixes device plugin ([d918844](https://github.com/driftyco/ionic-native/commit/d918844))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* device: device property no longer exists
|
||||
|
||||
|
||||
|
||||
<a name="2.2.10"></a>
|
||||
## [2.2.10](https://github.com/driftyco/ionic-native/compare/v2.2.9...v2.2.10) (2016-12-04)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.2.11",
|
||||
"version": "2.2.12",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/es5/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sitePath": "../ionic-site",
|
||||
"v2DocsDir": "docs/v2/native",
|
||||
"docsDest": "../ionic-site/docs/v2/native"
|
||||
"docsDest": "../ionic-site/content/docs/v2/native"
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ module.exports = function(currentVersion) {
|
||||
// We don't separate by versions so always put the docs in the root
|
||||
var folder = '';
|
||||
return {
|
||||
href: path.join('/' + config.v2DocsDir, folder),
|
||||
href: '/' + config.v2DocsDir.replace('content/',''),
|
||||
folder: folder,
|
||||
name: version
|
||||
};
|
||||
@@ -99,12 +99,11 @@ module.exports = function(currentVersion) {
|
||||
|
||||
renderDocsProcessor.extraData.version = versionData;
|
||||
renderDocsProcessor.extraData.versionInfo = versionInfo;
|
||||
|
||||
computePathsProcessor.pathTemplates = [{
|
||||
docTypes: ['class', 'var', 'function', 'let'],
|
||||
getOutputPath: function(doc) {
|
||||
var docPath = doc.name + '/index.md';
|
||||
var path = config.v2DocsDir + '/' + docPath;
|
||||
var path = 'content/' + config.v2DocsDir + '/' + docPath;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ function run {
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf docs/v2/native/*/
|
||||
git rm -rf content/docs/v2/native/*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,15 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
docs.forEach(function(doc, i) {
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
|
||||
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
|
||||
.replace('/index.md', '');
|
||||
.replace('/index.md', '')
|
||||
.replace('content/','');
|
||||
});
|
||||
|
||||
docs.push({
|
||||
docType: 'native_menu-menu',
|
||||
id: 'native_menu-menu',
|
||||
template: 'native_menu.template.html',
|
||||
outputPath: '_includes/v2_fluid/native_menu.html'
|
||||
outputPath: 'content/_includes/v2_fluid/native_menu.html'
|
||||
});
|
||||
|
||||
// returning docs will replace docs object in the next process
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = function latestVersion(renderDocsProcessor) {
|
||||
$process: function(docs) {
|
||||
var versionData = renderDocsProcessor.extraData.version;
|
||||
|
||||
var docsBase = 'dist/ionic-site/docs/v2/';
|
||||
var docsBase = 'dist/ionic-site/content/docs/v2/';
|
||||
var versionDir = path.resolve(docsBase, versionData.latest.name);
|
||||
var latestDir = path.resolve(docsBase, 'api');
|
||||
|
||||
|
||||
2
scripts/docs/templates/common.template.html
vendored
2
scripts/docs/templates/common.template.html
vendored
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: "v2_fluid/docs_base"
|
||||
version: "<$ version.current.name $>"
|
||||
versionHref: "<$ version.current.href $>"
|
||||
versionHref: "<$ version.current.href.replace('content/','') $>"
|
||||
path: "<$ doc.path $>"
|
||||
category: native
|
||||
id: "<$ doc.name|lower|replace(' ','-') $>"
|
||||
|
||||
@@ -24,7 +24,8 @@ function run {
|
||||
cd $SITE_DIR
|
||||
|
||||
# if no changes, don't commit
|
||||
if ! git diff-index --quiet HEAD --
|
||||
CHANGED=$(git diff-index --name-only HEAD --)
|
||||
if [ -z "$CHANGED" ];
|
||||
then
|
||||
echo "-- No changes detected for the following commit, docs not updated."
|
||||
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
||||
|
||||
@@ -1,9 +1,61 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var window: any;
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
|
||||
/**
|
||||
* Type that can be used in the onHomeIconPressed callback
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* Title
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* Subtitle
|
||||
*/
|
||||
subtitle?: string;
|
||||
|
||||
/**
|
||||
* Icon type. Case insensitive
|
||||
*/
|
||||
iconType?: string;
|
||||
|
||||
/**
|
||||
* Icon template
|
||||
*/
|
||||
iconTemplate?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
|
||||
/**
|
||||
* Touch force
|
||||
*/
|
||||
force: number;
|
||||
|
||||
/**
|
||||
* Timestamp of action
|
||||
*/
|
||||
timestamp: number;
|
||||
|
||||
/**
|
||||
* X coordinate of action
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* Y coordinate of action
|
||||
*/
|
||||
y: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name 3DTouch
|
||||
* @description
|
||||
@@ -63,6 +115,9 @@ declare var window: any;
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ThreeDeeTouchQuickAction
|
||||
* ThreeDeeTouchForceTouch
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ThreeDeeTouch',
|
||||
@@ -135,18 +190,3 @@ export class ThreeDeeTouch {
|
||||
static disableLinkPreview(): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
iconTemplate?: string;
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
force: number;
|
||||
timestamp: number;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface ActionSheetOptions {
|
||||
|
||||
/**
|
||||
* The labels for the buttons. Uses the index x
|
||||
*/
|
||||
buttonLabels: string[];
|
||||
|
||||
/**
|
||||
* The title for the actionsheet
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Theme to be used on Android
|
||||
*/
|
||||
androidTheme?: number;
|
||||
|
||||
/**
|
||||
* Enable a cancel on Android
|
||||
*/
|
||||
androidEnableCancelButton?: boolean;
|
||||
|
||||
/**
|
||||
* Enable a cancel on Windows Phone
|
||||
*/
|
||||
winphoneEnableCancelButton?: boolean;
|
||||
|
||||
/**
|
||||
* Add a cancel button with text
|
||||
*/
|
||||
addCancelButtonWithLabel?: string;
|
||||
|
||||
/**
|
||||
* Add a destructive button with text
|
||||
*/
|
||||
addDestructiveButtonWithLabel?: string;
|
||||
|
||||
/**
|
||||
* On an iPad, set the X,Y position
|
||||
*/
|
||||
position?: number[];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Action Sheet
|
||||
@@ -52,38 +95,3 @@ export class ActionSheet {
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ActionSheetOptions {
|
||||
/**
|
||||
* The labels for the buttons. Uses the index x
|
||||
*/
|
||||
buttonLabels: string[];
|
||||
/**
|
||||
* The title for the actionsheet
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Theme to be used on Android
|
||||
*/
|
||||
androidTheme?: number;
|
||||
/**
|
||||
* Enable a cancel on Android
|
||||
*/
|
||||
androidEnableCancelButton?: boolean;
|
||||
/**
|
||||
* Enable a cancel on Windows Phone
|
||||
*/
|
||||
winphoneEnableCancelButton?: boolean;
|
||||
/**
|
||||
* Add a cancel button with text
|
||||
*/
|
||||
addCancelButtonWithLabel?: string;
|
||||
/**
|
||||
* Add a destructive button with text
|
||||
*/
|
||||
addDestructiveButtonWithLabel?: string;
|
||||
/**
|
||||
* On an iPad, set the X,Y position
|
||||
*/
|
||||
position?: number[];
|
||||
}
|
||||
|
||||
@@ -1,25 +1,106 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
|
||||
|
||||
export interface AdMobOptions {
|
||||
|
||||
/**
|
||||
* Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM`
|
||||
*/
|
||||
adSize?: AdMobAdSize;
|
||||
|
||||
/**
|
||||
* Banner width, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Banner height, valid when `adSize` is set to `CUSTOM`
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
/**
|
||||
* Allow banner to overlap webview, or else it will push webview up or down to avoid overlap. Defaults to false.
|
||||
*/
|
||||
overlap?: boolean;
|
||||
|
||||
/**
|
||||
* Position of banner ad. Defaults to `TOP_CENTER`. You can use the `AdMob.AD_POSITION` property to select other values.
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
/**
|
||||
* X in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Y in pixels. Valid when `position` is set to `POS_XY`
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Set to true to receive test ad for testing purposes
|
||||
*/
|
||||
isTesting?: boolean;
|
||||
|
||||
/**
|
||||
* Auto show interstitial ad when loaded. Set to false if hope to control the show timing with prepareInterstitial/showInterstitial
|
||||
*/
|
||||
autoShow?: boolean;
|
||||
|
||||
/**
|
||||
* Re-create the banner on web view orientation change (not screen orientation), or else just move the banner. Default:true.
|
||||
*/
|
||||
orientationRenew?: boolean;
|
||||
|
||||
/**
|
||||
* Set extra color style for Ad
|
||||
*/
|
||||
adExtras?: AdMobAdExtras;
|
||||
|
||||
}
|
||||
|
||||
export interface AdMobAdExtras {
|
||||
|
||||
color_bg: string;
|
||||
|
||||
color_bg_top: string;
|
||||
|
||||
color_border: string;
|
||||
|
||||
color_link: string;
|
||||
|
||||
color_text: string;
|
||||
|
||||
color_url: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdMob
|
||||
* @description Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @description
|
||||
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AdMob } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ionViewDidLoad() {
|
||||
* AdMob.onBannerDismiss()
|
||||
* .subscribe(() => { console.log('User returned from interstitial'); });
|
||||
* AdMob.onAdDismiss()
|
||||
* .subscribe(() => { console.log('User dismissed ad'); });
|
||||
* }
|
||||
*
|
||||
* public onClick() {
|
||||
*
|
||||
* onClick() {
|
||||
* AdMob.prepareInterstitial('YOUR_ADID')
|
||||
* .then(() => { AdMob.showInterstitial(); });
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
* Please refer the the plugin's original repository for detailed usage.
|
||||
*
|
||||
* @interfaces
|
||||
* AdMobOptions
|
||||
* AdMobAdExtras
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMob',
|
||||
@@ -30,18 +111,33 @@ import { Observable } from 'rxjs/Observable';
|
||||
})
|
||||
export class AdMob {
|
||||
|
||||
// Static Methods
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
static AD_POSITION = {
|
||||
NO_CHANGE: 0,
|
||||
TOP_LEFT: 1,
|
||||
TOP_CENTER: 2,
|
||||
TOP_RIGHT: 3,
|
||||
LEFT: 4,
|
||||
CENTER: 5,
|
||||
RIGHT: 6,
|
||||
BOTTOM_LEFT: 7,
|
||||
BOTTOM_CENTER: 8,
|
||||
BOTTOM_RIGHT: 9,
|
||||
POS_XY: 10
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
* Create a banner
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the banner is created
|
||||
*/
|
||||
@Cordova()
|
||||
static createBanner(adIdOrOptions: any): Promise<any> { return; }
|
||||
static createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* Destroy the banner, remove it from screen.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -49,18 +145,18 @@ export class AdMob {
|
||||
static removeBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param position
|
||||
* Show banner at position
|
||||
* @param position {number} Position. Use `AdMob.AD_POSITION` to set values.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showBanner(position: any): void { }
|
||||
static showBanner(position: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* Show banner at custom position
|
||||
* @param x {number} Offset from screen left.
|
||||
* @param y {number} Offset from screen top.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -68,7 +164,7 @@ export class AdMob {
|
||||
static showBannerAtXY(x: number, y: number): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* Hide the banner, remove it from screen, but can show it later
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
@@ -76,35 +172,28 @@ export class AdMob {
|
||||
static hideBanner(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param adIdOrOptions
|
||||
* Prepare interstitial banner
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when interstitial is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareInterstitial(adIdOrOptions: any): Promise<any> { return; }
|
||||
static prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show interstitial
|
||||
* Show interstitial ad when it's ready
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static showInterstitial(): void { }
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the interstitial is ready
|
||||
*/
|
||||
@Cordova()
|
||||
static isInterstitialReady(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Prepare a reward video ad
|
||||
* @param adIdOrOptions
|
||||
* @param adIdOrOptions {string | AdMobOptions} Ad ID or Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the ad is prepared
|
||||
*/
|
||||
@Cordova()
|
||||
static prepareRewardVideoAd(adIdOrOptions: any): Promise<any> { return; }
|
||||
static prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show a reward video ad
|
||||
@@ -116,11 +205,11 @@ export class AdMob {
|
||||
|
||||
/**
|
||||
* Sets the values for configuration and targeting
|
||||
* @param options Returns a promise that resolves if the options are set successfully
|
||||
* @param options {AdMobOptions} Options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves when the options have been set
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptions(options: any): Promise<any> { return; }
|
||||
static setOptions(options: AdMobOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get user ad settings
|
||||
@@ -129,71 +218,54 @@ export class AdMob {
|
||||
@Cordova()
|
||||
static getAdSettings(): Promise<any> { return; }
|
||||
|
||||
// Events
|
||||
|
||||
/**
|
||||
* Triggered when failed to receive Ad
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerFailedToReceive'
|
||||
event: 'onAdFailLoad'
|
||||
})
|
||||
static onBannerFailedToReceive(): Observable<any> { return; }
|
||||
static onAdFailLoad(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when Ad received
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerReceive'
|
||||
event: 'onAdLoaded'
|
||||
})
|
||||
static onBannerReceive(): Observable<any> { return; }
|
||||
static onAdLoaded(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when Ad will be showed on screen
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerPresent'
|
||||
event: 'onAdPresent'
|
||||
})
|
||||
static onBannerPresent(): Observable<any> { return; }
|
||||
static onAdPresent(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when user click the Ad, and will jump out of your App
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerLeaveApp'
|
||||
event: 'onAdLeaveApp'
|
||||
})
|
||||
static onBannerLeaveApp(): Observable<any> { return; }
|
||||
static onAdLeaveApp(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Triggered when dismiss the Ad and back to your App
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onBannerDismiss'
|
||||
event: 'onAdDismiss'
|
||||
})
|
||||
static onBannerDismiss(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialFailedToReceive'
|
||||
})
|
||||
static onInterstitialFailedToReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialReceive'
|
||||
})
|
||||
static onInterstitialReceive(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialPresent'
|
||||
})
|
||||
static onInterstitialPresent(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialLeaveApp'
|
||||
})
|
||||
static onInterstitialLeaveApp(): Observable<any> { return; }
|
||||
|
||||
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'onInterstitialDismiss'
|
||||
})
|
||||
static onInterstitialDismiss(): Observable<any> { return; }
|
||||
static onAdDismiss(): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface AndroidFingerprintAuthOptions {
|
||||
|
||||
/**
|
||||
* Used as the alias for your key in the Android Key Store.
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Used to encrypt the token returned upon successful fingerprint authentication.
|
||||
*/
|
||||
clientSecret: string;
|
||||
|
||||
/**
|
||||
* Set to true to remove the "USE BACKUP" button
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
|
||||
/**
|
||||
* Change the language. (en_US or es)
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Android Fingerprint Auth
|
||||
* @description
|
||||
@@ -28,6 +53,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* AndroidFingerprintAuthOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AndroidFingerprintAuth',
|
||||
@@ -36,29 +63,14 @@ import { Cordova, Plugin } from './plugin';
|
||||
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth'
|
||||
})
|
||||
export class AndroidFingerprintAuth {
|
||||
|
||||
/**
|
||||
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
|
||||
* @param params {any}
|
||||
* @param options {AndroidFingerprintAuthOptions} Options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static show(params: {
|
||||
/**
|
||||
* Used as the alias for your key in the Android Key Store.
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* Used to encrypt the token returned upon successful fingerprint authentication.
|
||||
*/
|
||||
clientSecret: string;
|
||||
/**
|
||||
* Set to true to remove the "USE BACKUP" button
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
/**
|
||||
* Change the language. (en_US or es)
|
||||
*/
|
||||
locale?: string
|
||||
}): Promise<{
|
||||
static show(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Base64 encoded string
|
||||
*/
|
||||
|
||||
@@ -9,12 +9,12 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AppAvailability } from 'ionic-native';
|
||||
* import { AppAvailability, Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let app;
|
||||
*
|
||||
* if (device.platform === 'iOS') {
|
||||
* if (Device.platform === 'iOS') {
|
||||
* app = 'twitter://';
|
||||
* } else if (device.platform === 'Android') {
|
||||
* app = 'com.twitter.android';
|
||||
|
||||
@@ -1,8 +1,94 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface AppRatePreferences {
|
||||
|
||||
/**
|
||||
* Custom BCP 47 language tag
|
||||
*/
|
||||
useLanguage?: string;
|
||||
|
||||
/**
|
||||
* Custom application title
|
||||
*/
|
||||
displayAppName?: string;
|
||||
|
||||
/**
|
||||
* Show dialog again when application version will be updated. Defaults to `true`
|
||||
*/
|
||||
promptAgainForEachNewVersion?: boolean;
|
||||
|
||||
/**
|
||||
* count of runs of application before dialog will be displayed. Defaults to `3`
|
||||
*/
|
||||
usesUntilPrompt?: number;
|
||||
|
||||
/**
|
||||
* leave app or no when application page opened in app store (now supported only for iOS). Defaults to `false`
|
||||
*/
|
||||
openStoreInApp?: boolean;
|
||||
|
||||
/**
|
||||
* use custom view for rate dialog. Defaults to `false`
|
||||
*/
|
||||
useCustomRateDialog?: boolean;
|
||||
|
||||
/**
|
||||
* Custom locale object
|
||||
*/
|
||||
customLocale?: any;
|
||||
|
||||
/**
|
||||
* Callbacks for events
|
||||
*/
|
||||
callbacks?: AppRateCallbacks;
|
||||
|
||||
/**
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppUrl?: AppRateStoreAppUrls;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateCallbacks {
|
||||
|
||||
/**
|
||||
* call back function. called when user clicked on rate-dialog buttons
|
||||
*/
|
||||
onButtonClicked?: Function;
|
||||
|
||||
/**
|
||||
* call back function. called when rate-dialog showing
|
||||
*/
|
||||
onRateDialogShowed?: Function;
|
||||
|
||||
}
|
||||
|
||||
export interface AppRateStoreAppUrls {
|
||||
|
||||
/**
|
||||
* application id in AppStore
|
||||
*/
|
||||
ios?: string;
|
||||
|
||||
/**
|
||||
* application URL in GooglePlay
|
||||
*/
|
||||
android?: string;
|
||||
|
||||
/**
|
||||
* application URL in AppWorld
|
||||
*/
|
||||
blackberry?: string;
|
||||
|
||||
/**
|
||||
* application URL in WindowsStore
|
||||
*/
|
||||
windows8?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name App Rate
|
||||
* @description
|
||||
@@ -22,26 +108,11 @@ declare var window;
|
||||
* AppRate.promptForRating(false);
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* @interfaces
|
||||
* AppRatePreferences
|
||||
* AppRateStoreAppUrls
|
||||
* AppRateCallbacks
|
||||
*
|
||||
* Rating dialog preferences
|
||||
*
|
||||
* | Option | Type | Default | Description |
|
||||
* |------------------------------|------------|---------|----------------------------------------------------------------------------------------|
|
||||
* | useLanguage | `String` | null | custom BCP 47 language tag |
|
||||
* | displayAppName | `String` | '' | custom application title |
|
||||
* | promptAgainForEachNewVersion | `Boolean` | true | show dialog again when application version will be updated |
|
||||
* | usesUntilPrompt | `Integer` | 3 | count of runs of application before dialog will be displayed |
|
||||
* | openStoreInApp | `Boolean` | false | leave app or no when application page opened in app store (now supported only for iOS) |
|
||||
* | useCustomRateDialog | `Boolean` | false | use custom view for rate dialog |
|
||||
* | callbacks.onButtonClicked | `Function` | null | call back function. called when user clicked on rate-dialog buttons |
|
||||
* | callbacks.onRateDialogShow | `Function` | null | call back function. called when rate-dialog showing |
|
||||
* | storeAppURL.ios | `String` | null | application id in AppStore |
|
||||
* | storeAppURL.android | `String` | null | application URL in GooglePlay |
|
||||
* | storeAppURL.blackberry | `String` | null | application URL in AppWorld |
|
||||
* | storeAppURL.windows8 | `String` | null | application URL in WindowsStore |
|
||||
* | customLocale | `Object` | null | custom locale object |
|
||||
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppRate',
|
||||
@@ -57,7 +128,7 @@ export class AppRate {
|
||||
* See table below for options
|
||||
*/
|
||||
@CordovaProperty
|
||||
static preferences;
|
||||
static preferences: AppRatePreferences;
|
||||
|
||||
/**
|
||||
* Prompts the user for rating
|
||||
|
||||
@@ -26,6 +26,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class AppVersion {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* @returns {Promise<any>}
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Cordova, Plugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
export interface Location {
|
||||
export interface BackgroundGeolocationResponse {
|
||||
|
||||
/**
|
||||
* ID of location as stored in DB (or null)
|
||||
@@ -65,7 +65,7 @@ export interface Location {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
export interface BackgroundGeolocationConfig {
|
||||
|
||||
/**
|
||||
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
|
||||
@@ -268,8 +268,8 @@ export interface Config {
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* Location
|
||||
* Config
|
||||
* BackgroundGeolocationResponse
|
||||
* BackgroundGeolocationConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundGeolocation',
|
||||
@@ -341,7 +341,7 @@ export class BackgroundGeolocation {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static configure(callback: Function, errorCallback: Function, options: Config): any { return; }
|
||||
static configure(callback: Function, errorCallback: Function, options: BackgroundGeolocationConfig): any { return; }
|
||||
|
||||
/**
|
||||
* Turn ON the background-geolocation system.
|
||||
@@ -379,7 +379,7 @@ export class BackgroundGeolocation {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static setConfig(options: Config): Promise<any> { return; }
|
||||
static setConfig(options: BackgroundGeolocationConfig): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns current stationaryLocation if available. null if not
|
||||
@@ -387,7 +387,7 @@ export class BackgroundGeolocation {
|
||||
* @returns {Promise<Location>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getStationaryLocation(): Promise<Location> { return; }
|
||||
static getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
||||
|
||||
/**
|
||||
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
|
||||
@@ -498,4 +498,5 @@ export class BackgroundGeolocation {
|
||||
*/
|
||||
@Cordova()
|
||||
static getLogEntries(limit: number): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,38 @@ import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface BackgroundModeConfiguration {
|
||||
|
||||
/**
|
||||
* Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
* The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
* Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
* if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Background Mode
|
||||
* @description
|
||||
@@ -13,19 +45,9 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* BackgroundMode.enable();
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* Configuration options
|
||||
*
|
||||
* | Property | Type | Description |
|
||||
* |----------|-----------|------------------------------------------------------------------------------|
|
||||
* | title | `string` | Title of the background task. Optional |
|
||||
* | ticker | `string` | The text that scrolls itself on the statusbar. Optional |
|
||||
* | text | `string` | Description of the background task. Optional |
|
||||
* | silent | `boolean` | If the plugin will display a notification or not. Default is false. Optional |
|
||||
* | resume | `boolean` | Bring the app into the foreground if the notification is tapped. Optional |
|
||||
*
|
||||
*
|
||||
* @interfaces
|
||||
* BackgroundModeConfiguration
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundMode',
|
||||
@@ -35,6 +57,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
})
|
||||
export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Enable the background mode.
|
||||
* Once called, prevents the app from being paused while in background.
|
||||
@@ -73,7 +96,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static setDefaults(options?: Configure): Promise<any> { return; }
|
||||
static setDefaults(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Modify the displayed information.
|
||||
@@ -83,7 +106,7 @@ export class BackgroundMode {
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static configure(options?: Configure): Promise<any> { return; }
|
||||
static configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Called when background mode is activated.
|
||||
@@ -107,34 +130,3 @@ export class BackgroundMode {
|
||||
static onfailure(): Observable<any> { return; };
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Configurations items that can be updated.
|
||||
*/
|
||||
export interface Configure {
|
||||
/**
|
||||
*Title of the background task
|
||||
*/
|
||||
title?: String;
|
||||
|
||||
/**
|
||||
*The text that scrolls itself on statusbar
|
||||
*/
|
||||
ticker?: String;
|
||||
|
||||
/**
|
||||
*Description of background task
|
||||
*/
|
||||
text?: String;
|
||||
|
||||
/**
|
||||
*Boolean, if true plugin will not display a notification. Default is false.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
*Boolean. By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped.
|
||||
*/
|
||||
resume?: boolean;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,44 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface BarcodeScannerOptions {
|
||||
|
||||
/**
|
||||
* Prefer front camera. Supported on iOS and Android.
|
||||
*/
|
||||
preferFrontCamera?: boolean;
|
||||
|
||||
/**
|
||||
* Show flip camera button. Supported on iOS and Android.
|
||||
*/
|
||||
showFlipCameraButton?: boolean;
|
||||
|
||||
/**
|
||||
* Show torch button. Supported on iOS and Android.
|
||||
*/
|
||||
showTorchButton?: boolean;
|
||||
|
||||
/**
|
||||
* Disable animations. Supported on iOS only.
|
||||
*/
|
||||
disableAnimations?: boolean;
|
||||
|
||||
/**
|
||||
* Prompt text. Supported on Android only.
|
||||
*/
|
||||
prompt?: string;
|
||||
|
||||
/**
|
||||
* Formats separated by commas. Defaults to all formats except `PDF_417` and `RSS_EXPANDED`.
|
||||
*/
|
||||
formats?: string;
|
||||
|
||||
/**
|
||||
* Orientation. Supported on Android only. Can be set to `portrait` or `landscape`. Defaults to none so the user can rotate the phone and pick an orientation.
|
||||
*/
|
||||
orientation?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Barcode Scanner
|
||||
* @description
|
||||
@@ -18,6 +57,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // An error occurred
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* BarcodeScannerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BarcodeScanner',
|
||||
@@ -37,15 +78,16 @@ export class BarcodeScanner {
|
||||
PHONE_TYPE: 'PHONE_TYPE',
|
||||
SMS_TYPE: 'SMS_TYPE'
|
||||
};
|
||||
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
* @param options {Object} Optional options to pass to the scanner
|
||||
* @param options {BarcodeScannerOptions} Optional options to pass to the scanner
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with scanner data, or rejects with an error.
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static scan(options?: any): Promise<any> { return; }
|
||||
static scan(options?: BarcodeScannerOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Encodes data into a barcode.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Base64 To Gallery
|
||||
* @description This plugin allows you to save base64 data as a png image into the device
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface BatteryStatusResponse {
|
||||
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Battery Status
|
||||
* @description
|
||||
@@ -22,6 +36,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* BatteryStatusResponse
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BatteryStatus',
|
||||
@@ -33,44 +49,32 @@ export class BatteryStatus {
|
||||
|
||||
/**
|
||||
* Watch the change in battery level
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange(): Observable<StatusObject> { return; }
|
||||
static onChange(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes low
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylow'
|
||||
})
|
||||
static onLow(): Observable<StatusObject> { return; }
|
||||
static onLow(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
/**
|
||||
* Watch when the battery level goes to critial
|
||||
* @returns {Observable<StatusObject>} Returns an observable that pushes a status object
|
||||
* @returns {Observable<BatteryStatusResponse>} Returns an observable that pushes a status object
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterycritical'
|
||||
})
|
||||
static onCritical(): Observable<StatusObject> { return; }
|
||||
static onCritical(): Observable<BatteryStatusResponse> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface StatusObject {
|
||||
/**
|
||||
* The battery charge percentage
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged: boolean;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class BLE {
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals for the specified amount of time.
|
||||
*
|
||||
@@ -421,4 +422,5 @@ export class BLE {
|
||||
*/
|
||||
@Cordova()
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,55 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface CalendarOptions {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
firstReminderMinutes?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
secondReminderMinutes?: number;
|
||||
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
recurrenceInterval?: number; // only used when recurrence is set
|
||||
|
||||
/**
|
||||
* Recurrence. Can be set to `daily`, `weekly`, `monthly` or `yearly`
|
||||
*/
|
||||
recurrence?: string;
|
||||
|
||||
/**
|
||||
* Recurrence interval. Valid only when `recurrence` option is set.
|
||||
*/
|
||||
recurrenceInterval?: number;
|
||||
|
||||
/**
|
||||
* Recurrence end date. Valid only when `recurrence` option is set.
|
||||
*/
|
||||
recurrenceEndDate?: Date;
|
||||
|
||||
/**
|
||||
* Calendar name. Ths is supported by `iOS` only.
|
||||
*/
|
||||
calendarName?: string;
|
||||
|
||||
/**
|
||||
* Calendar id
|
||||
*/
|
||||
calendarId?: number;
|
||||
|
||||
/**
|
||||
* URL
|
||||
*/
|
||||
url?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +71,8 @@ export interface CalendarOptions {
|
||||
* (err) => { console.log(err); }
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CalendarOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Calendar',
|
||||
@@ -102,9 +139,7 @@ export class Calendar {
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static createCalendar(
|
||||
nameOrOptions: string | { calendarName: string, calendarColor: string }
|
||||
): Promise<any> { return; }
|
||||
static createCalendar(nameOrOptions: string | any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete a calendar. (iOS only)
|
||||
@@ -117,31 +152,12 @@ export class Calendar {
|
||||
/**
|
||||
* 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
|
||||
* @return {CalendarOptions} Returns an object with the default calendar options
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static getCalendarOptions(): CalendarOptions {
|
||||
return {
|
||||
firstReminderMinutes: 60,
|
||||
secondReminderMinutes: null,
|
||||
recurrence: null,
|
||||
recurrenceInterval: 1,
|
||||
recurrenceEndDate: null,
|
||||
calendarName: null,
|
||||
calendarId: null,
|
||||
url: null
|
||||
};
|
||||
}
|
||||
static getCalendarOptions(): CalendarOptions { return; }
|
||||
|
||||
/**
|
||||
* Silently create an event.
|
||||
@@ -279,7 +295,9 @@ export class Calendar {
|
||||
* @param {Date} [endDate] The end date
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -293,7 +311,9 @@ export class Calendar {
|
||||
* Get a list of all future events in the specified calendar. (iOS only)
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -311,7 +331,9 @@ export class Calendar {
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static modifyEvent(
|
||||
title?: string,
|
||||
location?: string,
|
||||
@@ -342,7 +364,9 @@ export class Calendar {
|
||||
* @param {CalendarOptions} [newOptions] New event options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static modifyEventWithOptions(
|
||||
title?: string,
|
||||
location?: string,
|
||||
@@ -388,7 +412,9 @@ export class Calendar {
|
||||
* @param {string} calendarName
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
static deleteEventFromNamedCalendar(
|
||||
title?: string,
|
||||
location?: string,
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CallNumber {
|
||||
|
||||
/**
|
||||
* Calls a phone number
|
||||
* @param numberToCall {string} The phone number to call as a string
|
||||
@@ -35,4 +36,5 @@ export class CallNumber {
|
||||
static callNumber(numberToCall: string, bypassAppChooser: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CameraPreviewRect {
|
||||
|
||||
x: number;
|
||||
|
||||
y: number;
|
||||
|
||||
width: number;
|
||||
|
||||
height: number;
|
||||
|
||||
}
|
||||
|
||||
export interface CameraPreviewSize {
|
||||
|
||||
maxWidth: number;
|
||||
|
||||
maxHeight: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,6 +75,9 @@ export interface CameraPreviewSize {
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* CameraPreviewRect
|
||||
* CameraPreviewSize
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CameraPreview',
|
||||
@@ -107,7 +117,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static takePicture(size: CameraPreviewSize): void { }
|
||||
static takePicture(size?: CameraPreviewSize): void { }
|
||||
|
||||
/**
|
||||
* Register a callback function that receives the original picture and the image captured from the preview box.
|
||||
@@ -157,4 +167,5 @@ export class CameraPreview {
|
||||
sync: true
|
||||
})
|
||||
static setColorEffect(effect: string): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ export interface CameraPopoverOptions {
|
||||
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
|
||||
})
|
||||
export class Camera {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @enum {number}
|
||||
|
||||
@@ -1,6 +1,134 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface CardIOOptions {
|
||||
|
||||
/**
|
||||
* Set to true to require expiry date
|
||||
*/
|
||||
requireExpiry?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the card CVV
|
||||
*/
|
||||
requireCVV?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the card billing postal code.
|
||||
*/
|
||||
requirePostalCode?: boolean;
|
||||
|
||||
/**
|
||||
* Removes the keyboard button from the scan screen.
|
||||
*/
|
||||
supressManual?: boolean;
|
||||
|
||||
/**
|
||||
* The postal code will only collect numeric input. Set this if you know the expected country's postal code has only numeric postal codes.
|
||||
*/
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
|
||||
/**
|
||||
* The theme for the card.io Activity's will be set to the theme of the application.
|
||||
*/
|
||||
keepApplicationTheme?: boolean;
|
||||
|
||||
/**
|
||||
* The user will be prompted for the cardholder name
|
||||
*/
|
||||
requireCardholderName?: boolean;
|
||||
|
||||
/**
|
||||
* Used to display instructions to the user while they are scanning their card.
|
||||
*/
|
||||
scanInstructions?: string;
|
||||
|
||||
/**
|
||||
* If set, the card will not be scanned with the camera.
|
||||
*/
|
||||
noCamera?: boolean;
|
||||
|
||||
/**
|
||||
* If scanExpiry is true, an attempt to extract the expiry from the card image will be made.
|
||||
*/
|
||||
scanExpiry?: boolean;
|
||||
|
||||
/**
|
||||
* The preferred language for all strings appearing in the user interface. If not set, or if set to null, defaults to the device's current language setting.
|
||||
*/
|
||||
languageOrLocale?: string;
|
||||
|
||||
/**
|
||||
* Changes the color of the guide overlay on the camera. The color is provided in hexadecimal format (e.g. `#FFFFFF`)
|
||||
*/
|
||||
guideColor?: string;
|
||||
|
||||
/**
|
||||
* The user will not be prompted to confirm their card number after processing.
|
||||
*/
|
||||
supressConfirmation?: boolean;
|
||||
|
||||
/**
|
||||
* The card.io logo will not be shown overlaid on the camera.
|
||||
*/
|
||||
hideCardIOLogo?: boolean;
|
||||
|
||||
/**
|
||||
* The card.io logo will be shown instead of the PayPal logo.
|
||||
*/
|
||||
useCardIOLogo?: boolean;
|
||||
|
||||
/**
|
||||
* Once a card image has been captured but before it has been processed, this value will determine whether to continue processing as usual.
|
||||
*/
|
||||
supressScan?: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOResponse {
|
||||
|
||||
/**
|
||||
* Card type
|
||||
*/
|
||||
cardType: string;
|
||||
|
||||
/**
|
||||
* Masked card number, showing only last 4 digits
|
||||
*/
|
||||
redactedCardNumber: string;
|
||||
|
||||
/**
|
||||
* Full card number
|
||||
*/
|
||||
cardNumber: string;
|
||||
|
||||
/**
|
||||
* Expiry month
|
||||
*/
|
||||
expiryMonth: number;
|
||||
|
||||
/**
|
||||
* Expiry year
|
||||
*/
|
||||
expiryYear: number;
|
||||
|
||||
/**
|
||||
* CVV
|
||||
*/
|
||||
cvv: string;
|
||||
|
||||
/**
|
||||
* Postal code
|
||||
*/
|
||||
postalCode: string;
|
||||
|
||||
/**
|
||||
* Cardholder name
|
||||
*/
|
||||
cardholderName: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name CardIO
|
||||
* @description
|
||||
@@ -23,15 +151,19 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* CardIOOptions
|
||||
* CardIOResponse
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CardIO',
|
||||
plugin: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
plugin: 'card.io.cordova.mobilesdk',
|
||||
pluginRef: 'CardIO',
|
||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
export class CardIO {
|
||||
|
||||
/**
|
||||
* Check whether card scanning is currently available. (May vary by
|
||||
* device, OS version, network connectivity, etc.)
|
||||
@@ -57,33 +189,3 @@ export class CardIO {
|
||||
static version(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
requireExpiry?: boolean;
|
||||
requireCVV?: boolean;
|
||||
requirePostalCode?: boolean;
|
||||
supressManual?: boolean;
|
||||
restrictPostalCodeToNumericOnly?: boolean;
|
||||
keepApplicationTheme?: boolean;
|
||||
requireCardholderName?: boolean;
|
||||
scanInstructions?: string;
|
||||
noCamera?: boolean;
|
||||
scanExpiry?: boolean;
|
||||
languageOrLocale?: string;
|
||||
guideColor?: string;
|
||||
supressConfirmation?: boolean;
|
||||
hideCardIOLogo?: boolean;
|
||||
useCardIOLogo?: boolean;
|
||||
supressScan?: boolean;
|
||||
}
|
||||
|
||||
export interface CardIOResponse {
|
||||
cardType: string;
|
||||
redactedCardNumber: string;
|
||||
cardNumber: string;
|
||||
expiryMonth: number;
|
||||
expiryYear: number;
|
||||
cvv: string;
|
||||
postalCode: string;
|
||||
cardholderName: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Clipboard
|
||||
* @description
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
// below are taken from
|
||||
// https://raw.githubusercontent.com/Microsoft/cordova-plugin-code-push/master/typings/codePush.d.ts
|
||||
// and adjusted to remove warnings and access control
|
||||
|
||||
namespace Http {
|
||||
export const enum Verb {
|
||||
GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
|
||||
|
||||
@@ -9,32 +9,46 @@ export type ContactFieldType = 'addresses' | 'birthday' | 'categories' | 'countr
|
||||
* @private
|
||||
*/
|
||||
export interface IContactProperties {
|
||||
|
||||
/** 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?: IContactName;
|
||||
|
||||
/** A casual name by which to address the contact. */
|
||||
nickname?: string;
|
||||
|
||||
/** An array of all the contact's phone numbers. */
|
||||
phoneNumbers?: IContactField[];
|
||||
|
||||
/** An array of all the contact's email addresses. */
|
||||
emails?: IContactField[];
|
||||
|
||||
/** An array of all the contact's addresses. */
|
||||
addresses?: IContactAddress[];
|
||||
|
||||
/** An array of all the contact's IM addresses. */
|
||||
ims?: IContactField[];
|
||||
|
||||
/** An array of all the contact's organizations. */
|
||||
organizations?: IContactOrganization[];
|
||||
|
||||
/** The birthday of the contact. */
|
||||
birthday?: Date;
|
||||
|
||||
/** A note about the contact. */
|
||||
note?: string;
|
||||
|
||||
/** An array of the contact's photos. */
|
||||
photos?: IContactField[];
|
||||
|
||||
/** An array of all the user-defined categories associated with the contact. */
|
||||
categories?: IContactField[];
|
||||
|
||||
/** An array of web pages associated with the contact. */
|
||||
urls?: IContactField[];
|
||||
}
|
||||
@@ -217,9 +231,9 @@ export class ContactOrganization implements IContactOrganization {
|
||||
export interface IContactFindOptions {
|
||||
/** The search string used to find navigator.contacts. */
|
||||
filter?: string;
|
||||
/** Determines if the find operation returns multiple navigator.contacts. */
|
||||
/** Determines if the find operation returns multiple navigator.contacts. Defaults to false. */
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
/** Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
@@ -245,10 +259,10 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { Contact } from 'ionic-native';
|
||||
* import { Contacts, Contact, ContactField, ContactName } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let contact = new Contact();
|
||||
* let contact: Contact = Contacts.create();
|
||||
*
|
||||
* contact.name = new ContactName(null, 'Smith', 'John');
|
||||
* contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
|
||||
@@ -274,6 +288,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
repo: 'https://github.com/apache/cordova-plugin-contacts'
|
||||
})
|
||||
export class Contacts {
|
||||
|
||||
/**
|
||||
* Create a single contact.
|
||||
* @returns {Contact} Returns a Contact object
|
||||
@@ -284,16 +299,8 @@ export class Contacts {
|
||||
|
||||
/**
|
||||
* Search for contacts in the Contacts list.
|
||||
* @param fields {ContactFieldType[]} 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 {IContactFindOptions} 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)
|
||||
*
|
||||
* @param fields {ContactFieldType[]} Contact fields to be used as a search qualifier
|
||||
* @param options {IContactFindOptions} Optional options for the query
|
||||
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
|
||||
*/
|
||||
static find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
/**
|
||||
* @name Crop
|
||||
* @description Crops images
|
||||
@@ -22,6 +23,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
repo: 'https://github.com/jeduan/cordova-plugin-crop'
|
||||
})
|
||||
export class Crop {
|
||||
|
||||
/**
|
||||
* Crops an image
|
||||
* @param pathToImage
|
||||
@@ -32,4 +34,5 @@ export class Crop {
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
static crop(pathToImage: string, options?: {quality: number}): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {Cordova, Plugin} from './plugin';
|
||||
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
* The mode of the date picker
|
||||
@@ -35,71 +34,88 @@ export interface DatePickerOptions {
|
||||
* Label of BUTTON_POSITIVE (done button) on Android
|
||||
*/
|
||||
okText?: string;
|
||||
|
||||
/**
|
||||
* Label of BUTTON_NEGATIVE (cancel button). If empty, uses android.R.string.cancel.
|
||||
*/
|
||||
cancelText?: string;
|
||||
|
||||
/**
|
||||
* Label of today button. If empty, doesn't show the option to select current date.
|
||||
*/
|
||||
todayText?: string;
|
||||
|
||||
/**
|
||||
* Label of now button. If empty, doesn't show the option to select current time.
|
||||
*/
|
||||
nowText?: string;
|
||||
|
||||
/**
|
||||
* Shows time dialog in 24 hours format.
|
||||
*/
|
||||
is24Hour?: boolean;
|
||||
|
||||
/**
|
||||
* Choose the Android theme for the picker. You can use the DatePicker.ANDROID_THEMES property.
|
||||
* Values: 1: THEME_TRADITIONAL | 2: THEME_HOLO_DARK | 3: THEME_HOLO_LIGHT | 4: THEME_DEVICE_DEFAULT_DARK | 5: THEME_DEVICE_DEFAULT_LIGHT
|
||||
*/
|
||||
androidTheme?: number;
|
||||
|
||||
/**
|
||||
* Shows or hide dates earlier then selected date.
|
||||
*/
|
||||
allowOldDates?: boolean;
|
||||
|
||||
/**
|
||||
* Shows or hide dates after selected date.
|
||||
*/
|
||||
allowFutureDates?: boolean;
|
||||
|
||||
/**
|
||||
* Label of done button.
|
||||
*/
|
||||
doneButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* Hex color of done button.
|
||||
*/
|
||||
doneButtonColor?: string;
|
||||
|
||||
/**
|
||||
* Label of cancel button.
|
||||
*/
|
||||
cancelButtonLabel?: string;
|
||||
|
||||
/**
|
||||
* Hex color of cancel button.
|
||||
*/
|
||||
cancelButtonColor?: string;
|
||||
|
||||
/**
|
||||
* X position of date picker. The position is absolute to the root view of the application.
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Y position of date picker. The position is absolute to the root view of the application.
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Interval between options in the minute section of the date picker.
|
||||
*/
|
||||
minuteInterval?: number;
|
||||
|
||||
/**
|
||||
* Force the UIPopoverArrowDirection enum. The value any will revert to default UIPopoverArrowDirectionAny and let the app choose the proper direction itself.
|
||||
*/
|
||||
popoverArrowDirection?: string;
|
||||
|
||||
/**
|
||||
* Force locale for datePicker.
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
/**
|
||||
* @name DB Meter
|
||||
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface DeeplinkMatch {
|
||||
|
||||
/**
|
||||
* The route info for the matched route
|
||||
*/
|
||||
@@ -19,6 +19,7 @@ export interface DeeplinkMatch {
|
||||
* the route was matched (for example, Facebook sometimes adds extra data)
|
||||
*/
|
||||
$link: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,11 +53,22 @@ export interface DeeplinkMatch {
|
||||
* Deeplinks.routeWithNavController(this.navController, {
|
||||
'/about-us': AboutPage,
|
||||
'/products/:productId': ProductPage
|
||||
});
|
||||
}).subscribe((match) => {
|
||||
// match.$route - the route we matched, which is the matched entry from the arguments to route()
|
||||
// match.$args - the args passed in the link
|
||||
// match.$link - the full link data
|
||||
console.log('Successfully matched route', match);
|
||||
}, (nomatch) => {
|
||||
// nomatch.$link - the full link data
|
||||
console.error('Got a deeplink that didn\'t match', nomatch);
|
||||
});
|
||||
* ```
|
||||
*
|
||||
* See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
|
||||
* retrieve the `NavController` reference at runtime.
|
||||
*
|
||||
* @interfaces
|
||||
* DeeplinkMatch
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Deeplinks',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'DeviceAccounts',
|
||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface AccelerationData {
|
||||
export interface DeviceMotionAccelerationData {
|
||||
|
||||
/**
|
||||
* Amount of acceleration on the x-axis. (in m/s^2)
|
||||
@@ -26,7 +25,7 @@ export interface AccelerationData {
|
||||
|
||||
}
|
||||
|
||||
export interface AccelerometerOptions {
|
||||
export interface DeviceMotionAccelerometerOptions {
|
||||
|
||||
/**
|
||||
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
|
||||
@@ -60,6 +59,9 @@ export interface AccelerometerOptions {
|
||||
* subscription.unsubscribe();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceMotionAccelerationData
|
||||
* DeviceMotionAccelerometerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceMotion',
|
||||
@@ -71,21 +73,21 @@ export class DeviceMotion {
|
||||
|
||||
/**
|
||||
* Get the current acceleration along the x, y, and z axes.
|
||||
* @returns {Promise<AccelerationData>} Returns object with x, y, z, and timestamp properties
|
||||
* @returns {Promise<DeviceMotionAccelerationData>} Returns object with x, y, z, and timestamp properties
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentAcceleration(): Promise<AccelerationData> { return; }
|
||||
static getCurrentAcceleration(): Promise<DeviceMotionAccelerationData> { return; }
|
||||
|
||||
/**
|
||||
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
|
||||
* @param {AccelerometerOptions} options list of options for the accelerometer.
|
||||
* @returns {Observable<AccelerationData>} Observable returns an observable that you can subscribe to
|
||||
* @returns {Observable<DeviceMotionAccelerationData>} Observable returns an observable that you can subscribe to
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
|
||||
static watchAcceleration(options?: DeviceMotionAccelerometerOptions): Observable<DeviceMotionAccelerationData> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CompassHeading {
|
||||
export interface DeviceOrientationCompassHeading {
|
||||
|
||||
/**
|
||||
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
|
||||
@@ -26,7 +25,7 @@ export interface CompassHeading {
|
||||
|
||||
}
|
||||
|
||||
export interface CompassOptions {
|
||||
export interface DeviceOrientationCompassOptions {
|
||||
|
||||
/**
|
||||
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
|
||||
@@ -65,6 +64,9 @@ export interface CompassOptions {
|
||||
* // Stop watching heading change
|
||||
* subscription.unsubscribe();
|
||||
* ```
|
||||
* @interfaces
|
||||
* DeviceOrientationCompassOptions
|
||||
* DeviceOrientationCompassHeading
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'DeviceOrientation',
|
||||
@@ -76,23 +78,23 @@ export class DeviceOrientation {
|
||||
|
||||
/**
|
||||
* Get the current compass heading.
|
||||
* @returns {Promise<CompassHeading>}
|
||||
* @returns {Promise<DeviceOrientationCompassHeading>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getCurrentHeading(): Promise<CompassHeading> { return; }
|
||||
static getCurrentHeading(): Promise<DeviceOrientationCompassHeading> { return; }
|
||||
|
||||
/**
|
||||
* Get the device current heading at a regular interval
|
||||
*
|
||||
* Stop the watch by unsubscribing from the observable
|
||||
* @param {CompassOptions} options Options for compass. Frequency and Filter. Optional
|
||||
* @returns {Observable<CompassHeading>} Returns an observable that contains the compass heading
|
||||
* @param {DeviceOrientationCompassOptions} options Options for compass. Frequency and Filter. Optional
|
||||
* @returns {Observable<DeviceOrientationCompassHeading>} Returns an observable that contains the compass heading
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchHeading(options?: CompassOptions): Observable<CompassHeading> { return; }
|
||||
static watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import {Cordova, Plugin, CordovaProperty} from './plugin';
|
||||
|
||||
/**
|
||||
* @name Diagnostic
|
||||
@@ -27,6 +27,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }).catch(e => console.error(e));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Diagnostic',
|
||||
@@ -63,18 +64,19 @@ export class Diagnostic {
|
||||
BODY_SENSORS: 'BODY_SENSORS'
|
||||
};
|
||||
|
||||
static permissionStatus = {
|
||||
GRANTED: 'GRANTED',
|
||||
GRANTED_WHEN_IN_USE: 'GRANTED_WHEN_IN_USE', // iOS
|
||||
RESTRICTED: 'RESTRICTED', // iOS
|
||||
DENIED: 'DENIED',
|
||||
DENIED_ALWAYS: 'DENIED_ALWAYS', // android
|
||||
NOT_REQUESTED: 'NOT_REQUESTED'
|
||||
@CordovaProperty
|
||||
static permissionStatus: {
|
||||
GRANTED;
|
||||
DENIED;
|
||||
NOT_REQUESTED;
|
||||
DENIED_ALWAYS;
|
||||
RESTRICTED;
|
||||
GRANTED_WHEN_IN_USE;
|
||||
};
|
||||
|
||||
static locationAuthorizationMode = {
|
||||
ALWAYS: 'ALWAYS',
|
||||
WHEN_IN_USE: 'WHEN_IN_USE'
|
||||
ALWAYS: 'always',
|
||||
WHEN_IN_USE: 'when_in_use'
|
||||
};
|
||||
|
||||
static permissionGroups = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface PromptCallback {
|
||||
export interface DialogsPromptCallback {
|
||||
|
||||
/**
|
||||
* The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
|
||||
@@ -12,6 +12,7 @@ export interface PromptCallback {
|
||||
* The text entered in the prompt dialog box. (String)
|
||||
*/
|
||||
input1: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +31,8 @@ export interface PromptCallback {
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* DialogsPromptCallback
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Dialogs',
|
||||
@@ -79,7 +82,7 @@ export class Dialogs {
|
||||
* @param {string} title Dialog title. (Optional, defaults to Prompt)
|
||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"])
|
||||
* @param {string} defaultText Default textbox input value. (Optional, Default: empty string)
|
||||
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
* @returns {Promise<DialogsPromptCallback>} Returns a promise that resolves an object with the button index clicked and the text entered
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
@@ -90,7 +93,7 @@ export class Dialogs {
|
||||
title: string = 'Prompt',
|
||||
buttonLabels: Array<string> = ['OK', 'Cancel'],
|
||||
defaultText: string = ''
|
||||
): Promise<any> { return; }
|
||||
): Promise<DialogsPromptCallback> { return; }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface EmailComposerOptions {
|
||||
|
||||
app?: string;
|
||||
|
||||
to?: string | Array<string>;
|
||||
|
||||
cc?: string | Array<string>;
|
||||
|
||||
bcc?: string | Array<string>;
|
||||
|
||||
attachments?: Array<any>;
|
||||
|
||||
subject?: string;
|
||||
|
||||
body?: string;
|
||||
|
||||
isHtml?: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name Email Composer
|
||||
* @description
|
||||
@@ -42,6 +62,8 @@ declare var cordova: any;
|
||||
* EmailComposer.open(email);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* EmailComposerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'EmailComposer',
|
||||
@@ -92,7 +114,7 @@ export class EmailComposer {
|
||||
/**
|
||||
* Displays the email composer pre-filled with data.
|
||||
*
|
||||
* @param email {Email} Email
|
||||
* @param options {EmailComposerOptions} Email
|
||||
* @param scope {any?} An optional scope for the promise
|
||||
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
|
||||
*/
|
||||
@@ -100,17 +122,6 @@ export class EmailComposer {
|
||||
successIndex: 1,
|
||||
errorIndex: 3
|
||||
})
|
||||
static open(email: Email, scope?: any): Promise<any> { return; }
|
||||
static open(options: EmailComposerOptions, scope?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface Email {
|
||||
app?: string;
|
||||
to?: string | Array<string>;
|
||||
cc?: string | Array<string>;
|
||||
bcc?: string | Array<string>;
|
||||
attachments?: Array<any>;
|
||||
subject?: string;
|
||||
body?: string;
|
||||
isHtml?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface EstimoteBeaconRegion {
|
||||
|
||||
state?: string;
|
||||
|
||||
major: number;
|
||||
|
||||
minor: number;
|
||||
|
||||
identifier?: string;
|
||||
|
||||
uuid: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name EstimoteBeacons
|
||||
*
|
||||
* @description
|
||||
* This plugin enables communication between a phone and Estimote Beacons peripherals.
|
||||
*
|
||||
* @interfaces
|
||||
* EstimoteBeaconRegion
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'EstimoteBeacons',
|
||||
@@ -40,6 +56,7 @@ export class EstimoteBeacons {
|
||||
|
||||
/** Beacon colour */
|
||||
static BeaconColorBlueberryPie = 3;
|
||||
|
||||
/**
|
||||
* Beacon colour.
|
||||
*/
|
||||
@@ -394,7 +411,6 @@ export class EstimoteBeacons {
|
||||
})
|
||||
static startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Stop monitoring secure beacons. Available on iOS.
|
||||
* This function has the same parameters/behaviour as
|
||||
@@ -481,10 +497,3 @@ export class EstimoteBeacons {
|
||||
|
||||
}
|
||||
|
||||
export interface EstimoteBeaconRegion {
|
||||
state?: string;
|
||||
major: number;
|
||||
minor: number;
|
||||
identifier?: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
|
||||
status: string;
|
||||
|
||||
authResponse: {
|
||||
|
||||
session_key: boolean;
|
||||
|
||||
accessToken: string;
|
||||
|
||||
expiresIn: number;
|
||||
|
||||
sig: string;
|
||||
|
||||
secret: string;
|
||||
|
||||
userID: string;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Facebook
|
||||
* @description
|
||||
@@ -249,15 +271,3 @@ export class Facebook {
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
status: string;
|
||||
authResponse: {
|
||||
session_key: boolean;
|
||||
accessToken: string;
|
||||
expiresIn: number;
|
||||
sig: string;
|
||||
secret: string;
|
||||
userID: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileChooser
|
||||
* @description
|
||||
@@ -23,10 +24,12 @@ import { Plugin, Cordova } from './plugin';
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FileChooser {
|
||||
|
||||
/**
|
||||
* Open a file
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
static open(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name FileOpener
|
||||
* @description
|
||||
@@ -19,6 +20,7 @@ import { Plugin, Cordova } from './plugin';
|
||||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2'
|
||||
})
|
||||
export class FileOpener {
|
||||
|
||||
/**
|
||||
* Open an file
|
||||
* @param filePath {string} File Path
|
||||
@@ -55,4 +57,5 @@ export class FileOpener {
|
||||
errorName: 'error'
|
||||
})
|
||||
static appIsInstalled(packageId: string): Promise<any> {return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ declare var window: any;
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class FilePath {
|
||||
|
||||
/**
|
||||
* Resolve native path for given content URL/path.
|
||||
* @param {String} path Content URL/path.
|
||||
@@ -33,4 +34,5 @@ export class FilePath {
|
||||
*/
|
||||
@Cordova()
|
||||
static resolveNativePath(path: string): Promise<string> {return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var FileTransfer;
|
||||
|
||||
export interface FileUploadOptions {
|
||||
@@ -46,6 +45,7 @@ export interface FileUploadOptions {
|
||||
* Content-Type is present, multipart form data will NOT be used.
|
||||
*/
|
||||
headers?: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileUploadResult {
|
||||
@@ -69,6 +69,7 @@ export interface FileUploadResult {
|
||||
* The HTTP response headers by the server.
|
||||
*/
|
||||
headers: { [s: string]: any; };
|
||||
|
||||
}
|
||||
|
||||
export interface FileTransferError {
|
||||
@@ -103,6 +104,7 @@ export interface FileTransferError {
|
||||
* Either e.getMessage or e.toString.
|
||||
*/
|
||||
exception: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,6 +173,10 @@ export interface FileTransferError {
|
||||
* cd files
|
||||
* ls
|
||||
* ```
|
||||
* @interfaces
|
||||
* FileUploadOptions
|
||||
* FileUploadResult
|
||||
* FileTransferError
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FileTransfer',
|
||||
@@ -217,7 +223,7 @@ export class Transfer {
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> {
|
||||
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult | FileTransferError> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Flashlight
|
||||
* @description This plugin allows you to switch the flashlight / torch of the device on and off.
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var window: any;
|
||||
|
||||
/**
|
||||
* @name Geofence
|
||||
* @description Monitors circular geofences around latitude/longitude coordinates, and sends a notification to the user when the boundary of a geofence is crossed. Notifications can be sent when the user enters and/or exits a geofence.
|
||||
@@ -71,8 +74,6 @@ import { Observable } from 'rxjs/Observable';
|
||||
* Try running `ionic platform rm <platform>` then run `ionic platform add <platform>` to recreate the
|
||||
* platform directories.
|
||||
*/
|
||||
declare var window: any;
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'Geofence',
|
||||
plugin: 'cordova-plugin-geofence',
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
export interface Coordinates {
|
||||
|
||||
/**
|
||||
* a double representing the position's latitude in decimal degrees.
|
||||
*/
|
||||
@@ -48,6 +48,7 @@ export interface Coordinates {
|
||||
* This value can be null.
|
||||
*/
|
||||
speed: number;
|
||||
|
||||
}
|
||||
|
||||
export interface Geoposition {
|
||||
@@ -63,6 +64,7 @@ export interface Geoposition {
|
||||
}
|
||||
|
||||
export interface PositionError {
|
||||
|
||||
/**
|
||||
* A code that indicates the error that occurred
|
||||
*/
|
||||
@@ -72,9 +74,11 @@ export interface PositionError {
|
||||
* A message that can describe the error that occurred
|
||||
*/
|
||||
message: string;
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
@@ -102,8 +106,8 @@ export interface GeolocationOptions {
|
||||
* @type {boolean}
|
||||
*/
|
||||
enableHighAccuracy?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Geolocation
|
||||
@@ -145,6 +149,7 @@ export interface GeolocationOptions {
|
||||
repo: 'https://github.com/apache/cordova-plugin-geolocation'
|
||||
})
|
||||
export class Geolocation {
|
||||
|
||||
/**
|
||||
* Get the device's current position.
|
||||
*
|
||||
@@ -182,4 +187,5 @@ export class Geolocation {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Google Plus
|
||||
* @description
|
||||
@@ -21,34 +20,34 @@ import { Cordova, Plugin } from './plugin';
|
||||
})
|
||||
export class GooglePlus {
|
||||
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
/**
|
||||
* The login function walks the user through the Google Auth process.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
/**
|
||||
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trySilentLogin(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
/**
|
||||
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window;
|
||||
|
||||
/**
|
||||
@@ -20,6 +19,7 @@ declare var window;
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
export class GoogleAnalytics {
|
||||
|
||||
/**
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
@@ -187,4 +187,5 @@ export class GoogleAnalytics {
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,107 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface HotspotConnectionInfo {
|
||||
|
||||
/**
|
||||
* The service set identifier (SSID) of the current 802.11 network.
|
||||
*/
|
||||
SSID: string;
|
||||
|
||||
/**
|
||||
* The basic service set identifier (BSSID) of the current access point.
|
||||
*/
|
||||
BSSID: string;
|
||||
|
||||
/**
|
||||
* The current link speed in Mbps
|
||||
*/
|
||||
linkSpeed: string;
|
||||
|
||||
/**
|
||||
* The IP Address
|
||||
*/
|
||||
IPAddress: string;
|
||||
|
||||
/**
|
||||
* Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
|
||||
*/
|
||||
networkID: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HotspotNetwork {
|
||||
|
||||
/**
|
||||
* Human readable network name
|
||||
*/
|
||||
SSID: string;
|
||||
|
||||
/**
|
||||
* MAC Address of the access point
|
||||
*/
|
||||
BSSID: string;
|
||||
|
||||
/**
|
||||
* The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.
|
||||
*/
|
||||
frequency: number;
|
||||
|
||||
/**
|
||||
* The detected signal level in dBm, also known as the RSSI.
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* Timestamp in microseconds (since boot) when this result was last seen.
|
||||
*/
|
||||
timestamp: number;
|
||||
|
||||
/**
|
||||
* Describes the authentication, key management, and encryption schemes supported by the access point.
|
||||
*/
|
||||
capabilities: string;
|
||||
|
||||
}
|
||||
export interface HotspotNetworkConfig {
|
||||
|
||||
/**
|
||||
* Device IP Address
|
||||
*/
|
||||
deviceIPAddress: string;
|
||||
|
||||
/**
|
||||
* Device MAC Address
|
||||
*/
|
||||
deviceMacAddress: string;
|
||||
|
||||
/**
|
||||
* Gateway IP Address
|
||||
*/
|
||||
gatewayIPAddress: string;
|
||||
|
||||
/**
|
||||
* Gateway MAC Address
|
||||
*/
|
||||
gatewayMacAddress: string;
|
||||
|
||||
}
|
||||
|
||||
export interface HotspotDevice {
|
||||
|
||||
/**
|
||||
* ip
|
||||
* Hotspot IP Address
|
||||
*/
|
||||
ip: string;
|
||||
|
||||
/**
|
||||
* mac
|
||||
* Hotspot MAC Address
|
||||
*/
|
||||
mac: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Hotspot
|
||||
* @description
|
||||
@@ -13,6 +115,11 @@ import { Cordova, Plugin } from './plugin';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HotspotConnectionInfo
|
||||
* HotspotNetwork
|
||||
* HotspotNetworkConfig
|
||||
* HotspotDevice
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Hotspot',
|
||||
@@ -210,10 +317,10 @@ export class Hotspot {
|
||||
static getNetConfig(): Promise<HotspotNetworkConfig> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<ConnectionInfo>}
|
||||
* @returns {Promise<HotspotConnectionInfo>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> { return; }
|
||||
static getConnectionInfo(): Promise<HotspotConnectionInfo> { return; }
|
||||
|
||||
/**
|
||||
* @returns {Promise<string>}
|
||||
@@ -260,94 +367,3 @@ export class Hotspot {
|
||||
static isRooted(): Promise<boolean> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ConnectionInfo {
|
||||
/**
|
||||
* SSID
|
||||
* The service set identifier (SSID) of the current 802.11 network.
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* BSSID
|
||||
* The basic service set identifier (BSSID) of the current access point.
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* linkSpeed
|
||||
* The current link speed in Mbps
|
||||
*/
|
||||
linkSpeed: string;
|
||||
/**
|
||||
* IPAddress
|
||||
* The IP Address
|
||||
*/
|
||||
IPAddress: string;
|
||||
/**
|
||||
* networkID
|
||||
* Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
|
||||
*/
|
||||
networkID: string;
|
||||
}
|
||||
|
||||
export interface HotspotNetwork {
|
||||
/**
|
||||
* SSID
|
||||
* Human readable network name
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* BSSID
|
||||
* MAC Address of the access point
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* frequency
|
||||
* The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating with the access point.
|
||||
*/
|
||||
frequency: number;
|
||||
/**
|
||||
* level
|
||||
* The detected signal level in dBm, also known as the RSSI.
|
||||
*/
|
||||
level: number;
|
||||
/**
|
||||
* timestamp
|
||||
* Timestamp in microseconds (since boot) when this result was last seen.
|
||||
*/
|
||||
timestamp: number;
|
||||
/**
|
||||
* capabilities
|
||||
* Describes the authentication, key management, and encryption schemes supported by the access point.
|
||||
*/
|
||||
capabilities: string;
|
||||
}
|
||||
export interface HotspotNetworkConfig {
|
||||
/**
|
||||
* deviceIPAddress - Device IP Address
|
||||
*/
|
||||
deviceIPAddress: string;
|
||||
/**
|
||||
* deviceMacAddress - Device MAC Address
|
||||
*/
|
||||
deviceMacAddress: string;
|
||||
/**
|
||||
* gatewayIPAddress - Gateway IP Address
|
||||
*/
|
||||
gatewayIPAddress: string;
|
||||
/**
|
||||
* gatewayMacAddress - Gateway MAC Address
|
||||
*/
|
||||
gatewayMacAddress: string;
|
||||
}
|
||||
export interface HotspotDevice {
|
||||
/**
|
||||
* ip
|
||||
* Hotspot IP Address
|
||||
*/
|
||||
ip: string;
|
||||
/**
|
||||
* mac
|
||||
* Hotspot MAC Address
|
||||
*/
|
||||
mac: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The headers of the response
|
||||
*/
|
||||
headers: any;
|
||||
/**
|
||||
* Error response from the server. This property usually exists when a promise returned by a request method rejects.
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name HTTP
|
||||
* @description
|
||||
@@ -137,22 +157,3 @@ export class HTTP {
|
||||
@Cordova()
|
||||
static downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> { return; }
|
||||
}
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The data that is in the response. This property usually exists when a promise returned by a request method resolves.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The headers of the response
|
||||
*/
|
||||
headers: any;
|
||||
/**
|
||||
* Error response from the server. This property usually exists when a promise returned by a request method rejects.
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface HttpdOptions {
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Httpd
|
||||
@@ -21,6 +38,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* HttpdOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Httpd',
|
||||
@@ -40,7 +59,7 @@ export class Httpd {
|
||||
observable: true,
|
||||
clearFunction: 'stopServer'
|
||||
})
|
||||
static startServer(options?: any): Observable<string> { return; }
|
||||
static startServer(options?: HttpdOptions): Observable<string> { return; }
|
||||
|
||||
/**
|
||||
* Gets the URL of the running server
|
||||
@@ -58,23 +77,3 @@ export class Httpd {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* These options are used for the Httpd.startServer() function.
|
||||
*/
|
||||
export interface HttpdOptions {
|
||||
/**
|
||||
* The public root directory for your web server. This path is relative to your app's www directory.
|
||||
* Default is current directory.
|
||||
*/
|
||||
www_root?: string;
|
||||
/**
|
||||
* The port number to use.
|
||||
* Default is 8888
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Setting this option to false will allow remote access to your web server (over any IP).
|
||||
* Default is false.
|
||||
*/
|
||||
localhost_only?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var cordova: any;
|
||||
|
||||
export interface Beacon {
|
||||
@@ -103,7 +102,7 @@ export interface CircularRegion {
|
||||
|
||||
export type Region = BeaconRegion | CircularRegion;
|
||||
|
||||
export interface PluginResult {
|
||||
export interface IBeaconPluginResult {
|
||||
|
||||
/**
|
||||
* The name of the delegate function that produced the PluginResult object.
|
||||
@@ -136,7 +135,7 @@ export interface PluginResult {
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface Delegate {
|
||||
export interface IBeaconDelegate {
|
||||
/**
|
||||
* An observable that publishes information about the location permission authorization status.
|
||||
*
|
||||
@@ -151,9 +150,9 @@ export interface Delegate {
|
||||
* This event is called when the phone begins starts monitoring,
|
||||
* when requestStateForRegion is called, etc.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didDetermineStateForRegion(): Observable<PluginResult>;
|
||||
didDetermineStateForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
@@ -163,9 +162,9 @@ export interface Delegate {
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didEnterRegion(): Observable<PluginResult>;
|
||||
didEnterRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
@@ -175,51 +174,51 @@ export interface Delegate {
|
||||
* will be called even when the app is not running on iOS.
|
||||
* The app will run silently in the background for a small amount of time.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didExitRegion(): Observable<PluginResult>;
|
||||
didExitRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* each time that the device ranges beacons. Modern Android and iOS devices range
|
||||
* aproximately once per second.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didRangeBeaconsInRegion(): Observable<PluginResult>;
|
||||
didRangeBeaconsInRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins monitoring a region.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
didStartMonitoringForRegion(): Observable<PluginResult>;
|
||||
didStartMonitoringForRegion(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device fails to monitor a region.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
monitoringDidFailForRegionWithError(): Observable<PluginResult>;
|
||||
monitoringDidFailForRegionWithError(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the device begins advertising as an iBeacon.
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidStartAdvertising(): Observable<PluginResult>;
|
||||
peripheralManagerDidStartAdvertising(): Observable<IBeaconPluginResult>;
|
||||
|
||||
/**
|
||||
* An Observable that publishes event data to it's subscribers
|
||||
* when the state of the peripheral manager's state updates.
|
||||
*
|
||||
*
|
||||
* @returns {Observable<PluginResult>} Returns a PluginResult object with information about the event, region, and beacon(s).
|
||||
* @returns {Observable<IBeaconPluginResult>} Returns a IBeaconPluginResult object with information about the event, region, and beacon(s).
|
||||
*/
|
||||
peripheralManagerDidUpdateState(): Observable<PluginResult>;
|
||||
peripheralManagerDidUpdateState(): Observable<IBeaconPluginResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,7 +237,7 @@ export interface Delegate {
|
||||
* // Request permission to use location on iOS
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.Delegate();
|
||||
* let delegate = IBeacon.IBeaconDelegate();
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
@@ -266,6 +265,13 @@ export interface Delegate {
|
||||
* error => console.error('Native layer failed to begin monitoring: ', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* Beacon
|
||||
* BeaconRegion
|
||||
* CircularRegion
|
||||
* IBeaconPluginResult
|
||||
* IBeaconDelegate
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IBeacon',
|
||||
@@ -280,87 +286,87 @@ export class IBeacon {
|
||||
* Instances of this class are delegates between the {@link LocationManager} and
|
||||
* the code that consumes the messages generated on in the native layer.
|
||||
*
|
||||
* @returns {Delegate} An instance of the type {@type Delegate}.
|
||||
* @returns {IBeaconDelegate} An instance of the type {@type Delegate}.
|
||||
*/
|
||||
static Delegate(): Delegate {
|
||||
static Delegate(): IBeaconDelegate {
|
||||
let delegate = new cordova.plugins.locationManager.Delegate();
|
||||
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didChangeAuthorizationStatus = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didDetermineStateForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didEnterRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didEnterRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didExitRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didExitRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didRangeBeaconsInRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.didStartMonitoringForRegion = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.monitoringDidFailForRegionWithError = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidStartAdvertising = cb;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: PluginResult) => {
|
||||
return new Observable<PluginResult>(
|
||||
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
|
||||
return new Observable<IBeaconPluginResult>(
|
||||
(observer: any) => {
|
||||
let cb = (data: PluginResult) => observer.next(data);
|
||||
let cb = (data: IBeaconPluginResult) => observer.next(data);
|
||||
return delegate.peripheralManagerDidUpdateState = cb;
|
||||
}
|
||||
);
|
||||
@@ -387,33 +393,33 @@ export class IBeacon {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Delegate} Returns the Delegate
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
static getDelegate(): Delegate { return; }
|
||||
static getDelegate(): IBeaconDelegate { return; }
|
||||
|
||||
/**
|
||||
* @param {Delegate} delegate An instance of a delegate to register with the native layer.
|
||||
* @param {IBeaconDelegate} delegate An instance of a delegate to register with the native layer.
|
||||
*
|
||||
* @returns {Delegate} Returns the Delegate
|
||||
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
|
||||
*/
|
||||
@Cordova()
|
||||
static setDelegate(delegate: Delegate): Delegate { return; }
|
||||
static setDelegate(delegate: IBeaconDelegate): IBeaconDelegate { return; }
|
||||
|
||||
/**
|
||||
* Signals the native layer that the client side is ready to consume messages.
|
||||
* Readiness here means that it has a {Delegate} set by the consumer javascript
|
||||
* Readiness here means that it has a {IBeaconDelegate} set by the consumer javascript
|
||||
* code.
|
||||
*
|
||||
* The {LocationManager.setDelegate()} will implicitly call this method as well,
|
||||
* therefore the only case when you have to call this manually is if you don't
|
||||
* wish to specify a {Delegate} of yours.
|
||||
* wish to specify a {IBeaconDelegate} of yours.
|
||||
*
|
||||
* The purpose of this signaling mechanism is to make the events work when the
|
||||
* app is being woken up by the Operating System to give it a chance to handle
|
||||
* region monitoring events for example.
|
||||
*
|
||||
* If you don't set a {Delegate} and don't call this method manually, an error
|
||||
* If you don't set a {IBeaconDelegate} and don't call this method manually, an error
|
||||
* message get emitted in the native runtime and the DOM as well after a certain
|
||||
* period of time.
|
||||
*
|
||||
@@ -611,7 +617,7 @@ export class IBeacon {
|
||||
* this application, it will be replaced with the new identifier.
|
||||
*
|
||||
* This call will accept a valid beacon even when no BlueTooth is available,
|
||||
* and will start when BlueTooth is powered on. See {Delegate.}
|
||||
* and will start when BlueTooth is powered on. See {IBeaconDelegate.}
|
||||
*
|
||||
* @param {Region} region An instance of {Region} which will be advertised
|
||||
* by the operating system.
|
||||
|
||||
@@ -65,6 +65,8 @@ export interface ImageResizerOptions {
|
||||
* () => { console.log('Error occured'); }
|
||||
* )
|
||||
* ```
|
||||
* @interfaces
|
||||
* ImageResizerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ImageResizer',
|
||||
|
||||
@@ -29,6 +29,8 @@ export interface InAppBrowserEvent extends Event {
|
||||
* browser.insertCSS(...);
|
||||
* browser.close();
|
||||
* ```
|
||||
* @interfaces
|
||||
* InAppBrowserEvent
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'InAppBrowser',
|
||||
@@ -93,9 +95,6 @@ export class InAppBrowser {
|
||||
@CordovaInstance()
|
||||
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
* @param {string} name of the event
|
||||
@@ -107,4 +106,5 @@ export class InAppBrowser {
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface LaunchNavigatorOptions {
|
||||
|
||||
/**
|
||||
@@ -80,6 +79,8 @@ export interface LaunchNavigatorOptions {
|
||||
* error => console.log('Error launching navigator', error)
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* LaunchNavigatorOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LaunchNavigator',
|
||||
|
||||
@@ -1,5 +1,87 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface ILocalNotification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
* Default: 0
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* First row of the notification
|
||||
* Default: Empty string (iOS) or the app name (Android)
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Second row of the notification
|
||||
* Default: Empty string
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||
* Default: 0 (which means that the system triggers the local notification once)
|
||||
*/
|
||||
every?: string;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: any;
|
||||
firstAt?: any;
|
||||
|
||||
/**
|
||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||
* Default: 0 (which means don't show a number)
|
||||
*/
|
||||
badge?: number;
|
||||
|
||||
/**
|
||||
* Uri of the file containing the sound to play when an alert is displayed
|
||||
* Default: res://platform_default
|
||||
*/
|
||||
sound?: string;
|
||||
|
||||
/**
|
||||
* Arbitrary data, objects will be encoded to JSON string
|
||||
* Default: null
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the icon that is shown in the ticker and notification
|
||||
* Default: res://icon
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
||||
* Default: res://ic_popup_reminder
|
||||
*/
|
||||
smallIcon?: string;
|
||||
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Ongoing notifications differ from regular notifications in the following ways:
|
||||
* - They are sorted above the regular notifications in the notification panel
|
||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||
* Default: false
|
||||
*/
|
||||
ongoing?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* ARGB value that you would like the LED on the device to blink
|
||||
* Default: FFFFFF
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Local Notifications
|
||||
@@ -14,7 +96,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: 'Single Notification',
|
||||
* text: 'Single ILocalNotification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret: key }
|
||||
* });
|
||||
@@ -23,26 +105,27 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: 'Multi Notification 1',
|
||||
* text: 'Multi ILocalNotification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: 'Local Notification Example',
|
||||
* text: 'Multi Notification 2',
|
||||
* title: 'Local ILocalNotification Example',
|
||||
* text: 'Multi ILocalNotification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: 'Delayed Notification',
|
||||
* text: 'Delayed ILocalNotification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ILocalNotification
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LocalNotifications',
|
||||
@@ -54,21 +137,21 @@ export class LocalNotifications {
|
||||
|
||||
/**
|
||||
* Schedules a single or multiple notifications
|
||||
* @param options {Notification | Array<Notification>} optional
|
||||
* @param options {Notification | Array<ILocalNotification>} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static schedule(options?: Notification | Array<Notification>): void { }
|
||||
static schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
* @param options {Notification} optional
|
||||
* @param options {ILocalNotification} optional
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static update(options?: Notification): void { }
|
||||
static update(options?: ILocalNotification): void { }
|
||||
|
||||
/**
|
||||
* Clears single or multiple notifications
|
||||
@@ -154,47 +237,47 @@ export class LocalNotifications {
|
||||
/**
|
||||
* Get a notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static get(notificationId: any): Promise<Notification> { return; }
|
||||
static get(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a scheduled notification object
|
||||
* @param notificationId {any} The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getScheduled(notificationId: any): Promise<Notification> { return; }
|
||||
static getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get a triggered notification object
|
||||
* @param notificationId The id of the notification to get
|
||||
* @returns {Promise<Notification>}
|
||||
* @returns {Promise<ILocalNotification>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getTriggered(notificationId: any): Promise<Notification> { return; }
|
||||
static getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
|
||||
|
||||
/**
|
||||
* Get all notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAll(): Promise<Array<Notification>> { return; }
|
||||
static getAll(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all scheduled notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllScheduled(): Promise<Array<Notification>> { return; }
|
||||
static getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Get all triggered notification objects
|
||||
* @returns {Promise<Array<Notification>>}
|
||||
* @returns {Promise<Array<ILocalNotification>>}
|
||||
*/
|
||||
@Cordova()
|
||||
static getAllTriggered(): Promise<Array<Notification>> { return; }
|
||||
static getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||
|
||||
/**
|
||||
* Register permission to show notifications if not already granted.
|
||||
@@ -223,86 +306,3 @@ export class LocalNotifications {
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
|
||||
/**
|
||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||
* Default: 0
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* First row of the notification
|
||||
* Default: Empty string (iOS) or the app name (Android)
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Second row of the notification
|
||||
* Default: Empty string
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||
* Default: 0 (which means that the system triggers the local notification once)
|
||||
*/
|
||||
every?: string;
|
||||
|
||||
/**
|
||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||
* Default: now ~ new Date()
|
||||
*/
|
||||
at?: any;
|
||||
firstAt?: any;
|
||||
|
||||
/**
|
||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||
* Default: 0 (which means don't show a number)
|
||||
*/
|
||||
badge?: number;
|
||||
|
||||
/**
|
||||
* Uri of the file containing the sound to play when an alert is displayed
|
||||
* Default: res://platform_default
|
||||
*/
|
||||
sound?: string;
|
||||
|
||||
/**
|
||||
* Arbitrary data, objects will be encoded to JSON string
|
||||
* Default: null
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the icon that is shown in the ticker and notification
|
||||
* Default: res://icon
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
||||
* Default: res://ic_popup_reminder
|
||||
*/
|
||||
smallIcon?: string;
|
||||
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* Ongoing notifications differ from regular notifications in the following ways:
|
||||
* - They are sorted above the regular notifications in the notification panel
|
||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||
* Default: false
|
||||
*/
|
||||
ongoing?: boolean;
|
||||
|
||||
/**
|
||||
* ANDROID ONLY
|
||||
* ARGB value that you would like the LED on the device to blink
|
||||
* Default: FFFFFF
|
||||
*/
|
||||
led?: string;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,119 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
declare var navigator: any;
|
||||
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The full path of the file, including the name.
|
||||
*/
|
||||
fullPath: string;
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
lastModifiedDate: Date;
|
||||
/**
|
||||
* The size of the file, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Retrieves the format information of the media file.
|
||||
* @param {Function} successCallback
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
||||
}
|
||||
|
||||
export interface MediaFileData {
|
||||
/**
|
||||
* The actual format of the audio and video content.
|
||||
*/
|
||||
codecs: string;
|
||||
/**
|
||||
* The average bitrate of the content. The value is zero for images.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The length of the video or sound clip in seconds. The value is zero for images.
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
|
||||
export interface CaptureError {
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface CaptureAudioOptions {
|
||||
/**
|
||||
* Maximum number of audio clips. Defaults to 1.
|
||||
* On iOS you can only record one file.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export interface CaptureImageOptions {
|
||||
/**
|
||||
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface CaptureVideoOptions {
|
||||
/**
|
||||
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration per video clip. This will be ignored on BlackBerry.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Quality of the video. This parameter can only be used with Android.
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
export interface ConfigurationData {
|
||||
/**
|
||||
* The ASCII-encoded lowercase string representing the media type.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture } from 'ionic-native';
|
||||
* import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
@@ -20,6 +124,14 @@ declare var navigator: any;
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MediaFile
|
||||
* MediaFileData
|
||||
* CaptureError
|
||||
* CaptureAudioOptions
|
||||
* CaptureImageOptions
|
||||
* CaptureVideoOptions
|
||||
* ConfigurationData
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MediaCapture',
|
||||
@@ -52,7 +164,7 @@ export class MediaCapture {
|
||||
/**
|
||||
* Start the audio recorder application and return information about captured audio clip files.
|
||||
* @param options
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
* @returns {Promise<MediaFile[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
@@ -100,122 +212,3 @@ export class MediaCapture {
|
||||
static onPendingCaptureError(): Observable<CaptureError> { return; }
|
||||
|
||||
}
|
||||
/**
|
||||
* Encapsulates properties of a media capture file.
|
||||
*/
|
||||
export interface MediaFile {
|
||||
/**
|
||||
* The name of the file, without path information.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The full path of the file, including the name.
|
||||
*/
|
||||
fullPath: string;
|
||||
/**
|
||||
* The file's mime type
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The date and time when the file was last modified.
|
||||
*/
|
||||
lastModifiedDate: Date;
|
||||
/**
|
||||
* The size of the file, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Retrieves the format information of the media file.
|
||||
* @param {Function} successCallback
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
||||
}
|
||||
/**
|
||||
* Encapsulates format information about a media file.
|
||||
*/
|
||||
export interface MediaFileData {
|
||||
/**
|
||||
* The actual format of the audio and video content.
|
||||
*/
|
||||
codecs: string;
|
||||
/**
|
||||
* The average bitrate of the content. The value is zero for images.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for audio clips.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The length of the video or sound clip in seconds. The value is zero for images.
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates the error code resulting from a failed media capture operation.
|
||||
*/
|
||||
export interface CaptureError {
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Encapsulates audio capture configuration options.
|
||||
*/
|
||||
export interface CaptureAudioOptions {
|
||||
/**
|
||||
* Maximum number of audio clips. Defaults to 1.
|
||||
* On iOS you can only record one file.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates image capture configuration options.
|
||||
*/
|
||||
export interface CaptureImageOptions {
|
||||
/**
|
||||
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates video capture configuration options.
|
||||
*/
|
||||
export interface CaptureVideoOptions {
|
||||
/**
|
||||
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Maximum duration per video clip. This will be ignored on BlackBerry.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Quality of the video. This parameter can only be used with Android.
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
/**
|
||||
* Encapsulates a set of media capture parameters that a device supports.
|
||||
*/
|
||||
export interface ConfigurationData {
|
||||
/**
|
||||
* The ASCII-encoded lowercase string representing the media type.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The height of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* The width of the image or video in pixels. The value is zero for sound clips.
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasClose: boolean;
|
||||
ticker: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name MusicControls
|
||||
* @description
|
||||
@@ -71,6 +84,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* MusicControlsOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'MusicControls',
|
||||
@@ -79,6 +94,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
repo: 'https://github.com/homerours/cordova-music-controls-plugin'
|
||||
})
|
||||
export class MusicControls {
|
||||
|
||||
/**
|
||||
* Create the media controls
|
||||
* @param options {MusicControlsOptions}
|
||||
@@ -115,15 +131,5 @@ export class MusicControls {
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static updateIsPlaying(isPlaying: boolean): void {}
|
||||
}
|
||||
export interface MusicControlsOptions {
|
||||
track: string;
|
||||
artist: string;
|
||||
cover: string;
|
||||
isPlaying: boolean;
|
||||
dismissable: boolean;
|
||||
hasPrev: boolean;
|
||||
hasNext: boolean;
|
||||
hasClose: boolean;
|
||||
ticker: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface NativeTransitionOptions {
|
||||
direction?: string;
|
||||
duration?: number;
|
||||
slowdownfactor?: number;
|
||||
slidePixels?: number;
|
||||
iosdelay?: number;
|
||||
androiddelay?: number;
|
||||
winphonedelay?: number;
|
||||
fixedPixelsTop?: number;
|
||||
fixedPixelsBottom?: number;
|
||||
action?: string;
|
||||
origin?: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name NativePageTransitions
|
||||
* @description
|
||||
@@ -6,9 +22,9 @@ import { Plugin, Cordova } from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {NativePageTransitions, TransitionOptions} from 'ionic-native';
|
||||
* import {NativePageTransitions, NativeTransitionOptions} from 'ionic-native';
|
||||
*
|
||||
* let options: TransitionOptions = {
|
||||
* let options: NativeTransitionOptions = {
|
||||
* direction: 'up',
|
||||
* duration: 500,
|
||||
* slowdownfactor: 3,
|
||||
@@ -36,60 +52,46 @@ import { Plugin, Cordova } from './plugin';
|
||||
export class NativePageTransitions {
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static slide(options: TransitionOptions): Promise<any> { return; }
|
||||
static slide(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Perform a flip animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static flip(options: TransitionOptions): Promise<any> { return; }
|
||||
static flip(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Perform a fade animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS', 'Android']})
|
||||
static fade(options: TransitionOptions): Promise<any> { return; }
|
||||
static fade(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS', 'Android']})
|
||||
static drawer(options: TransitionOptions): Promise<any> { return; }
|
||||
static drawer(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Perform a slide animation
|
||||
* @param options {TransitionOptions} Options for the transition
|
||||
* @param options {NativeTransitionOptions} Options for the transition
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({platforms: ['iOS']})
|
||||
static curl(options: TransitionOptions): Promise<any> { return; }
|
||||
static curl(options: NativeTransitionOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface TransitionOptions {
|
||||
direction?: string;
|
||||
duration?: number;
|
||||
slowdownfactor?: number;
|
||||
slidePixels?: number;
|
||||
iosdelay?: number;
|
||||
androiddelay?: number;
|
||||
winphonedelay?: number;
|
||||
fixedPixelsTop?: number;
|
||||
fixedPixelsBottom?: number;
|
||||
action?: string;
|
||||
origin?: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, CordovaProperty, Plugin } from './plugin';
|
||||
import {Cordova, CordovaProperty, Plugin, CordovaFunctionOverride} from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ declare var navigator: any;
|
||||
*
// before we determine the connection type. Might need to wait
|
||||
* // prior to doing any api requests as well.
|
||||
* setTimeout(() => {
|
||||
* if (Network.connection === 'wifi') {
|
||||
* if (Network.type === 'wifi') {
|
||||
* console.log('we got a wifi connection, woohoo!');
|
||||
* }
|
||||
* }, 3000);
|
||||
@@ -52,10 +52,32 @@ declare var navigator: any;
|
||||
export class Network {
|
||||
|
||||
/**
|
||||
* Return the network connection type
|
||||
* Connection type
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static connection: string;
|
||||
static type: string;
|
||||
|
||||
/**
|
||||
* Downlink Max Speed
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
static downlinkMax: string;
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onchange(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection type changes
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static ontypechange(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Get notified when the device goes offline
|
||||
|
||||
@@ -1,6 +1,69 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface OneSignalNotification {
|
||||
app_id: string;
|
||||
contents: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
isAndroid?: boolean;
|
||||
isWP?: boolean;
|
||||
isWP_WNS?: boolean;
|
||||
isAdm?: boolean;
|
||||
isChrome?: boolean;
|
||||
isChromeWeb?: boolean;
|
||||
isSafari?: boolean;
|
||||
isAnyWeb?: boolean;
|
||||
included_segments?: string[];
|
||||
excluded_segments?: string[];
|
||||
include_player_ids?: string[];
|
||||
include_ios_tokens?: string[];
|
||||
include_android_reg_ids?: string[];
|
||||
include_wp_uris?: string[];
|
||||
include_wp_wns_uris?: string[];
|
||||
include_amazon_reg_ids?: string[];
|
||||
include_chrome_reg_ids?: string[];
|
||||
include_chrome_web_reg_ids?: string[];
|
||||
app_ids?: string[];
|
||||
tags?: any[];
|
||||
ios_badgeType?: string;
|
||||
ios_badgeCount?: number;
|
||||
ios_sound?: string;
|
||||
android_sound?: string;
|
||||
adm_sound?: string;
|
||||
wp_sound?: string;
|
||||
wp_wns_sound?: string;
|
||||
data?: any;
|
||||
buttons?: any;
|
||||
small_icon?: string;
|
||||
large_icon?: string;
|
||||
big_picture?: string;
|
||||
adm_small_icon?: string;
|
||||
adm_large_icon?: string;
|
||||
adm_big_picture?: string;
|
||||
chrome_icon?: string;
|
||||
chrome_big_picture?: string;
|
||||
chrome_web_icon?: string;
|
||||
firefox_icon?: string;
|
||||
url?: string;
|
||||
send_after?: string;
|
||||
delayed_option?: string;
|
||||
delivery_time_of_day?: string;
|
||||
android_led_color?: string;
|
||||
android_accent_color?: string;
|
||||
android_visibility?: number;
|
||||
content_available?: boolean;
|
||||
amazon_background_data?: boolean;
|
||||
template_id?: string;
|
||||
android_group?: string;
|
||||
android_group_message?: any;
|
||||
adm_group?: string;
|
||||
adm_group_message?: any;
|
||||
ttl?: number;
|
||||
priority?: number;
|
||||
ios_category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
@@ -27,7 +90,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* OneSignal.endInit();
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* OneSignalNotification
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OneSignal',
|
||||
@@ -230,66 +294,3 @@ export class OneSignal {
|
||||
}): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface OneSignalNotification {
|
||||
app_id: string;
|
||||
contents: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
isAndroid?: boolean;
|
||||
isWP?: boolean;
|
||||
isWP_WNS?: boolean;
|
||||
isAdm?: boolean;
|
||||
isChrome?: boolean;
|
||||
isChromeWeb?: boolean;
|
||||
isSafari?: boolean;
|
||||
isAnyWeb?: boolean;
|
||||
included_segments?: string[];
|
||||
excluded_segments?: string[];
|
||||
include_player_ids?: string[];
|
||||
include_ios_tokens?: string[];
|
||||
include_android_reg_ids?: string[];
|
||||
include_wp_uris?: string[];
|
||||
include_wp_wns_uris?: string[];
|
||||
include_amazon_reg_ids?: string[];
|
||||
include_chrome_reg_ids?: string[];
|
||||
include_chrome_web_reg_ids?: string[];
|
||||
app_ids?: string[];
|
||||
tags?: any[];
|
||||
ios_badgeType?: string;
|
||||
ios_badgeCount?: number;
|
||||
ios_sound?: string;
|
||||
android_sound?: string;
|
||||
adm_sound?: string;
|
||||
wp_sound?: string;
|
||||
wp_wns_sound?: string;
|
||||
data?: any;
|
||||
buttons?: any;
|
||||
small_icon?: string;
|
||||
large_icon?: string;
|
||||
big_picture?: string;
|
||||
adm_small_icon?: string;
|
||||
adm_large_icon?: string;
|
||||
adm_big_picture?: string;
|
||||
chrome_icon?: string;
|
||||
chrome_big_picture?: string;
|
||||
chrome_web_icon?: string;
|
||||
firefox_icon?: string;
|
||||
url?: string;
|
||||
send_after?: string;
|
||||
delayed_option?: string;
|
||||
delivery_time_of_day?: string;
|
||||
android_led_color?: string;
|
||||
android_accent_color?: string;
|
||||
android_visibility?: number;
|
||||
content_available?: boolean;
|
||||
amazon_background_data?: boolean;
|
||||
template_id?: string;
|
||||
android_group?: string;
|
||||
android_group_message?: any;
|
||||
adm_group?: string;
|
||||
adm_group_message?: any;
|
||||
ttl?: number;
|
||||
priority?: number;
|
||||
ios_category?: string;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
|
||||
try {
|
||||
if (opts.clearFunction) {
|
||||
if (opts.clearWithArgs) {
|
||||
return get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, args);
|
||||
return callCordovaPlugin(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
}
|
||||
return get(window, pluginObj.pluginRef)[opts.clearFunction].call(pluginObj, pluginResult);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ export interface PrintOptions {
|
||||
*
|
||||
* Printer.print(content, options).then(onSuccess, onError);
|
||||
* ```
|
||||
* @interfaces
|
||||
* PrintOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Printer',
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface SafariViewControllerOptions {
|
||||
url?: string;
|
||||
hidden?: boolean;
|
||||
toolbarColor?: string;
|
||||
animated?: boolean;
|
||||
showDefaultShareMenuItem?: boolean;
|
||||
enterReaderModeIfAvailable?: boolean;
|
||||
tintColor?: string;
|
||||
transition?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name SafariViewController
|
||||
@@ -37,6 +47,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
* @interfaces
|
||||
* SafariViewControllerOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SafariViewController',
|
||||
@@ -91,14 +103,3 @@ export class SafariViewController {
|
||||
static mayLaunchUrl(url: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface SafariViewControllerOptions {
|
||||
url?: string;
|
||||
hidden?: boolean;
|
||||
toolbarColor?: string;
|
||||
animated?: boolean;
|
||||
showDefaultShareMenuItem?: boolean;
|
||||
enterReaderModeIfAvailable?: boolean;
|
||||
tintColor?: string;
|
||||
transition?: string;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@ export interface SmsOptionsAndroid {
|
||||
* // Send a text message using default options
|
||||
* SMS.send('416123456', 'Hello world!');
|
||||
* ```
|
||||
* @interfaces
|
||||
* SmsOptions
|
||||
* SmsOptionsAndroid
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SMS',
|
||||
@@ -55,7 +58,10 @@ export class SMS {
|
||||
* @param options {SmsOptions} Options
|
||||
* @returns {Promise<any>} Resolves promise when the SMS has been sent
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 3,
|
||||
errorIndex: 4
|
||||
})
|
||||
static send(
|
||||
phoneNumber: string | string[],
|
||||
message: string,
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
export interface SpinnerDialogIOSOptions {
|
||||
overlayOpacity?: number;
|
||||
textColorRed?: number;
|
||||
textColorGreen?: number;
|
||||
textColorBlue?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Spinner Dialog
|
||||
@@ -13,6 +19,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* SpinnerDialog.hide();
|
||||
* ```
|
||||
* @interfaces
|
||||
* SpinnerDialogIOSOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SpinnerDialog',
|
||||
@@ -44,10 +52,3 @@ export class SpinnerDialog {
|
||||
static hide(): void {}
|
||||
|
||||
}
|
||||
|
||||
export interface SpinnerDialogIOSOptions {
|
||||
overlayOpacity?: number;
|
||||
textColorRed?: number;
|
||||
textColorGreen?: number;
|
||||
textColorBlue?: number;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ declare var sqlitePlugin;
|
||||
* })
|
||||
* .then((db: SQLite) => {
|
||||
*
|
||||
* db.executeSQL('create table danceMoves(name VARCHAR(32))').then(() => {}).catch(() => {});
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))').then(() => {}).catch(() => {});
|
||||
*
|
||||
* })
|
||||
* .catch(error => console.error('Error openening database', error);
|
||||
* .catch(error => console.error('Error opening database', error);
|
||||
*
|
||||
*
|
||||
* // OPTION B: Create a new instance of SQLite
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface StreamingVideoOptions {
|
||||
successCallback?: Function;
|
||||
errorCallback?: Function;
|
||||
orientation?: string;
|
||||
}
|
||||
|
||||
export interface StreamingAudioOptions {
|
||||
bgColor?: string;
|
||||
bgImage?: string;
|
||||
bgImageScale?: string;
|
||||
initFullscreen?: boolean;
|
||||
successCallback?: Function;
|
||||
errorCallback?: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name StreamingMedia
|
||||
* @description
|
||||
@@ -17,6 +33,9 @@ import { Plugin, Cordova } from './plugin';
|
||||
* StreamingMedia.('https://path/to/video/stream', options);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* StreamingVideoOptions
|
||||
* StreamingAudioOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'StreamingMedia',
|
||||
@@ -61,18 +80,3 @@ export class StreamingMedia {
|
||||
static resumeAudio(): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface StreamingVideoOptions {
|
||||
successCallback?: Function;
|
||||
errorCallback?: Function;
|
||||
orientation?: string;
|
||||
}
|
||||
|
||||
export interface StreamingAudioOptions {
|
||||
bgColor?: string;
|
||||
bgImage?: string;
|
||||
bgImageScale?: string;
|
||||
initFullscreen?: boolean;
|
||||
successCallback?: Function;
|
||||
errorCallback?: Function;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ export interface TTSOptions {
|
||||
* .catch((reason: any) => console.log(reason));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* TTSOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'TextToSpeech',
|
||||
|
||||
@@ -142,6 +142,9 @@ export interface ThemeableBrowserOptions {
|
||||
*
|
||||
* ```
|
||||
* We suggest that you refer to the plugin's repository for additional information on usage that may not be covered here.
|
||||
* @interfaces
|
||||
* ThemeableBrowserButton
|
||||
* ThemeableBrowserOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ThemeableBrowser',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface ToastOptions {
|
||||
/**
|
||||
* Message to display
|
||||
@@ -35,6 +34,7 @@ export interface ToastOptions {
|
||||
verticalPadding?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Toast
|
||||
* @description
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
export interface TwitterConnectResponse {
|
||||
/**
|
||||
* Twitter Username
|
||||
*/
|
||||
userName: string;
|
||||
/**
|
||||
* Twitter User ID
|
||||
*/
|
||||
userId: string;
|
||||
/**
|
||||
* Twitter OAuth Secret
|
||||
*/
|
||||
secret: string;
|
||||
/**
|
||||
* Twitter OAuth Token
|
||||
*/
|
||||
token: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Twitter Connect
|
||||
@@ -25,6 +43,8 @@ import { Plugin, Cordova } from './plugin';
|
||||
*
|
||||
* TwitterConnect.logout().then(onLogoutSuccess, onLogoutError);
|
||||
* ```
|
||||
* @interfaces
|
||||
* TwitterConnectResponse
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'TwitterConnect',
|
||||
@@ -54,21 +74,4 @@ export class TwitterConnect {
|
||||
@Cordova()
|
||||
static showUser(): Promise<any> {return; }
|
||||
}
|
||||
export interface TwitterConnectResponse {
|
||||
/**
|
||||
* Twitter Username
|
||||
*/
|
||||
userName: string;
|
||||
/**
|
||||
* Twitter User ID
|
||||
*/
|
||||
userId: string;
|
||||
/**
|
||||
* Twitter OAuth Secret
|
||||
*/
|
||||
secret: string;
|
||||
/**
|
||||
* Twitter OAuth Token
|
||||
*/
|
||||
token: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,12 @@ export interface VideoInfo {
|
||||
* .catch((error: any) => console.log('video transcode error', error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* TranscodeOptions
|
||||
* TrimOptions
|
||||
* CreateThumbnailOptions
|
||||
* GetVideoInfoOptions
|
||||
* VideoInfo
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'VideoEditor',
|
||||
|
||||
@@ -36,6 +36,8 @@ export interface VideoOptions {
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* VideoOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'VideoPlayer',
|
||||
|
||||
@@ -1,62 +1,5 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name ZBar
|
||||
* @description
|
||||
* The ZBar Scanner Plugin allows you to scan 2d barcodes.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { ZBar } from 'ionic-native';
|
||||
*
|
||||
* let zBarOptions = {
|
||||
* flash: "off",
|
||||
* drawSight: false
|
||||
* };
|
||||
*
|
||||
* ZBar.scan(zBarOptions)
|
||||
* .then(result => {
|
||||
* console.log(result); // Scanned code
|
||||
* })
|
||||
* .catch(error => {
|
||||
* console.log(error); // Error message
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* zBar options
|
||||
*
|
||||
* | Option | Type | Values | Defaults |
|
||||
* |--------------------|-----------|-----------------------------------------------------------------------------------------|
|
||||
* | text_title |`string?` | | `"Scan QR Code"` (Android only) |
|
||||
* | text_instructions |`string?` | | `"Please point your camera at the QR code."` (Android only) |
|
||||
* | camera |`string?` | `"front"`, `"back"`, | `"back"` |
|
||||
* | flash |`string?` | `"on"`, `"off"`, `"auto"` | `"auto"` |
|
||||
* | drawSight |`boolean?` | `true`, `false` | `true` (Draws red line in center of scanner) |
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ZBar',
|
||||
plugin: 'cordova-plugin-cszbar',
|
||||
pluginRef: 'cloudSky.zBar',
|
||||
repo: 'https://github.com/tjwoon/csZBar',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class ZBar {
|
||||
|
||||
/**
|
||||
* Open the scanner
|
||||
* @param options { ZBarOptions } Scan options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the scanned string, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options: ZBarOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ZBarOptions {
|
||||
/**
|
||||
* A string representing the title text (Android only).
|
||||
@@ -90,3 +33,51 @@ export interface ZBarOptions {
|
||||
*/
|
||||
drawSight?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name ZBar
|
||||
* @description
|
||||
* The ZBar Scanner Plugin allows you to scan 2d barcodes.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { ZBar } from 'ionic-native';
|
||||
*
|
||||
* let zBarOptions = {
|
||||
* flash: "off",
|
||||
* drawSight: false
|
||||
* };
|
||||
*
|
||||
* ZBar.scan(zBarOptions)
|
||||
* .then(result => {
|
||||
* console.log(result); // Scanned code
|
||||
* })
|
||||
* .catch(error => {
|
||||
* console.log(error); // Error message
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* ZBarOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ZBar',
|
||||
plugin: 'cordova-plugin-cszbar',
|
||||
pluginRef: 'cloudSky.zBar',
|
||||
repo: 'https://github.com/tjwoon/csZBar',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class ZBar {
|
||||
|
||||
/**
|
||||
* Open the scanner
|
||||
* @param options { ZBarOptions } Scan options
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the scanned string, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options: ZBarOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user