Compare commits

...

88 Commits

Author SHA1 Message Date
Ibby
9974a1fbd8 chore(): update changelog 2017-01-07 08:04:21 -05:00
Ibby
67edb835f2 2.2.14 2017-01-07 08:03:34 -05:00
Jonathan Samines
5b6cb6e19f docs(device): fix reference (#930) 2017-01-07 08:00:56 -05:00
Ibby
9a5a62bc3a chore(): tslint 2017-01-07 07:59:06 -05:00
Ibby
d192dee1ee docs(google-plus): add basic docs 2017-01-07 07:43:27 -05:00
Ibby
0d6997cbdd fix(push): fix typing for additionalData
closes #868
2017-01-07 06:42:38 -05:00
Ibby
49325e8b93 Merge branch 'master' of github.com:driftyco/ionic-native 2017-01-07 05:44:45 -05:00
Ibby
de07df6f20 fix(inappbrowser): fix insertCSS method name
closes #921
2017-01-07 05:44:38 -05:00
Vlado Velichkovski
ca60c5b912 fix(nfc): add missing param for addMimeTypeListener (#937)
Add missing  `mimeType` parameter in `addMimeTypeListener` function
2017-01-07 05:29:08 -05:00
Ibby
54d1a9891b chore(): add try/catch for callCordovaPlugin method
closes #882
2017-01-07 05:26:38 -05:00
Ibby
2c57bc965c docs(globalization): add platforms information
closes #935
2017-01-07 04:47:15 -05:00
Ibby
d62779a2a6 feat(market): add search method, return promises 2017-01-07 04:38:37 -05:00
Ibby
009a20608e docs(ibeacon): fix method reference
closes #933
2017-01-07 04:32:18 -05:00
Ibby
ca14bf6a75 fix(google-plus): fixes login without options
closes #932
2017-01-07 04:27:58 -05:00
Ibby
49fe24dee2 fix(google-analytics): fix startTrackerWithId when interval is not provided 2017-01-01 06:30:33 -05:00
Ibby
d9d89341d2 docs(onesignal): fix docs 2017-01-01 04:11:51 -05:00
Guille
bbf75bcbd7 fix(mixpanel): fix issue when not passing eventProperties (#927) 2016-12-30 06:32:53 -05:00
Megan Kearl
9441928884 style(): fix whitespace lint issue (#923) 2016-12-30 00:47:51 -05:00
Watchara S
8eb656cce8 feat(background-geolocation): add altitudeAccuracy into response typings (#922) 2016-12-29 04:39:16 -05:00
Alexey Vasiliev
bf0486cb8b Fix doc about changed property (#919) 2016-12-27 16:44:03 -05:00
Ibby
e681761f56 chore(): update changelog 2016-12-27 08:43:56 -05:00
Ibby
84ec3fa8d2 2.2.13 2016-12-27 08:43:12 -05:00
Ibby
c618ceb693 chore(): tslint 2016-12-27 08:43:06 -05:00
Ibby
46a9b6d50d docs(google-analytics): add usage
closes #883
2016-12-27 08:07:45 -05:00
Ibby
44fe04bbbd docs(): add interfaces 2016-12-27 08:03:21 -05:00
Job
3385c1b6dc fix(diagnostic): add permissionStatus types (#890) 2016-12-27 07:58:28 -05:00
Matthew Wheatley
a1b0f885a7 feat(android-fingerprint-auth): update to v1.2.1 (#910)
* update to use plugin v1.1.0

Updated example
Added new configuration options.
Added new show() result fields
Added new delete method

* Update to plugin v1.2.0

Removed show()
Added encrypt()
Added decrypt()
Removed requirement of username

* edit comments

* edited comments
2016-12-27 07:57:54 -05:00
Louis Orleans
56e8eaeb5d feat(onesignal): improve typings (#888)
* Adding platforms list to decorator

* feat(onesignal): Adding more complete type defs

* refactor(onesignal): Prefixing interfaces / enums with `OS`
2016-12-27 07:55:29 -05:00
Ibby
ba77fd70c3 fix(background-mode): isEnabled and isActive return booleans
fixes #908
2016-12-27 07:37:03 -05:00
Ibby
1841220359 fix(diagnostic): add missing types
closes #905
2016-12-27 07:28:34 -05:00
Vlado Velichkovski
c44fb75adc feat(nfc): add new functions (#853)
Added:
- bytesToHexString
- stringToBytes
- bytesToString

Fixed:
- addTagDiscoveredListener
2016-12-27 07:23:05 -05:00
Ibby
ad6badef1f docs(): add platform info 2016-12-27 07:17:27 -05:00
Ibby
7bcf1bfc74 Merge branch 'master' of github.com:driftyco/ionic-native 2016-12-27 07:17:01 -05:00
Peter Bakondy
0c36988544 feat(sim): add new methods (#894) 2016-12-27 07:16:48 -05:00
Ibby
71e49da8ad docs(media): add instructions to listen to status change 2016-12-27 07:06:41 -05:00
Alex Muramoto
c28df732d5 Merge pull request #907 from amuramoto/admob-patch
fix(admob): add adId prop to AdMobOptions
2016-12-22 10:16:40 -08:00
Alex Muramoto
d5dfdf83f3 fix(admob): add adId prop to AdMobOptions 2016-12-22 10:15:49 -08:00
Ibrahim Hadeed
e42f4d0079 Update network.ts 2016-12-17 20:52:19 -05:00
Matt Hill
cabe327e9b Update contacts.ts (#885) 2016-12-17 20:48:22 -05:00
Ionitron
98d22a3079 chore(ci): updating CI scripts 2016-12-16 14:59:11 -06:00
Ibby
3fffab6d6c chore(): update changelog 2016-12-16 14:15:09 -05:00
Ibby
60defd3e50 2.2.12 2016-12-16 14:14:53 -05:00
Ibby
c79ffc4434 Merge branch 'master' of github.com:driftyco/ionic-native 2016-12-16 14:13:11 -05:00
Ibby
ec5e27be4b fix(network): update API 2016-12-16 14:12:58 -05:00
perry
cf347cd369 chore(ci): test 2016-12-16 12:28:27 -06:00
Ibby
28f316e408 docs(contacts): remove old docs
closes #865
2016-12-15 08:07:26 -05:00
Ibby
9986e0d0b3 fix(diagnostic): permissionStatus gets values from plugin in runtime
fixes #872
2016-12-15 07:56:23 -05:00
Ibby
8b809de568 docs(contacts): improve docs
closes #873
2016-12-15 07:49:28 -05:00
Ibby
fa1f718412 chore(): fix clearWithArgs 2016-12-15 07:47:34 -05:00
Ibrahim Hadeed
3fabc4d72c chore(): clearWithArgs adds callbacks now 2016-12-15 07:42:15 -05:00
Juan G. Jordán
3a11d290e5 docs(deeplinks): improve docs (#880)
The routeWithNavController method returns an observable, thus it has to be subscribed to, to get it working.

Change the documentation of the method to show that we need to subscribe to the observable, just like when using the route method.
2016-12-15 02:07:26 -05:00
yuhj86
700fb47b73 docs(media-capture): improve docs (#878)
import types
2016-12-15 02:01:38 -05:00
HartHerbert
61dc8aa18e fix(camera-preview): parameter size is optional (#871)
Just added the '?' to the parameter (size) in the static takePicture(size?: CameraPreviewSize): void { } because the size is a optional parameter
2016-12-13 20:49:46 -05:00
Musa Haidari
c3f92e92c2 Update sqlite.ts (#862)
`db.executeSql()` was documented as `db.executeSQL()` that caused error:

    main.js:13 Error openening database TypeError: t.executeSQL is not a function
        at file:///android_asset/www/build/main.js:13:11718
        at t.invoke (file:///android_asset/www/build/polyfills.js:3:13422)
        at Object.onInvoke (file:///android_asset/www/build/main.js:3:3341)
        at t.invoke (file:///android_asset/www/build/polyfills.js:3:13373)
        at e.run (file:///android_asset/www/build/polyfills.js:3:10809)
        at file:///android_asset/www/build/polyfills.js:3:8911
        at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:14051)
        at Object.onInvokeTask (file:///android_asset/www/build/main.js:3:3241)
        at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:13987)
        at e.runTask (file:///android_asset/www/build/polyfills.js:3:11411)

The issue is fixed in this commit
2016-12-12 16:43:51 -05:00
Musa Haidari
54d2c46742 Update sqlite.ts (#863)
Fixed a typo
2016-12-12 16:42:29 -05:00
Ibrahim Hadeed
114a74d3ba fix(sms): fix callback index when omitting options param
closes #858
2016-12-10 20:05:24 -05:00
perry
b2d29dbde5 chore(CI): updating CI scripts for new ionic-site structure 2016-12-08 15:15:46 -06:00
perry
36bfe38a4c chore(CI): updating CI scripts for new ionic-site structure 2016-12-08 15:12:33 -06:00
Ibby
d4e2c10006 chore(): tslint 2016-12-06 09:53:46 -05:00
Ibby
ae6a3cda7a docs(): update docs 2016-12-06 09:52:39 -05:00
Ibby
d5ac89996f docs(): update docs 2016-12-06 09:20:49 -05:00
Ibby
a4216fd8ca docs(): update docs 2016-12-06 09:18:37 -05:00
Ibby
a38adf53c3 docs(): update docs 2016-12-06 09:18:03 -05:00
Ibby
bd7ebaee3b docs(): update docs 2016-12-06 09:17:35 -05:00
Ibby
d92fb1da8b docs(): update docs 2016-12-06 09:15:03 -05:00
Ibby
acb7cd862d docs(): update docs 2016-12-06 09:14:28 -05:00
Ibby
1976c38dc7 docs(): display interfaces 2016-12-06 09:11:09 -05:00
Ibby
e522a25968 docs(estimote-beacons): display interfaces 2016-12-06 09:09:31 -05:00
Ibby
ad84e758be refractor(email-composer): refractor interfaces to avoid duplicates 2016-12-06 09:09:00 -05:00
Ibby
427527a129 refractor(dialogs): refractor interfaces to avoid duplicates 2016-12-06 09:08:02 -05:00
Ibby
3ba72e9f15 refractor(device-orientation): refractor interfaces to avoid duplicates 2016-12-06 09:06:58 -05:00
Ibby
a693740f1a refractor(device-motion): refractor interfaces to avoid duplicates 2016-12-06 09:06:13 -05:00
Ibby
2a98be594a docs(deeplinks): display interfaces 2016-12-06 09:04:57 -05:00
Ibby
0787f69884 docs(card-io): document interfaces 2016-12-06 09:03:39 -05:00
Ibby
dadaf5831e docs(camera-preview): display interfaces in docs 2016-12-06 08:58:38 -05:00
Ibby
2f9c5e6674 docs(calendar): enhance docs and display interface 2016-12-06 08:57:53 -05:00
Ibby
d02688971d refractor(): refractor interface(s) name(s) 2016-12-06 08:51:38 -05:00
Ibby
95ca373e10 refractor(barcode-scanner): add BarcodeScannerOptions interface 2016-12-06 08:50:02 -05:00
Ibby
4abb6ec78e refractor(background-mode): refractor interfaces names to avoid duplicates 2016-12-06 08:45:44 -05:00
Ibby
59a382d6df refractor(background-geolocation): refractor interfaces names to avoid duplicates 2016-12-06 08:44:42 -05:00
Ibby
80d9fe2211 refractor(apprate): export interfaces and improve docs 2016-12-06 08:41:36 -05:00
Ibby
8b48d6c275 docs(): minor update 2016-12-06 08:33:40 -05:00
Ibby
585d4ff37b refractor(android-fingerprint-auth): export options to interface 2016-12-06 08:33:03 -05:00
Ibby
6ba1d4908b feat(admob): update api and docs 2016-12-06 08:29:39 -05:00
Ibby
3a8e958684 style(): move interface to top 2016-12-06 08:06:47 -05:00
Ibby
1358411b80 docs(3dtouch): complete interfaces docs 2016-12-06 08:06:25 -05:00
Ibby
e26783b8c6 style(): spacing and cleanup 2016-12-06 08:02:00 -05:00
Ibby
fff1dc45e2 chore(): update changelog 2016-12-06 07:46:19 -05:00
85 changed files with 2315 additions and 1277 deletions

View File

@@ -1,3 +1,79 @@
<a name="2.2.14"></a>
## [2.2.14](https://github.com/driftyco/ionic-native/compare/v2.2.13...v2.2.14) (2017-01-07)
### Bug Fixes
* **google-analytics:** fix startTrackerWithId when interval is not provided ([49fe24d](https://github.com/driftyco/ionic-native/commit/49fe24d))
* **google-plus:** fixes login without options ([ca14bf6](https://github.com/driftyco/ionic-native/commit/ca14bf6)), closes [#932](https://github.com/driftyco/ionic-native/issues/932)
* **inappbrowser:** fix insertCSS method name ([de07df6](https://github.com/driftyco/ionic-native/commit/de07df6)), closes [#921](https://github.com/driftyco/ionic-native/issues/921)
* **mixpanel:** fix issue when not passing eventProperties ([#927](https://github.com/driftyco/ionic-native/issues/927)) ([bbf75bc](https://github.com/driftyco/ionic-native/commit/bbf75bc))
* **nfc:** add missing param for addMimeTypeListener ([#937](https://github.com/driftyco/ionic-native/issues/937)) ([ca60c5b](https://github.com/driftyco/ionic-native/commit/ca60c5b))
* **push:** fix typing for additionalData ([0d6997c](https://github.com/driftyco/ionic-native/commit/0d6997c)), closes [#868](https://github.com/driftyco/ionic-native/issues/868)
### Features
* **background-geolocation:** add altitudeAccuracy into response typings ([#922](https://github.com/driftyco/ionic-native/issues/922)) ([8eb656c](https://github.com/driftyco/ionic-native/commit/8eb656c))
* **market:** add search method, return promises ([d62779a](https://github.com/driftyco/ionic-native/commit/d62779a))
<a name="2.2.13"></a>
## [2.2.13](https://github.com/driftyco/ionic-native/compare/v2.2.12...v2.2.13) (2016-12-27)
### Bug Fixes
* **admob:** add adId prop to AdMobOptions ([d5dfdf8](https://github.com/driftyco/ionic-native/commit/d5dfdf8))
* **background-mode:** isEnabled and isActive return booleans ([ba77fd7](https://github.com/driftyco/ionic-native/commit/ba77fd7)), closes [#908](https://github.com/driftyco/ionic-native/issues/908)
* **diagnostic:** add missing types ([1841220](https://github.com/driftyco/ionic-native/commit/1841220)), closes [#905](https://github.com/driftyco/ionic-native/issues/905)
* **diagnostic:** add permissionStatus types ([#890](https://github.com/driftyco/ionic-native/issues/890)) ([3385c1b](https://github.com/driftyco/ionic-native/commit/3385c1b))
### Features
* **android-fingerprint-auth:** update to v1.2.1 ([#910](https://github.com/driftyco/ionic-native/issues/910)) ([a1b0f88](https://github.com/driftyco/ionic-native/commit/a1b0f88))
* **nfc:** add new functions ([#853](https://github.com/driftyco/ionic-native/issues/853)) ([c44fb75](https://github.com/driftyco/ionic-native/commit/c44fb75))
* **onesignal:** improve typings ([#888](https://github.com/driftyco/ionic-native/issues/888)) ([56e8eae](https://github.com/driftyco/ionic-native/commit/56e8eae))
* **sim:** add new methods ([#894](https://github.com/driftyco/ionic-native/issues/894)) ([0c36988](https://github.com/driftyco/ionic-native/commit/0c36988))
<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)

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "2.2.11",
"version": "2.2.14",
"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",

View File

@@ -1,5 +1,5 @@
{
"sitePath": "../ionic-site",
"v2DocsDir": "docs/v2/native",
"docsDest": "../ionic-site/docs/v2/native"
"docsDest": "../ionic-site/content/docs/v2/native"
}

View File

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

View File

@@ -30,7 +30,7 @@ function run {
git pull origin master
fi
git rm -rf docs/v2/native/*/
git rm -rf content/docs/v2/native/*/
}

View File

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

View File

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

View File

@@ -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(' ','-') $>"

View File

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

View File

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

View File

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

View File

@@ -1,25 +1,111 @@
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 ID
*/
adId?: string;
/**
* 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 +116,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 +150,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 +169,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 +177,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 +210,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 +223,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; }
}

View File

@@ -1,4 +1,68 @@
import { Cordova, Plugin } from './plugin';
export interface AndroidFingerprintAuthOptions {
/**
* Required
* Used as the alias for your key in the Android Key Store.
*/
clientId: string;
/**
* Used to create credential string for encrypted token and as alias to retrieve the cipher.
*/
username?: string;
/**
* Used to create credential string for encrypted token
*/
password?: string;
/**
* Required for decrypt()
* Encrypted user credentials to decrypt upon successful authentication.
*/
token?: string;
/**
* Set to true to remove the "USE BACKUP" button
*/
disableBackup?: boolean;
/**
* Change the language. (en_US or es)
*/
locale?: string;
/**
* The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts.
*/
maxAttempts?: number;
/**
* Require the user to authenticate with a fingerprint to authorize every use of the key.
* New fingerprint enrollment will invalidate key and require backup authenticate to
* re-enable the fingerprint authentication dialog.
*/
userAuthRequired?: boolean;
/**
* Set the title of the fingerprint authentication dialog.
*/
dialogTitle?: string;
/**
* Set the message of the fingerprint authentication dialog.
*/
dialogMessage?: string;
/**
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
*/
dialogHint?: string;
}
/**
* @name Android Fingerprint Auth
* @description
@@ -12,15 +76,20 @@ import { Cordova, Plugin } from './plugin';
* if(result.isAvailable){
* // it is available
*
* AndroidFingerprintAuth.show({ clientId: "myAppName", clientSecret: "so_encrypted_much_secure_very_secret" })
* AndroidFingerprintAuth.encrypt({ clientId: "myAppName", username: "myUsername", password: "myPassword" })
* .then(result => {
* if(result.withFingerprint) {
* console.log('Successfully authenticated with fingerprint!');
* } else if(result.withPassword) {
* if (result.withFingerprint) {
* console.log("Successfully encrypted credentials.");
* console.log("Encrypted credentials: " + result.token);
* } else if (result.withBackup) {
* console.log('Successfully authenticated with backup password!');
* } else console.log('Didn\'t authenticate!');
* })
* .catch(error => console.error(error));
* .catch(error => {
* if (error === "Cancelled") {
* console.log("Fingerprint authentication cancelled");
* } else console.error(error)
* });
*
* } else {
* // fingerprint auth isn't available
@@ -28,6 +97,8 @@ import { Cordova, Plugin } from './plugin';
* })
* .catch(error => console.error(error));
* ```
* @interfaces
* AndroidFingerprintAuthOptions
*/
@Plugin({
pluginName: 'AndroidFingerprintAuth',
@@ -36,37 +107,48 @@ 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: {
static encrypt(options: AndroidFingerprintAuthOptions): Promise<{
/**
* Used as the alias for your key in the Android Key Store.
* Biometric authentication
*/
clientId: string;
withFingerprint: boolean;
/**
* Used to encrypt the token returned upon successful fingerprint authentication.
* Authentication using backup credential activity
*/
clientSecret: string;
withBackup: boolean;
/**
* Set to true to remove the "USE BACKUP" button
* base64encoded string representation of user credentials
*/
disableBackup?: boolean;
token: string;
}> {return; }
/**
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
* @param options {AndroidFingerprintAuthOptions} Options
* @returns {Promise<any>}
*/
@Cordova()
static decrypt(options: AndroidFingerprintAuthOptions): Promise<{
/**
* Change the language. (en_US or es)
* Biometric authentication
*/
locale?: string
}): Promise<{
withFingerprint: boolean;
/**
* Base64 encoded string
* Authentication using backup credential activity
*/
withFingerprint: string;
withBackup: boolean;
/**
*
* FingerprintAuth.CipherMode.DECRYPT
* Decrypted password
*/
withPassword: boolean;
password: string;
}> {return; }
/**
@@ -74,6 +156,12 @@ export class AndroidFingerprintAuth {
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
*/
@Cordova()
static isAvailable(): Promise<{isAvailable: boolean}> {return; }
static isAvailable(): Promise<{isAvailable: boolean}> { return; }
/**
* Delete the cipher used for encryption and decryption by username
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted
*/
@Cordova()
static delete(options: {clientId: string; username: string; }): Promise<{deleted: boolean}> { return; }
}

View File

@@ -9,14 +9,14 @@ 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') {
* } else if (Device.platform === 'Android') {
* app = 'com.twitter.android';
* }
*

View File

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

View File

@@ -26,6 +26,7 @@ import { Cordova, Plugin } from './plugin';
platforms: ['Android', 'iOS']
})
export class AppVersion {
/**
* Returns the name of the app
* @returns {Promise<any>}

View File

@@ -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)
@@ -49,6 +49,11 @@ export interface Location {
*/
altitude: number;
/**
* accuracy of the altitude if available.
*/
altitudeAccuracy: number;
/**
* bearing, in degrees.
*/
@@ -65,7 +70,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 +273,8 @@ export interface Config {
*
* ```
* @interfaces
* Location
* Config
* BackgroundGeolocationResponse
* BackgroundGeolocationConfig
*/
@Plugin({
pluginName: 'BackgroundGeolocation',
@@ -341,7 +346,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 +384,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 +392,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 +503,5 @@ export class BackgroundGeolocation {
*/
@Cordova()
static getLogEntries(limit: number): Promise<any> { return; }
}

View File

@@ -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.
@@ -53,17 +76,21 @@ export class BackgroundMode {
/**
* Checks if background mode is enabled or not.
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is enabled.
* @returns {boolean} returns a boolean that indicates if the background mode is enabled.
*/
@Cordova()
static isEnabled(): Promise<boolean> { return; }
@Cordova({
sync: true
})
static isEnabled(): boolean { return; }
/**
* Can be used to get the information if the background mode is active.
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is active.
* @returns {boolean} returns a boolean that indicates if the background mode is active.
*/
@Cordova()
static isActive(): Promise<boolean> { return; }
@Cordova({
sync: true
})
static isActive(): boolean { return; }
/**
* Override the default title, ticker and text.
@@ -73,7 +100,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 +110,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 +134,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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
import { Cordova, Plugin } from './plugin';
/**
* @name Clipboard
* @description

View File

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

View File

@@ -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[]> {

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
import { Cordova, Plugin } from './plugin';
@Plugin({
pluginName: 'DeviceAccounts',
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',

View File

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

View File

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

View File

@@ -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: string;
DENIED: string;
NOT_REQUESTED: string;
DENIED_ALWAYS: string;
RESTRICTED: string;
GRANTED_WHEN_IN_USE: string;
};
static locationAuthorizationMode = {
ALWAYS: 'ALWAYS',
WHEN_IN_USE: 'WHEN_IN_USE'
ALWAYS: 'always',
WHEN_IN_USE: 'when_in_use'
};
static permissionGroups = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,7 +14,8 @@ import { Cordova, Plugin } from './plugin';
pluginName: 'Globalization',
plugin: 'cordova-plugin-globalization',
pluginRef: 'navigator.globalization',
repo: 'https://github.com/apache/cordova-plugin-globalization'
repo: 'https://github.com/apache/cordova-plugin-globalization',
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
})
export class Globalization {

View File

@@ -1,6 +1,5 @@
import { Cordova, Plugin } from './plugin';
/**
* @name Google Plus
* @description
@@ -8,6 +7,9 @@ import { Cordova, Plugin } from './plugin';
* ```typescript
* import { GooglePlus } from 'ionic-native';
*
* GooglePlus.login()
* .then(res => console.log(res))
* .catch(err => console.error(err));
*
* ```
*/
@@ -21,34 +23,37 @@ 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({
successIndex: 1,
errorIndex: 2
})
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; }
}

View File

@@ -1,6 +1,5 @@
import { Cordova, Plugin } from './plugin';
declare var window;
/**
@@ -11,6 +10,20 @@ declare var window;
* - A Cordova 3.0+ project for iOS and/or Android
* - A Mobile App property through the Google Analytics Admin Console
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
* @usage
* ```typescript
* import { GoogleAnalytics } from 'ionic-native';
*
* GoogleAnalytics.startTrackerWithId('YOUR_TRACKER_ID')
* .then(() => {
* console.log('Google analytics is ready now');
* // Tracker is ready
* // You can now track pages or set additional information such as AppVersion or UserId
* })
* .catch(e => console.log('Error starting GoogleAnalytics', e));
*
*
* ```
*/
@Plugin({
pluginName: 'GoogleAnalytics',
@@ -20,6 +33,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/
@@ -27,7 +41,10 @@ export class GoogleAnalytics {
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 2,
errorIndex: 3
})
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
/**
@@ -187,4 +204,5 @@ export class GoogleAnalytics {
*/
@Cordova()
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
}

View File

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

View File

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

View File

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

View File

@@ -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>;
}
/**
@@ -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.

View File

@@ -65,6 +65,8 @@ export interface ImageResizerOptions {
* () => { console.log('Error occured'); }
* )
* ```
* @interfaces
* ImageResizerOptions
*/
@Plugin({
pluginName: 'ImageResizer',

View File

@@ -29,6 +29,8 @@ export interface InAppBrowserEvent extends Event {
* browser.insertCSS(...);
* browser.close();
* ```
* @interfaces
* InAppBrowserEvent
*/
@Plugin({
pluginName: 'InAppBrowser',
@@ -79,7 +81,7 @@ export class InAppBrowser {
/**
* Injects JavaScript code into the InAppBrowser window.
* @param script Details of the script to run, specifying either a file or code key.
* @param script {Object} Details of the script to run, specifying either a file or code key.
* @returns {Promise<any>}
*/
@CordovaInstance()
@@ -87,14 +89,11 @@ export class InAppBrowser {
/**
* Injects CSS into the InAppBrowser window.
* @param {Object} Details of the script to run, specifying either a file or code key.
* @param css {Object} Details of the script to run, specifying either a file or code key.
* @returns {Promise<any>}
*/
@CordovaInstance()
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
insertCSS(css: {file?: string, code?: string}): Promise<any> {return; }
/**
* A method that allows you to listen to events happening in the browser.
@@ -107,4 +106,5 @@ export class InAppBrowser {
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
});
}
}

View File

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

View File

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

View File

@@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin';
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
})
export class Market {
/**
* Opens an app in Google Play / App Store
* @param appId {string} Package name
* @param callbacks {Object} Optional callbacks in the format {success?: Function, failure?: Function}
* @return {Promise<any>}
*/
@Cordova({sync: true})
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'failure'
})
static open(appId: string): Promise<any> { return; }
/**
* Search apps by keyword
* @param keyword {string} Keyword
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'failure',
platforms: ['Android']
})
static search(keyword: string): Promise<any> { return; }
}

View File

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

View File

@@ -17,7 +17,11 @@ export interface MediaError {
*
*
* // Create a MediaPlugin instance. Expects path to file or url as argument
* var file = new MediaPlugin('path/to/file.mp3');
* // We can optionally pass a second argument to track the status of the media
*
* const onStatusUpdate = (status) => console.log(status);
*
* const file = new MediaPlugin('path/to/file.mp3', onStatusUpdate);
*
* // Catch the Success & Error Output
* // Platform Quirks

View File

@@ -85,7 +85,10 @@ export class Mixpanel {
* @param eventProperties {any} optional
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 2,
errorIndex: 3
})
static track(eventName: string, eventProperties?: any): Promise<any> { return; }
/**

View File

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

View File

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

View File

@@ -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);
@@ -40,7 +40,7 @@ declare var navigator: any;
*
* ```
* @advanced
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
* The `type` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
*/
@Plugin({
pluginName: 'Network',
@@ -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

View File

@@ -47,6 +47,21 @@ export class NFC {
/**
* Registers an event listener for tags matching any tag type.
* @param onSuccess
* @param onFailure
* @returns {Observable<any>}
*/
@Cordova({
observable: true,
successIndex: 0,
errorIndex: 3,
clearFunction: 'removeTagDiscoveredListener',
clearWithArgs: true
})
static addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
/**
* Registers an event listener for NDEF tags matching a specified MIME type.
* @param mimeType
* @param onSuccess
* @param onFailure
@@ -56,25 +71,10 @@ export class NFC {
observable: true,
successIndex: 1,
errorIndex: 4,
clearFunction: 'removeTagDiscoveredListener',
clearWithArgs: true
})
static addTagDiscoveredListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
/**
* Registers an event listener for NDEF tags matching a specified MIME type.
* @param onSuccess
* @param onFailure
* @returns {Observable<any>}
*/
@Cordova({
observable: true,
successIndex: 0,
errorIndex: 3,
clearFunction: 'removeMimeTypeListener',
clearWithArgs: true
})
static addMimeTypeListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
static addMimeTypeListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
/**
* Registers an event listener for formatable NDEF tags.
@@ -152,6 +152,27 @@ export class NFC {
*/
@Cordova()
static enabled(): Promise<any> {return; }
/**
* Convert bytes to string
* @param bytes {number[]}
* @returns {string}
*/
@Cordova({ sync: true })
static bytesToString(bytes: number[]): string {return; }
/**
* Convert string to bytes
* @param str {string}
* @returns {string}
*/
@Cordova({ sync: true })
static stringToBytes(str: string): number[] {return; };
/**
* Convert bytes to hex string
* @param bytes {number[]}
* @returns {string}
*/
@Cordova({ sync: true })
static bytesToHexString(bytes: number[]): string {return; };
}
/**

View File

@@ -1,237 +1,31 @@
import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
/**
* @name OneSignal
* @description
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
* OneSignal is a simple implementation for delivering push notifications.
*
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
*
* @usage
* ```typescript
* import { OneSignal } from 'ionic-native';
*
* OneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');
*
* OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
*
* OneSignal.handleNotificationReceived().subscribe(() => {
* // do something when notification is received
* });
*
* OneSignal.handleNotificationOpened().subscribe(() => {
* // do something when a notification is opened
* });
*
* OneSignal.endInit();
* ```
*
*/
@Plugin({
pluginName: 'OneSignal',
plugin: 'onesignal-cordova-plugin',
pluginRef: 'plugins.OneSignal',
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'
})
export class OneSignal {
export interface OSNotification {
/**
* constants to use in inFocusDisplaying()
* Was app in focus.
*/
static OSInFocusDisplayOption = {
None: 0,
InAppAlert : 1,
Notification : 2
};
isAppInFocus: boolean;
/**
* Start the initialization process. Once you are done configuring OneSignal, call the endInit function.
*
* @param {string} appId Your AppId from your OneSignal app
* @param {string} googleProjectNumber The Google Project Number (which you can get from the Google Developer Portal) and the autoRegister option.
* @returns {any}
* Was notification shown to the user. Will be false for silent notifications.
*/
@Cordova({ sync: true })
static startInit(appId: string, googleProjectNumber: string): any { return; }
shown: boolean;
/**
* Callback to run when a notification is received
* @return {Observable<any>}
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
*/
@Cordova({
observable: true
})
static handleNotificationReceived(): Observable<any> { return; }
androidNotificationId?: number;
/**
* Callback to run when a notification is opened
* @return {Observable<any>}
* Payload received from OneSignal.
*/
@Cordova({
observable: true
})
static handleNotificationOpened(): Observable<any> { return; }
payload: OSNotificationPayload;
/**
*
* @param settings
* @returns {any}
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
*/
@Cordova({ sync: true })
static iOSSettings(settings: {
kOSSettingsKeyInAppLaunchURL: boolean;
kOSSettingsKeyAutoPrompt: boolean;
}): any { return; }
displayType: OSDisplayType;
/**
* @returns {any}
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
*/
@Cordova({ sync: true })
static endInit(): any { return; }
/**
* Retrieve a list of tags that have been set on the user from the OneSignal server.
*
* @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
*/
@Cordova()
static getTags(): Promise<any> { return; }
/**
* Lets you retrieve the OneSignal user id and device token.
* Your handler is called after the device is successfully registered with OneSignal.
*
* @returns {Promise<any>} Returns a Promise that reolves if the device was successfully registered.
* It returns a JSON with `userId`and `pushToken`.
*/
@Cordova()
static getIds(): Promise<any> { return; }
/**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
*
* @param {string} Key of your choosing to create or update.
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
*/
@Cordova({ sync: true })
static sendTag(key: string, value: string): void { }
/**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
*
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
*/
@Cordova({ sync: true })
static sendTags(json: any): void { }
/**
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
*
* @param {string} Key to remove.
*/
@Cordova({ sync: true })
static deleteTag(key: string): void { }
/**
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
*
* @param {Array<string>} Keys to remove.
*/
@Cordova({ sync: true })
static deleteTags(keys: string[]): void { }
/**
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
* Only use if you passed false to autoRegister when calling init.
*/
@Cordova({ sync: true })
static registerForPushNotifications(): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
*
* @param {boolean} false to disable vibrate, true to re-enable it.
*/
@Cordova({ sync: true })
static enableVibrate(enable: boolean): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
*
* @param {boolean} false to disable sound, true to re-enable it.
*/
@Cordova({ sync: true })
static enableSound(enable: boolean): void { }
/**
*
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
*
* @param {number} displayOption Options are 0 = None, 1 = InAppAlert, and 2 = Notification.
*/
@Cordova({ sync: true })
static inFocusDisplaying(displayOption: number): void { }
/**
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
* You can pass true later to opt users back into notifications.
*
* @param {boolean} enable
*/
@Cordova({ sync: true })
static setSubscription(enable: boolean): void { }
/**
*
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
*/
@Cordova()
static postNotification(notificationObj: OneSignalNotification): Promise<any> { return; }
/**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
*/
@Cordova({ sync: true })
static promptLocation(): void { }
/**
*
* @param email {string}
*/
@Cordova({ sync: true })
static syncHashedEmail(email: string): void { }
/**
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
@Cordova({ sync: true })
static setLogLevel(logLevel: {
logLevel: number,
visualLevel: number
}): void { }
}
export interface OneSignalNotification {
groupedNotifications?: OSNotificationPayload[];
app_id: string;
contents: any;
headings?: any;
@@ -293,3 +87,429 @@ export interface OneSignalNotification {
priority?: number;
ios_category?: string;
}
/**
* **ANDROID** - Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
*/
export enum OSLockScreenVisibility {
/**
* Fully visible (default)
*/
Public = 1,
/**
* Contents are hidden
*/
Private = 0,
/**
* Not shown
*/
Secret = -1
}
/**
* How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used.
*/
export enum OSDisplayType {
/**
* notification is silent, or inFocusDisplaying is disabled.
*/
None = 0,
/**
* (**DEFAULT**) - native alert dialog display.
*/
InAppAlert = 1,
/**
* native notification display.
*/
Notification = 2
}
/**
* Contents and settings of the notification the user received.
*/
export interface OSNotificationPayload {
/**
* OneSignal notification UUID.
*/
notificationID: string;
/**
* Title of the notification.
*/
title: string;
/**
* Body of the notification.
*/
body: string;
/**
* Custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data
* or with the 'data' field on the REST API.
*/
additionalData?: any;
/**
* **ANDROID** - Small icon resource name set on the notification.
*/
smallIcon?: string;
/**
* **ANDROID** - Large icon set on the notification.
*/
largeIcon?: string;
/**
* **ANDROID** - Big picture image set on the notification.
*/
bigPicture?: string;
/**
* **ANDROID** - Accent color shown around small notification icon on Android 5+ devices. ARGB format.
*/
smallIconAccentColor?: string;
/**
* URL to open when opening the notification.
*/
launchUrl?: string;
/**
* Sound resource to play when the notification is shown.
*/
sound: string;
/**
* **ANDROID** - Devices that have a notification LED will blink in this color. ARGB format.
*/
ledColor?: string;
lockScreenVisibility?: OSLockScreenVisibility;
/**
* **ANDROID** - Notifications with this same key will be grouped together as a single summary notification.
*/
groupKey?: string;
/**
* **ANDROID** - Summary text displayed in the summary notification.
*/
groupMessage?: string;
/**
* List of action buttons on the notification.
*/
actionButtons: OSActionButton[];
/**
* **ANDROID** - The Google project number the notification was sent under.
*/
fromProjectNumber?: string;
/**
* **ANDROID** - If a background image was set this object will be available.
*/
backgroundImageLayout?: OSBackgroundImageLayout;
priority?: number;
/**
* List of action buttons on the notification.
*/
rawPayload: string;
}
/**
* List of action buttons on the notification.
*/
export interface OSActionButton {
/**
* Id assigned to the button.
*/
id: string;
/**
* Text show on the button to the user.
*/
text: string;
/**
* **ANDROID** - Icon shown on the button.
*/
icon: string;
}
/**
* **ANDROID** - If a background image was set, this object will be available.
*/
export interface OSBackgroundImageLayout {
/**
* Image URL or name used as the background image.
*/
image: string;
/**
* Text color of the title on the notification. ARGB Format.
*/
titleTextColor: string;
/**
* Text color of the body on the notification. ARGB Format.
*/
bodyTextColor: string;
}
/**
* The information returned from a notification the user received.
*/
export interface OSNotificationOpenedResult {
action: {
/**
* Was the notification opened normally (`Opened`) or was a button pressed on the notification (`ActionTaken`).
*/
type: OSActionType;
/**
* If `type` == `ActionTaken` then this will contain the id of the button pressed.
*/
actionID?: string;
};
notification: OSNotification;
}
export enum OSActionType {
Opened = 0,
ActionTake = 1
}
/**
* @name OneSignal
* @description
* The OneSignal plugin is an client implementation for using the [OneSignal](https://onesignal.com/) Service.
* OneSignal is a simple implementation for delivering push notifications.
*
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
*
* @usage
* ```typescript
* import { OneSignal } from 'ionic-native';
*
* OneSignal.startInit('b2f7f966-d8cc-11e4-bed1-df8f05be55ba', '703322744261');
*
* OneSignal.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
*
* OneSignal.handleNotificationReceived().subscribe(() => {
* // do something when notification is received
* });
*
* OneSignal.handleNotificationOpened().subscribe(() => {
* // do something when a notification is opened
* });
*
* OneSignal.endInit();
* ```
* @interfaces
* OSNotification
* OSLockScreenVisibility
* OSDisplayType
* OSNotificationPayload
* OSActionButton
* OSBackgroundImageLayout
* OSNotificationOpenedResult
* OSActionType
*/
@Plugin({
pluginName: 'OneSignal',
plugin: 'onesignal-cordova-plugin',
pluginRef: 'plugins.OneSignal',
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
platforms: ['Android', 'iOS', 'Windows', 'FireOS']
})
export class OneSignal {
/**
* constants to use in inFocusDisplaying()
*/
static OSInFocusDisplayOption = {
None: 0,
InAppAlert : 1,
Notification : 2
};
/**
* Start the initialization process. Once you are done configuring OneSignal, call the `endInit` function.
*
* @param {string} appId Your OneSignal app id
* @param {string} googleProjectNumber **ANDROID** - your Google project number; only required for Android GCM/FCM pushes.
* @returns {any}
*/
@Cordova({ sync: true })
static startInit(appId: string, googleProjectNumber?: string): any { return; }
/**
* Callback to run when a notification is received, whether it was displayed or not.
*
* @return {Observable<OneSignalReceivedNotification>}
*/
@Cordova({
observable: true
})
static handleNotificationReceived(): Observable<OSNotification> { return; }
/**
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
* center (**iOS**), or when closing an Alert notification shown in the app (if InAppAlert is enabled in
* inFocusDisplaying).
*
* @return {Observable<OneSignalOpenedNotification>}
*/
@Cordova({
observable: true
})
static handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; }
/**
* **iOS** - Settings for iOS apps
*
* @param settings
* kOSSettingsKeyAutoPrompt: boolean = true
* Auto prompt user for notification permissions.
*
* kOSSettingsKeyInAppLaunchURL: boolean = false
* Launch notifications with a launch URL as an in app webview.
* @returns {any}
*/
@Cordova({ sync: true })
static iOSSettings(settings: {
kOSSettingsKeyAutoPrompt: boolean;
kOSSettingsKeyInAppLaunchURL: boolean;
}): any { return; }
/**
* Must be called after `startInit` to complete initialization of OneSignal.
*
* @returns {any}
*/
@Cordova({ sync: true })
static endInit(): any { return; }
/**
* Retrieve a list of tags that have been set on the user from the OneSignal server.
*
* @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
*/
@Cordova()
static getTags(): Promise<any> { return; }
/**
* Lets you retrieve the OneSignal user id and device token.
* Your handler is called after the device is successfully registered with OneSignal.
*
* @returns {Promise<Object>} Returns a Promise that resolves if the device was successfully registered.
*
* userId {string} OneSignal userId is a UUID formatted string. (unique per device per app)
*
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
*/
@Cordova()
static getIds(): Promise<{userId: string; pushToken: string}> { return; }
/**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
*
* @param {string} Key of your choosing to create or update.
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
*/
@Cordova({ sync: true })
static sendTag(key: string, value: string): void { }
/**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
*
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
*/
@Cordova({ sync: true })
static sendTags(json: any): void { }
/**
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
*
* @param {string} Key to remove.
*/
@Cordova({ sync: true })
static deleteTag(key: string): void { }
/**
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
*
* @param {Array<string>} Keys to remove.
*/
@Cordova({ sync: true })
static deleteTags(keys: string[]): void { }
/**
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
* Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
*/
@Cordova({ sync: true })
static registerForPushNotifications(): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
*
* @param {boolean} false to disable vibrate, true to re-enable it.
*/
@Cordova({ sync: true })
static enableVibrate(enable: boolean): void { }
/**
* Warning:
* Only applies to Android and Amazon. You can call this from your UI from a button press for example to give your user's options for your notifications.
*
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
*
* @param {boolean} false to disable sound, true to re-enable it.
*/
@Cordova({ sync: true })
static enableSound(enable: boolean): void { }
/**
*
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
*
* @param {DisplayType} displayOption
* @returns {any}
*/
@Cordova({ sync: true })
static inFocusDisplaying(displayOption: OSDisplayType): any { return; }
/**
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
* You can pass true later to opt users back into notifications.
*
* @param {boolean} enable
*/
@Cordova({ sync: true })
static setSubscription(enable: boolean): void { }
/**
*
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
*/
@Cordova()
static postNotification(notificationObj: OSNotification): Promise<any> { return; }
/**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
*/
@Cordova({ sync: true })
static promptLocation(): void { }
/**
*
* @param email {string}
*/
@Cordova({ sync: true })
static syncHashedEmail(email: string): void { }
/**
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/
@Cordova({ sync: true })
static setLogLevel(logLevel: {
logLevel: number,
visualLevel: number
}): void { }
}

View File

@@ -124,7 +124,15 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
}
// TODO: Illegal invocation needs window context
return get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
let value;
try {
value = get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
} catch (e) {
value = {
error: 'cordova_not_available'
};
}
return value;
}
/**
@@ -194,7 +202,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);
}

View File

@@ -59,6 +59,8 @@ export interface PrintOptions {
*
* Printer.print(content, options).then(onSuccess, onError);
* ```
* @interfaces
* PrintOptions
*/
@Plugin({
pluginName: 'Printer',

View File

@@ -36,7 +36,7 @@ export interface NotificationEventResponse {
/**
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
*/
additionalData: NotificationEventAdditionalData;
additionalData: NotificationEventAdditionalData | any;
}
/**

View File

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

View File

@@ -17,6 +17,15 @@ import { Cordova, Plugin } from './plugin';
* (info) => console.log('Sim info: ', info),
* (err) => console.log('Unable to get sim info: ', err)
* );
*
* Sim.hasReadPermission().then(
* (info) => console.log('Has permission: ', info)
* );
*
* Sim.requestReadPermission().then(
* () => console.log('Permission granted'),
* () => console.log('Permission denied')
* );
* ```
*/
@Plugin({
@@ -34,4 +43,21 @@ export class Sim {
@Cordova()
static getSimInfo(): Promise<any> { return; }
/**
* Check permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
static hasReadPermission(): Promise<any> { return; }
/**
* Request permission
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
static requestReadPermission(): Promise<any> { return; }
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -23,6 +23,8 @@ export interface TTSOptions {
* .catch((reason: any) => console.log(reason));
*
* ```
* @interfaces
* TTSOptions
*/
@Plugin({
pluginName: 'TextToSpeech',

View File

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

View File

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

View File

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

View File

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

View File

@@ -36,6 +36,8 @@ export interface VideoOptions {
* });
*
* ```
* @interfaces
* VideoOptions
*/
@Plugin({
pluginName: 'VideoPlayer',

View File

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