mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-06-08 00:00:19 +08:00
Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b66d27b794 | |||
| c3a9296a36 | |||
| 565c766813 | |||
| 1684202629 | |||
| d95a359719 | |||
| 12ddf96705 | |||
| fead657fbd | |||
| f1d8d3b255 | |||
| 6af01d2dc1 | |||
| 006ba4425f | |||
| 4f415892b1 | |||
| 713efd7206 | |||
| 3f9311090d | |||
| 28a1b83d1d | |||
| 956e644fa4 | |||
| f62a123a34 | |||
| 8e1ca359ab | |||
| 61714ff7ca | |||
| 9f9a3461f7 | |||
| 22ffb4914f | |||
| 3ed896960e | |||
| 249d62d4ba | |||
| 1d71bdc284 | |||
| 189d66cc47 | |||
| fe5b7ce0af | |||
| 98d44e6294 | |||
| 8d571989d4 | |||
| e61d574849 | |||
| fdd63153e0 | |||
| 9dd4ecde9c | |||
| dd9ba0ad3f | |||
| 9f662b6a04 | |||
| 1dc48e943c | |||
| 15a334d87a | |||
| 4d742438b4 | |||
| 1013a7d38a | |||
| c574428e0e | |||
| ce3591200e | |||
| fc088f8431 | |||
| 392bc5c80a | |||
| 31fc892b70 | |||
| 5794d249c4 | |||
| 3f8a6f2425 | |||
| dd769b0226 | |||
| 8460e6838a | |||
| 03e6afbad4 | |||
| be370a4f99 | |||
| bb9c581f42 | |||
| d988e12353 | |||
| df254de88b | |||
| 5803c069a3 | |||
| dfbbfc7bd5 | |||
| 16980f1b6a | |||
| 3311d73730 | |||
| a4cc7f7ae1 | |||
| e6b02b1875 | |||
| c03b73f69c | |||
| 05423ce299 | |||
| 34aeb19628 | |||
| d6a9ed134e | |||
| a0183811f6 | |||
| e6d4b41e7e | |||
| 400dbcb1fb | |||
| ae6e28de88 | |||
| 58615f1cab | |||
| 7c355350fe | |||
| defb276b22 | |||
| e6db28123d | |||
| 714114d1e0 | |||
| 37ef2fc93f | |||
| 41a4a43c0c | |||
| 5f41ef1cbc | |||
| cea1dc14d3 | |||
| 49ad2118a3 | |||
| bfe5ae9cf2 | |||
| 47f739777e | |||
| a1c54f36b4 | |||
| 22d5d92dd3 | |||
| 3fa2eff580 | |||
| 567f525837 | |||
| 24cd0a91c4 | |||
| 50c8c154e3 | |||
| 1bfe82959b | |||
| 35e5cfe102 | |||
| a1e6befbc0 | |||
| 234b6ffd44 | |||
| 5387bc985a | |||
| 8b1bb3ba17 | |||
| a6450c6d07 | |||
| d68a0373e8 | |||
| 8cd2da1c5b | |||
| 633e9d8e9a | |||
| 30f5b71f4a | |||
| 5dede9b536 | |||
| 8be98a0cc1 | |||
| 36450e13cf | |||
| d4c98362d9 | |||
| ec69a0cbac | |||
| f49d2a964e | |||
| 91d22c5211 | |||
| 300db62731 | |||
| 23b760bb01 | |||
| 84e0aa1f94 | |||
| 1d9c449b24 |
@@ -1,3 +1,85 @@
|
||||
<a name="4.9.2"></a>
|
||||
## [4.9.2](https://github.com/ionic-team/ionic-native/compare/v4.9.1...v4.9.2) (2018-07-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ble:** change signature for autoConnect ([#2594](https://github.com/ionic-team/ionic-native/issues/2594)) ([d95a359](https://github.com/ionic-team/ionic-native/commit/d95a359))
|
||||
* **sqlite:** mark optional arguments for executeSql ([#2592](https://github.com/ionic-team/ionic-native/issues/2592)) ([565c766](https://github.com/ionic-team/ionic-native/commit/565c766))
|
||||
|
||||
|
||||
|
||||
<a name="4.9.1"></a>
|
||||
## [4.9.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.13...v4.9.1) (2018-07-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **barcode-scanner:** wrong barcode format identifier PDF417 -> PDF_417 ([#2574](https://github.com/ionic-team/ionic-native/issues/2574)) ([61714ff](https://github.com/ionic-team/ionic-native/commit/61714ff))
|
||||
* **health-kit:** add missing checkAuthStatus param ([#2544](https://github.com/ionic-team/ionic-native/issues/2544)) ([956e644](https://github.com/ionic-team/ionic-native/commit/956e644))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ble:** add missing functions ([#2572](https://github.com/ionic-team/ionic-native/issues/2572)) ([9f9a346](https://github.com/ionic-team/ionic-native/commit/9f9a346))
|
||||
* **network-interface:** match latest plugin release ([#2587](https://github.com/ionic-team/ionic-native/issues/2587)) ([4f41589](https://github.com/ionic-team/ionic-native/commit/4f41589))
|
||||
* **streaming-media:** add new parameters & docs ([#2576](https://github.com/ionic-team/ionic-native/issues/2576)) ([f62a123](https://github.com/ionic-team/ionic-native/commit/f62a123))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.13"></a>
|
||||
# [5.0.0-beta.13](https://github.com/ionic-team/ionic-native/compare/v4.9.0...v5.0.0-beta.13) (2018-06-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **android-fingerprint-auth:** ensure ERRORS array is defined ([#2508](https://github.com/ionic-team/ionic-native/issues/2508)) ([714114d](https://github.com/ionic-team/ionic-native/commit/714114d))
|
||||
* **background-geolocation:** watchLocationMode returns observable ([#2547](https://github.com/ionic-team/ionic-native/issues/2547)) ([3f8a6f2](https://github.com/ionic-team/ionic-native/commit/3f8a6f2))
|
||||
* **calendar:** Fixes createCalendar parameter typing ([84e0aa1](https://github.com/ionic-team/ionic-native/commit/84e0aa1))
|
||||
* **call-number:** fix isCallSupported function ([f49d2a9](https://github.com/ionic-team/ionic-native/commit/f49d2a9))
|
||||
* **healt:** add correct return type for query function ([#2565](https://github.com/ionic-team/ionic-native/issues/2565)) ([98d44e6](https://github.com/ionic-team/ionic-native/commit/98d44e6))
|
||||
* **healths:** add missing attribute on HealthQueryOptionsAggregated ([#2550](https://github.com/ionic-team/ionic-native/issues/2550)) ([be370a4](https://github.com/ionic-team/ionic-native/commit/be370a4))
|
||||
* **ibeacon:** correct Type {Region} in some params ([#2453](https://github.com/ionic-team/ionic-native/issues/2453)) ([300db62](https://github.com/ionic-team/ionic-native/commit/300db62))
|
||||
* **in-app-purchase-2:** fix ready method signature ([#2043](https://github.com/ionic-team/ionic-native/issues/2043)) ([a018381](https://github.com/ionic-team/ionic-native/commit/a018381))
|
||||
* **index-app-content:** add missing function ([8d57198](https://github.com/ionic-team/ionic-native/commit/8d57198))
|
||||
* **index-app-content:** fix imports ([189d66c](https://github.com/ionic-team/ionic-native/commit/189d66c))
|
||||
* **native-geocoder:** set response type to an array ([#2505](https://github.com/ionic-team/ionic-native/issues/2505)) ([defb276](https://github.com/ionic-team/ionic-native/commit/defb276))
|
||||
* **onesignal:** make params optional ([#2507](https://github.com/ionic-team/ionic-native/issues/2507)) ([e6db281](https://github.com/ionic-team/ionic-native/commit/e6db281))
|
||||
* **onesignal:** update OSPermissionState interface ([#2561](https://github.com/ionic-team/ionic-native/issues/2561)) ([fc088f8](https://github.com/ionic-team/ionic-native/commit/fc088f8))
|
||||
* **site:** no prepended slash ([cea1dc1](https://github.com/ionic-team/ionic-native/commit/cea1dc1))
|
||||
* **stripe:** fixed casing of postal code param ([#2520](https://github.com/ionic-team/ionic-native/issues/2520)) ([d6a9ed1](https://github.com/ionic-team/ionic-native/commit/d6a9ed1))
|
||||
* **themeable-browser:** allow hidden and clear cache ([a4cc7f7](https://github.com/ionic-team/ionic-native/commit/a4cc7f7))
|
||||
* **web-intent:** fix options param ([#2450](https://github.com/ionic-team/ionic-native/issues/2450)) ([23b760b](https://github.com/ionic-team/ionic-native/commit/23b760b))
|
||||
* **web-intent:** registerBroadcastReceiver as Observable ([#2491](https://github.com/ionic-team/ionic-native/issues/2491)) ([47f7397](https://github.com/ionic-team/ionic-native/commit/47f7397))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **aes-256:** AES256 encryption and decryption plugin added ([#2562](https://github.com/ionic-team/ionic-native/issues/2562)) ([fdd6315](https://github.com/ionic-team/ionic-native/commit/fdd6315))
|
||||
* **ble:** update wrapper to match latest plugin release ([#2548](https://github.com/ionic-team/ionic-native/issues/2548)) ([03e6afb](https://github.com/ionic-team/ionic-native/commit/03e6afb))
|
||||
* **calldirectory:** add call directory plugin ([#2473](https://github.com/ionic-team/ionic-native/issues/2473)) ([1bfe829](https://github.com/ionic-team/ionic-native/commit/1bfe829))
|
||||
* **cloud-settings:** add support for cordova-plugin-cloud-settings ([#2494](https://github.com/ionic-team/ionic-native/issues/2494)) ([400dbcb](https://github.com/ionic-team/ionic-native/commit/400dbcb))
|
||||
* **file-picker:** add missing options ([1d9c449](https://github.com/ionic-team/ionic-native/commit/1d9c449))
|
||||
* **firebase:** add new functions ([36450e1](https://github.com/ionic-team/ionic-native/commit/36450e1))
|
||||
* **firebase:** add verifyPhoneNumber support for iOS ([567f525](https://github.com/ionic-team/ionic-native/commit/567f525))
|
||||
* **firebase-config:** add firebase-config wrapper ([#2517](https://github.com/ionic-team/ionic-native/issues/2517)) ([05423ce](https://github.com/ionic-team/ionic-native/commit/05423ce))
|
||||
* **firebase-messaging:** add firebase-messaging ([#2518](https://github.com/ionic-team/ionic-native/issues/2518)) ([c03b73f](https://github.com/ionic-team/ionic-native/commit/c03b73f))
|
||||
* **hce:** add hce plugin wrapper ([#2534](https://github.com/ionic-team/ionic-native/issues/2534)) ([8460e68](https://github.com/ionic-team/ionic-native/commit/8460e68))
|
||||
* **image-picker:** add DATA_URL as an option to ImagePicker ([#2325](https://github.com/ionic-team/ionic-native/issues/2325)) ([dd9ba0a](https://github.com/ionic-team/ionic-native/commit/dd9ba0a))
|
||||
* **InAppReview:** add InAppReview plugin ([#2483](https://github.com/ionic-team/ionic-native/issues/2483)) ([bfe5ae9](https://github.com/ionic-team/ionic-native/commit/bfe5ae9))
|
||||
* **local-notifications:** added support for foreground option in version 0.9.0-beta.3 of cordova-plugin-local-notifications ([#2506](https://github.com/ionic-team/ionic-native/issues/2506)) ([ae6e28d](https://github.com/ionic-team/ionic-native/commit/ae6e28d))
|
||||
* **onesignal:** Added notification stacking ([#2512](https://github.com/ionic-team/ionic-native/issues/2512)) ([7c35535](https://github.com/ionic-team/ionic-native/commit/7c35535))
|
||||
* **photo-library:** add maxItems to limit items-iOS ([#2554](https://github.com/ionic-team/ionic-native/issues/2554)) ([31fc892](https://github.com/ionic-team/ionic-native/commit/31fc892))
|
||||
* **plugin:** add Sensors plugin ([#2268](https://github.com/ionic-team/ionic-native/issues/2268)) ([e61d574](https://github.com/ionic-team/ionic-native/commit/e61d574))
|
||||
* **send-result:** add sendResult method for WebIntent plugin ([#2495](https://github.com/ionic-team/ionic-native/issues/2495)) ([34aeb19](https://github.com/ionic-team/ionic-native/commit/34aeb19))
|
||||
* **SiriShortcuts:** implement Siri Shortcuts plugin in Ionic ([#2542](https://github.com/ionic-team/ionic-native/issues/2542)) ([df254de](https://github.com/ionic-team/ionic-native/commit/df254de))
|
||||
* **star-prnt:** add StarPRNT plugin ([a1e6bef](https://github.com/ionic-team/ionic-native/commit/a1e6bef))
|
||||
* **star-prnt:** Added support for connected to devices with barcode readers ([#2509](https://github.com/ionic-team/ionic-native/issues/2509)) ([58615f1](https://github.com/ionic-team/ionic-native/commit/58615f1))
|
||||
* **tealium:** add tealium ionic wrappers ([#2414](https://github.com/ionic-team/ionic-native/issues/2414)) ([5f41ef1](https://github.com/ionic-team/ionic-native/commit/5f41ef1))
|
||||
* **uptime:** add deep sleep parameter ([#2456](https://github.com/ionic-team/ionic-native/issues/2456)) ([91d22c5](https://github.com/ionic-team/ionic-native/commit/91d22c5))
|
||||
|
||||
|
||||
|
||||
<a name="4.7.0"></a>
|
||||
# [4.7.0](https://github.com/ionic-team/ionic-native/compare/v4.6.0...v4.7.0) (2018-04-09)
|
||||
|
||||
|
||||
+3
-3
@@ -115,11 +115,11 @@ You need to run `npm run build` in the `ionic-native` project, this will create
|
||||
|
||||
### Cleaning the code
|
||||
|
||||
You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
|
||||
You need to run `npm run lint` to analyze the code and ensure its consistency with the repository style. Fix any errors before submitting a PR.
|
||||
|
||||
### 'Wrapping' Up
|
||||
|
||||
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
|
||||
That's it! The only thing left to do is rigorously document the plugin and its usage. Take a look at some of the other plugins for good documentation styles.
|
||||
|
||||
## Commit Message Format
|
||||
|
||||
@@ -218,4 +218,4 @@ Example:
|
||||
```ts
|
||||
@CordovaFunctionOverride()
|
||||
someMethod(): Observable<any> { return; }
|
||||
```
|
||||
```
|
||||
|
||||
@@ -47,17 +47,15 @@ export class AppModule { }
|
||||
import { Geolocation } from '@ionic-native/geolocation';
|
||||
import { Platform } from 'ionic-angular';
|
||||
|
||||
import { NgZone } from '@angular/core';
|
||||
|
||||
@Component({ ... })
|
||||
export class MyComponent {
|
||||
|
||||
constructor(private geolocation: Geolocation, private platform: Platform) {
|
||||
|
||||
platform.ready().then(() => {
|
||||
this.platform.ready().then(() => {
|
||||
|
||||
// get position
|
||||
geolocation.getCurrentPosition().then(pos => {
|
||||
this.geolocation.getCurrentPosition().then(pos => {
|
||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||
});
|
||||
|
||||
@@ -65,7 +63,6 @@ export class MyComponent {
|
||||
// watch position
|
||||
const watch = geolocation.watchPosition().subscribe(pos => {
|
||||
console.log(`lat: ${pos.coords.latitude}, lon: ${pos.coords.longitude}`)
|
||||
this.position = pos;
|
||||
});
|
||||
|
||||
// to stop watching
|
||||
@@ -112,42 +109,43 @@ providers: [
|
||||
Here's the full example:
|
||||
|
||||
```typescript
|
||||
import { NgModule, ErrorHandler } from '@angular/core';
|
||||
import { ErrorHandler, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
|
||||
import { MyApp } from './app.component';
|
||||
import { HomePage } from '../pages/home/home';
|
||||
|
||||
import { Camera } from '@ionic-native/camera';
|
||||
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
|
||||
|
||||
import { HomePage } from '../pages/home/home';
|
||||
import { MyApp } from './app.component';
|
||||
|
||||
class CameraMock extends Camera {
|
||||
getPicture(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve("BASE_64_ENCODED_DATA_GOES_HERE");
|
||||
})
|
||||
resolve('BASE_64_ENCODED_DATA_GOES_HERE');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
MyApp,
|
||||
MyApp,
|
||||
HomePage
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(MyApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
MyApp,
|
||||
MyApp,
|
||||
HomePage
|
||||
],
|
||||
providers: [
|
||||
{provide: ErrorHandler, useClass: IonicErrorHandler},
|
||||
{ provide: ErrorHandler, useClass: IonicErrorHandler },
|
||||
{ provide: Camera, useClass: CameraMock }
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -169,6 +167,8 @@ For Ionic v1 (AngularJS, Angular 1.x) support, please use version 2 of Ionic Nat
|
||||
|
||||
Ibby Hadeed - [@ihadeed](https://github.com/ihadeed)
|
||||
|
||||
Daniel Sogl - [@sogldaniel](https://twitter.com/sogldaniel)
|
||||
|
||||
Tim Lancina - [@timlancina](https://twitter.com/timlancina)
|
||||
|
||||
Mike Hartington - [@mhartington](https://twitter.com/mhartington)
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ jobs:
|
||||
build:
|
||||
working_directory: ~/ionic-native/
|
||||
docker:
|
||||
- image: node:7
|
||||
- image: node:8
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
||||
@@ -4,7 +4,6 @@ const gulp = require('gulp'),
|
||||
minimist = require('minimist'),
|
||||
rename = require("gulp-rename"),
|
||||
tslint = require('gulp-tslint'),
|
||||
decamelize = require('decamelize'),
|
||||
replace = require('gulp-replace'),
|
||||
_ = require('lodash');
|
||||
|
||||
|
||||
Generated
+1696
-1576
File diff suppressed because it is too large
Load Diff
+9
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "4.7.0",
|
||||
"version": "4.9.2",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
@@ -10,14 +10,13 @@
|
||||
"@angular/compiler-cli": "4.4.4",
|
||||
"@angular/core": "4.4.4",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/jasmine": "^2.6.3",
|
||||
"@types/node": "^8.0.50",
|
||||
"@types/jasmine": "^2.8.8",
|
||||
"@types/node": "^8.10.20",
|
||||
"canonical-path": "0.0.2",
|
||||
"child-process-promise": "2.2.1",
|
||||
"conventional-changelog-cli": "1.3.4",
|
||||
"cpr": "2.0.0",
|
||||
"cz-conventional-changelog": "2.0.0",
|
||||
"decamelize": "1.2.0",
|
||||
"dgeni": "0.4.7",
|
||||
"dgeni-packages": "0.16.10",
|
||||
"fs-extra": "2.0.0",
|
||||
@@ -26,25 +25,25 @@
|
||||
"gulp-rename": "1.2.2",
|
||||
"gulp-replace": "0.5.4",
|
||||
"gulp-tslint": "6.1.2",
|
||||
"jasmine-core": "^2.6.1",
|
||||
"jasmine-core": "^2.99.1",
|
||||
"karma": "^1.7.0",
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
"karma-jasmine": "^1.1.2",
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"karma-typescript": "^3.0.1",
|
||||
"karma-typescript-es6-transform": "^1.0.0",
|
||||
"karma-typescript": "^3.0.12",
|
||||
"karma-typescript-es6-transform": "^1.0.4",
|
||||
"lodash": "4.17.4",
|
||||
"minimist": "1.2.0",
|
||||
"node-html-encoder": "0.0.2",
|
||||
"q": "1.5.0",
|
||||
"queue": "4.2.1",
|
||||
"rimraf": "2.6.1",
|
||||
"rxjs": "5.5.2",
|
||||
"rxjs": "^5.5.11",
|
||||
"semver": "5.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"typescript": "~2.4.2",
|
||||
"zone.js": "0.8.18"
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run test:watch",
|
||||
|
||||
@@ -10,6 +10,12 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
// pretty up and sort the docs object for menu generation
|
||||
docs = docs.filter(doc => (!!doc.name && !!doc.outputPath) || doc.docType === 'index-page');
|
||||
|
||||
docs.push({
|
||||
docType: 'class',
|
||||
URL: 'https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/README.md',
|
||||
name: 'Google Maps',
|
||||
});
|
||||
|
||||
docs.sort((a, b) => {
|
||||
const textA = a.name ? a.name.toUpperCase() : '',
|
||||
textB = b.name ? b.name.toUpperCase() : '';
|
||||
@@ -18,14 +24,20 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
});
|
||||
|
||||
docs.forEach(doc => {
|
||||
if (!doc.outputPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(/\s/g, '-');
|
||||
doc.URL = doc.outputPath.replace('docs//', 'docs/')
|
||||
.replace('/index.md', '')
|
||||
.replace('content/', '');
|
||||
// add trailing slash to plugin pages
|
||||
if(!doc.URL.endsWith("/") && !doc.URL.endsWith(".html")) {
|
||||
doc.URL = doc.URL+'/';
|
||||
doc.URL = doc.URL + '/';
|
||||
}
|
||||
|
||||
doc.URL = '/' + doc.URL;
|
||||
});
|
||||
|
||||
const betaDocs = [];
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@
|
||||
</li>
|
||||
<@- for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $><@ if doc.paid == true @> <span class="paid">Paid</span><@ endif @><@ if doc.beta == true @> <span class="beta">β</span><@ endif @></a>
|
||||
<a href="<$ doc.URL $>"><$ doc.name $><@ if doc.paid == true @> <span class="paid">Paid</span><@ endif @><@ if doc.beta == true @> <span class="beta">β</span><@ endif @></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* - Add/Change information below
|
||||
* - Document usage (importing, executing main functionality)
|
||||
* - Remove any imports that you are not using
|
||||
* - Add this file to /src/index.ts (follow style of other plugins)
|
||||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added
|
||||
* - Remove this note
|
||||
*
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* - Add/Change information below
|
||||
* - Document usage (importing, executing main functionality)
|
||||
* - Remove any imports that you are not using
|
||||
* - Add this file to /src/index.ts (follow style of other plugins)
|
||||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added
|
||||
* - Remove this note
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'rxjs/observable/throw';
|
||||
import { _throw } from 'rxjs/observable/throw';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
@@ -160,7 +160,7 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
||||
if (opts.sync) {
|
||||
return null;
|
||||
} else if (opts.observable) {
|
||||
return Observable.throw(new Error(check && check.error));
|
||||
return _throw(new Error(check && check.error));
|
||||
}
|
||||
return Promise.reject(check && check.error);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { fromEvent } from 'rxjs/observable/fromEvent';
|
||||
|
||||
import { checkReady } from './bootstrap';
|
||||
import { CordovaOptions } from './decorators';
|
||||
@@ -318,7 +317,7 @@ export function wrapEventObservable(
|
||||
event: string,
|
||||
element: any = window
|
||||
): Observable<any> {
|
||||
return Observable.fromEvent(element, event);
|
||||
return fromEvent(element, event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { fromEvent } from 'rxjs/observable/fromEvent';
|
||||
|
||||
export interface AdMobFreeBannerConfig {
|
||||
/**
|
||||
@@ -68,6 +67,9 @@ export interface AdMobFreeRewardVideoConfig {
|
||||
/**
|
||||
* @name AdMob Free
|
||||
* @description
|
||||
* A free, no ad-sharing version of Google AdMob plugin for Cordova.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-admob-free`. For more info, please see the [AdMob Free plugin docs](https://github.com/ratson/cordova-plugin-admob-free).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -147,7 +149,7 @@ export class AdMobFree extends IonicNativePlugin {
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
on(event: string): Observable<any> {
|
||||
return Observable.fromEvent(document, event);
|
||||
return fromEvent(document, event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name AES256
|
||||
* @description
|
||||
* This cordova ionic plugin allows you to perform AES 256 encryption and decryption on the plain text.
|
||||
* It's a cross-platform plugin which supports both Android and iOS.
|
||||
* The encryption and decryption are performed on the device native layer so that the performance is much faster.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AES256 } from '@ionic-native/aes-256';
|
||||
*
|
||||
*
|
||||
* constructor(private aES256: AES256) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.aES256.encrypt('12345678123456781234567812345678', '1234567812345678', 'testdata')
|
||||
* .then(res => console.log('Encrypted Data: ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.aES256.decrypt('12345678123456781234567812345678', '1234567812345678', 'encryptedData')
|
||||
* .then(res => console.log('Decrypted Data : ',res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AES256',
|
||||
plugin: 'cordova-plugin-aes256-encryption',
|
||||
pluginRef: 'cordova.plugins.AES256',
|
||||
repo: 'https://github.com/Ideas2IT/cordova-aes256',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic cordova plugin add cordova-plugin-aes256-encryption'
|
||||
})
|
||||
@Injectable()
|
||||
export class AES256 extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function used to perform the aes256 encryption
|
||||
* @param {string} secureKey A 32 bytes string, which will used as input key for AES256 encryption.
|
||||
* @param {string} secureIV A 16 bytes string, which will used as initial vector for AES256 encryption.
|
||||
* @param {string} data A string which will be encrypted
|
||||
* @return {Promise<string>} Returns a promise that resolves when encryption happens. The success response will returns encrypted data.
|
||||
*/
|
||||
@Cordova()
|
||||
encrypt(secureKey: string, secureIV: string, data: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to perform the aes256 decryption
|
||||
* @param {string} secureKey A 32 bytes string, which will used as input key for AES256 decryption.
|
||||
* @param {string} secureIV A 16 bytes string, which will used as initial vector for AES256 decryption.
|
||||
* @param {string} data An AES256 encrypted data which will be decrypted.
|
||||
* @return {Promise<string>} Returns a promise that resolves when decryption happens. The success response will returns decrypted data.
|
||||
*/
|
||||
@Cordova()
|
||||
decrypt(secureKey: string, secureIV: string, data: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -159,25 +159,47 @@ export interface AFADeleteOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidFingerprintAuth extends IonicNativePlugin {
|
||||
/**
|
||||
* Convenience property containing all possible errors
|
||||
*/
|
||||
ERRORS: {
|
||||
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION';
|
||||
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION';
|
||||
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED';
|
||||
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED';
|
||||
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR';
|
||||
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE';
|
||||
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED';
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST';
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION';
|
||||
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED';
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION';
|
||||
IO_EXCEPTION: 'IO_EXCEPTION';
|
||||
JSON_EXCEPTION: 'JSON_EXCEPTION';
|
||||
MINIMUM_SDK: 'MINIMUM_SDK';
|
||||
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS';
|
||||
MISSING_PARAMETERS: 'MISSING_PARAMETERS';
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION';
|
||||
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION';
|
||||
BAD_PADDING_EXCEPTION: string;
|
||||
CERTIFICATE_EXCEPTION: string;
|
||||
FINGERPRINT_CANCELLED: string;
|
||||
FINGERPRINT_DATA_NOT_DELETED: string;
|
||||
FINGERPRINT_ERROR: string;
|
||||
FINGERPRINT_NOT_AVAILABLE: string;
|
||||
FINGERPRINT_PERMISSION_DENIED: string;
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: string;
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: string;
|
||||
INIT_CIPHER_FAILED: string;
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: string;
|
||||
IO_EXCEPTION: string;
|
||||
JSON_EXCEPTION: string;
|
||||
MINIMUM_SDK: string;
|
||||
MISSING_ACTION_PARAMETERS: string;
|
||||
MISSING_PARAMETERS: string;
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: string;
|
||||
SECURITY_EXCEPTION: string;
|
||||
} = {
|
||||
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION',
|
||||
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION',
|
||||
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED',
|
||||
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED',
|
||||
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR',
|
||||
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE',
|
||||
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED',
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST',
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION',
|
||||
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED',
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION',
|
||||
IO_EXCEPTION: 'IO_EXCEPTION',
|
||||
JSON_EXCEPTION: 'JSON_EXCEPTION',
|
||||
MINIMUM_SDK: 'MINIMUM_SDK',
|
||||
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS',
|
||||
MISSING_PARAMETERS: 'MISSING_PARAMETERS',
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION',
|
||||
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION'
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,7 @@ export enum AndroidSystemUiFlags {
|
||||
*
|
||||
* this.androidFullScreen.isImmersiveModeSupported()
|
||||
* .then(() => console.log('Immersive mode supported'))
|
||||
* .catch(err => console.log(error));
|
||||
* .catch(err => console.log(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -37,28 +37,30 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
export class AppVersion extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Returns the name of the app
|
||||
* Returns the name of the app, e.g.: "My Awesome App"
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAppName(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns the package name of the app
|
||||
* Returns the package name of the app, e.g.: "com.example.myawesomeapp"
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getPackageName(): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Returns the build identifier of the app
|
||||
* @returns {Promise<string>}
|
||||
* Returns the build identifier of the app.
|
||||
* In iOS a string with the build version like "1.6095"
|
||||
* In Android a number generated from the version string, like 10203 for version "1.2.3"
|
||||
* @returns {Promise<string | number>}
|
||||
*/
|
||||
@Cordova()
|
||||
getVersionCode(): Promise<string> { return; }
|
||||
getVersionCode(): Promise<string | number> { return; }
|
||||
|
||||
/**
|
||||
* Returns the version of the app
|
||||
* Returns the version of the app, e.g.: "1.2.3"
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Appodeal
|
||||
|
||||
@@ -459,12 +459,13 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
* Method can be used to detect user changes in location services settings.
|
||||
* If user enable or disable location services then success callback will be executed.
|
||||
* In case or error (SettingNotFoundException) fail callback will be executed.
|
||||
* @returns {Promise<boolean>}
|
||||
* @returns {Observable<number>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
platforms: ['Android'],
|
||||
observable: true
|
||||
})
|
||||
watchLocationMode(): Promise<boolean> { return; }
|
||||
watchLocationMode(): Observable<number> { return; }
|
||||
|
||||
/**
|
||||
* Stop watching for location mode changes.
|
||||
|
||||
@@ -68,7 +68,7 @@ export interface BarcodeScanResult {
|
||||
| 'ITF'
|
||||
| 'RSS14'
|
||||
| 'RSS_EXPANDED'
|
||||
| 'PDF417'
|
||||
| 'PDF_417'
|
||||
| 'AZTEC'
|
||||
| 'MSI';
|
||||
cancelled: boolean;
|
||||
|
||||
@@ -289,6 +289,80 @@ export class BLE extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Establish an automatic connection to a peripheral. The phone will automatically connect to the Bluetooth peripheral
|
||||
* whenever it is in range. The autoConnect function uses callbacks instead of observables because connect and
|
||||
* disconnect can each be called many times as a devices connects and disconnects.
|
||||
*
|
||||
* On Android you can pass a MAC address directly to autoConnect. With iOS, you need to get a device id by scanning,
|
||||
* calling ble.peripheralsWithIdentifiers, or calling ble.connectedPeripheralsWithServices.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* someFunction() {
|
||||
* this.ble.autoConnect(deviceId, onConnected.bind(this), onDisconnected.bind(this));
|
||||
* }
|
||||
*
|
||||
* onConnected(peripheral) {
|
||||
* console.log(`Connected to ${peripheral.id}`)l
|
||||
* }
|
||||
*
|
||||
* onDisconnected(peripheral) {
|
||||
* console.log(`Disconnected from ${peripheral.id}`)l
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {function} connectCallback function that is called with peripheral data when the devices connects
|
||||
* @param {function} disconnectCallback function that is called with peripheral data when the devices disconnects
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
autoConnect(deviceId: string, connectCallback: any, disconnectCallback: any) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request MTU size.
|
||||
* May be used to fix the Error 14 "Unlikely" on write requests with more than 20 bytes.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.requestMtu('12:34:56:78:9A:BC', 512).then(() => {
|
||||
* console.log('MTU Size Accepted');
|
||||
* }, error => {
|
||||
* console.log('MTU Size Failed');
|
||||
* });
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {number} mtuSize The new MTU size. (23 - 517, default is usually 23. Max recommended: 512)
|
||||
* @return {Promise<any>} Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
requestMtu(deviceId: string, mtuSize: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh Device Cache
|
||||
* This method may fix a issue of old cached services and characteristics.
|
||||
* NOTE Since this uses an undocumented API it's not guaranteed to work.
|
||||
* If you choose a too low delay time (timeoutMillis) the method could fail.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.refreshDeviceCache('12:34:56:78:9A:BC', 10000).then(discoveredServices => {
|
||||
* console.log('The new discovered services after the clean: ', discoveredServices);
|
||||
* }, error => {
|
||||
* console.log('Refresh device cache failed.');
|
||||
* });
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {number} timeoutMillis Delay in milliseconds after refresh before discovering services.
|
||||
* @return {Promise<any>} Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
refreshDeviceCache(deviceId: string, timeoutMillis: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
* @usage
|
||||
@@ -514,4 +588,41 @@ export class BLE extends IonicNativePlugin {
|
||||
readRSSI(deviceId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a list of the peripherals (containing any of the specified services)
|
||||
* currently connected to the system. The peripheral list is sent to the success callback.
|
||||
* iOS only
|
||||
*
|
||||
* @param {string[]} services List of services to discover
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
connectedPeripheralsWithServices (services: string[]): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the connected peripherals offering the listed service UUIDs.
|
||||
* iOS only
|
||||
*
|
||||
* @param {string[]} uuids List of peripheral UUIDs
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
peripheralsWithIdentifiers (uuids: string[]): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the bonded devices
|
||||
* Android only
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
|
||||
*/
|
||||
@Cordova()
|
||||
bondedDevices (): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,11 +153,11 @@ export class Calendar extends IonicNativePlugin {
|
||||
/**
|
||||
* Create a calendar. (iOS only)
|
||||
*
|
||||
* @param {string | CalendarOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @param {string | NameOrOptions} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string
|
||||
* @returns {Promise<any>} Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
createCalendar(nameOrOptions: string | CalendarOptions): Promise<any> {
|
||||
createCalendar(nameOrOptions: string | NameOrOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface CallDirectoryItem {
|
||||
label: string;
|
||||
number: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Call Directory
|
||||
* @description
|
||||
* This plugin can add phone numbers to an Callkit call directory extension. Call `reloadExtension` after using `addIdentification` and `removeIdentification`
|
||||
* to process the changes in the call directory extension.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CallDirectory } from '@ionic-native/call-directory';
|
||||
*
|
||||
*
|
||||
* constructor(private callDirectory: CallDirectory) { }
|
||||
*
|
||||
*
|
||||
* let items = [{label: "Hello", number: "123"}];
|
||||
* this.callDirectory.addIdentification(items)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.callDirectory.reloadExtension()
|
||||
* .then(res: string) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CallDirectory',
|
||||
plugin: 'cordova-plugin-call-directory',
|
||||
pluginRef: 'CallDirectory',
|
||||
repo: 'https://github.com/GEDYSIntraWare/cordova-plugin-call-directory',
|
||||
install: 'cordova plugin add cordova-plugin-call-directory --variable EXT_NAME="Cordova-Directory" --variable ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES="NO"',
|
||||
installVariables: ['EXT_NAME', 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'],
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CallDirectory extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check if the call directory extension is available and enabled
|
||||
* @return {Promise<boolean>} Returns a promise with result
|
||||
*/
|
||||
@Cordova()
|
||||
isAvailable(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add identification numbers
|
||||
* @param {Array<CallDirectoryItem>} items Set of numbers with labels
|
||||
* @return {Promise<any>} Returns a promise that resolves when numbers are added
|
||||
*/
|
||||
@Cordova()
|
||||
addIdentification(items: Array<CallDirectoryItem>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove identification numbers
|
||||
* @param {Array<CallDirectoryItem>} items Set of numbers with arbitrary label
|
||||
* @return {Promise<any>} Returns a promise that resolves when numbers are removed
|
||||
*/
|
||||
@Cordova()
|
||||
removeIdentification(items: Array<CallDirectoryItem>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all items from call directory. Refreshes immediately.
|
||||
* @return {Promise<any>} Returns a promise after refresh with message
|
||||
*/
|
||||
@Cordova()
|
||||
removeAllIdentification(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all numbers and labels in call directory
|
||||
* @return {Array<CallDirectoryItem>} Returns a promise that resolves with an array of all items
|
||||
*/
|
||||
@Cordova()
|
||||
getAllItems(): Promise<Array<CallDirectoryItem>> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload extension to process queued changes
|
||||
* @return {Promise<string>} Returns a promise after refresh with message
|
||||
*/
|
||||
@Cordova()
|
||||
reloadExtension(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -48,9 +48,7 @@ export class CallNumber extends IonicNativePlugin {
|
||||
* Check if call feature is available
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
@Cordova()
|
||||
isCallSupported(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface CameraOptions {
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in Camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string,
|
||||
* DATA_URL : 0, Return image as base64-encoded string (DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible),
|
||||
* FILE_URI : 1, Return image file URI,
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
@@ -139,14 +139,14 @@ export enum Direction {
|
||||
*
|
||||
* const options: CameraOptions = {
|
||||
* quality: 100,
|
||||
* destinationType: this.camera.DestinationType.DATA_URL,
|
||||
* destinationType: this.camera.DestinationType.FILE_URI,
|
||||
* encodingType: this.camera.EncodingType.JPEG,
|
||||
* mediaType: this.camera.MediaType.PICTURE
|
||||
* }
|
||||
*
|
||||
* this.camera.getPicture(options).then((imageData) => {
|
||||
* // imageData is either a base64 encoded string or a file URI
|
||||
* // If it's base64:
|
||||
* // If it's base64 (DATA_URL):
|
||||
* let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
* }, (err) => {
|
||||
* // Handle error
|
||||
|
||||
@@ -129,6 +129,12 @@ export interface CardIOResponse {
|
||||
* @name Card IO
|
||||
* @description
|
||||
* @usage
|
||||
* This plug-in exposes card.io credit card scanning.
|
||||
*
|
||||
* **NOTE**: If you would like to actually process a credit card charge, you might be interested in the [PayPal Cordova Plug-in](https://github.com/paypal/PayPal-Cordova-Plugin).
|
||||
*
|
||||
* Requires Cordova plugin: `card.io.cordova.mobilesdk`. For more info, please see the [Card IO plugin docs](https://github.com/card-io/card.io-Cordova-Plugin).
|
||||
*
|
||||
* Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element.
|
||||
* ```xml
|
||||
*<key>NSCameraUsageDescription</key>
|
||||
@@ -151,7 +157,7 @@ export interface CardIOResponse {
|
||||
* requireCVV: false,
|
||||
* requirePostalCode: false
|
||||
* };
|
||||
* CardIO.scan(options);
|
||||
* this.cardIO.scan(options);
|
||||
* }
|
||||
* }
|
||||
* );
|
||||
|
||||
@@ -25,6 +25,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* alert('Error: ' + reject);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* this.clipboard.clear();
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -52,4 +54,11 @@ export class Clipboard extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
paste(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Clear the text stored in clipboard
|
||||
* @returns {Promise<any>} Returns a promise after the text has been cleaned
|
||||
*/
|
||||
@Cordova()
|
||||
clear(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Cloud Settings
|
||||
* @description
|
||||
* Stores app settings in cloud storage so if the user re-installs the app or installs it on a different device, the settings will be restored and available in the new installation.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CloudSettings } from '@ionic-native/cloud-settings';
|
||||
*
|
||||
*
|
||||
* constructor(private cloudSettings: CloudSettings) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.cloudSettings.exists()
|
||||
* .then((exists: boolean) => console.log("Saved settings exist: " + exists) )
|
||||
*
|
||||
* this.cloudSettings.load()
|
||||
* .then((settings: any) => this.settings = settings)
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.cloudSettings.save(this.settings)
|
||||
* .then((savedSettings: any) => console.log("Saved settings: " + JSON.stringify(savedSettings)))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CloudSettings',
|
||||
plugin: 'cordova-plugin-cloud-settings',
|
||||
pluginRef: 'cordova.plugin.cloudsettings',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-cloud-settings',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-cloud-settings --variable ANDROID_BACKUP_SERVICE_KEY=myapikey',
|
||||
installVariables: ['ANDROID_BACKUP_SERVICE_KEY'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CloudSettings extends IonicNativePlugin {
|
||||
/**
|
||||
* Indicates if any stored cloud settings currently exist for the current user.
|
||||
* @return {Promise<boolean>} Will be passed a boolean flag which indicates whether an store settings exist for the user.
|
||||
*/
|
||||
@Cordova()
|
||||
exists(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the settings to cloud backup.
|
||||
* @param {object} settings - a JSON structure representing the user settings to save to cloud backup.
|
||||
* @param {boolean} [overwrite] - (optional) if true, existing settings will be replaced rather than updated. Defaults to false.
|
||||
* If false, existing settings will be merged with the new settings passed to this function.
|
||||
* @return {Promise<any>} Will be passed a single object argument which contains the saved settings as a JSON object.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
save(settings: any, overwrite?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the current settings.
|
||||
* @return {Promise<any>} Will be passed a single object argument which contains the saved settings as a JSON object.
|
||||
*/
|
||||
@Cordova()
|
||||
load(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a function which will be called if/when settings on the device have been updated from the cloud.
|
||||
* @param {Function} handler - callback function to invoke when device settings have been updated from the cloud.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
onRestore(handler: Function): void {}
|
||||
|
||||
/**
|
||||
* Outputs verbose log messages from the native plugin components to the JS console.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
enableDebug(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -45,12 +45,12 @@ export interface DeeplinkOptions {
|
||||
* '/about-us': AboutPage,
|
||||
* '/universal-links-test': AboutPage,
|
||||
* '/products/:productId': ProductPage
|
||||
* }).subscribe((match) => {
|
||||
* }).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 => {
|
||||
* // nomatch.$link - the full link data
|
||||
* console.error('Got a deeplink that didn\'t match', nomatch);
|
||||
* });
|
||||
@@ -63,12 +63,12 @@ export interface DeeplinkOptions {
|
||||
* this.deeplinks.routeWithNavController(this.navController, {
|
||||
* '/about-us': AboutPage,
|
||||
* '/products/:productId': ProductPage
|
||||
* }).subscribe((match) => {
|
||||
* }).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 => {
|
||||
* // nomatch.$link - the full link data
|
||||
* console.error('Got a deeplink that didn\'t match', nomatch);
|
||||
* });
|
||||
|
||||
@@ -10,9 +10,9 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { IOSDocumentPicker } from '@ionic-native/document-picker';
|
||||
* import { DocumentPicker } from '@ionic-native/document-picker';
|
||||
*
|
||||
* constructor(private docPicker: IOSDocumentPicker) { }
|
||||
* constructor(private docPicker: DocumentPicker) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
|
||||
@@ -286,24 +286,4 @@ export class Facebook extends IonicNativePlugin {
|
||||
@Cordova()
|
||||
logPurchase(value: number, currency: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Open App Invite dialog. Does not require login.
|
||||
*
|
||||
* For more information see:
|
||||
*
|
||||
* the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview
|
||||
* the App Links docs - https://developers.facebook.com/docs/applinks
|
||||
*
|
||||
*
|
||||
* @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL.
|
||||
* @param {string} options.url [App Link](https://developers.facebook.com/docs/applinks) to your app
|
||||
* @param {string} [options.picture] image to be displayed in the App Invite dialog
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the result data, or rejects with an error
|
||||
*/
|
||||
@Cordova()
|
||||
appInvite(options: {
|
||||
url: string,
|
||||
picture: string
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface IOSFilePickerPosition {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* @name iOS File Picker
|
||||
* @description
|
||||
@@ -20,6 +27,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
* .catch(err => console.log('Error', err));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IOSFilePickerPosition
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'iOS File Picker',
|
||||
@@ -32,10 +41,17 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
export class IOSFilePicker extends IonicNativePlugin {
|
||||
/**
|
||||
* Open a file
|
||||
* @params {string | string[]} [utis]
|
||||
* @params {IOSFilePickerPosition} [position] Set the position of the rectangle where the file picker should show up.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
pickFile(): Promise<string> {
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
pickFile(
|
||||
utis?: string | string[],
|
||||
position?: IOSFilePickerPosition
|
||||
): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ declare const window: Window;
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.file.checkDir(this.file.dataDirectory, 'mydir').then(_ => console.log('Directory exists')).catch(err => console.log('Directory doesn't exist'));
|
||||
* this.file.checkDir(this.file.dataDirectory, 'mydir').then(_ => console.log('Directory exists')).catch(err => console.log('Directory doesn\'t exist'));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Config
|
||||
* @description
|
||||
* Cordova plugin for Firebase Config
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FirebaseConfig } from '@ionic-native/firebase-config';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseConfig: FirebaseConfig) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.firebaseConfig.getBoolean('my_key')
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseConfig',
|
||||
plugin: 'cordova-plugin-firebase-config',
|
||||
pluginRef: 'cordova.plugins.firebase.config',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-config',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseConfig extends IonicNativePlugin {
|
||||
/**
|
||||
* Fetches remote config values with appropriate TTL and then activates them.
|
||||
*
|
||||
* @param {number} ttlSeconds
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
update(ttlSeconds: number): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a boolean configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBoolean(key: string, namespace?: string): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a string configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getString(key: string, namespace?: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a numeric configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getNumber(key: string, namespace?: string): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an array of bytes configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBytes(key: string, namespace?: string): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,10 @@ export interface IDynamicLink {
|
||||
*
|
||||
*config.xml:
|
||||
* ```xml
|
||||
* <platform name="android">
|
||||
* <platform name="ios">
|
||||
* <preference name="GoogleIOSClientId" value="..." />
|
||||
* </platform>
|
||||
* <platform name="ios">
|
||||
* <platform name="android">
|
||||
* <preference name="GoogleAndroidClientId" value="..." />
|
||||
* </platform>
|
||||
* ```
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IFirebaseMessage {
|
||||
aps: any;
|
||||
gcm: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Messaging
|
||||
* @description
|
||||
* Cordova plugin for Firebase Messaging
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FirebaseMessaging } from '@ionic-native/firebase-messaging';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseMessaging: FirebaseMessaging) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.firebaseMessaging.logEvent('page_view', {page: "dashboard"})
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IFirebaseMessage
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseMessaging',
|
||||
plugin: 'cordova-plugin-firebase-messaging',
|
||||
pluginRef: 'cordova.plugins.firebase.messaging',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseMessaging extends IonicNativePlugin {
|
||||
/**
|
||||
* Called when a push message received while app is in foreground.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onMessage(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a push message received while app is in background.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onBackgroundMessage(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permission to recieve push notifications (will trigger prompt on iOS).
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
requestPermission(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that fulfills with the current FCM token
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getToken(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers every time when FCM token updated.
|
||||
* You should usually call getToken to get an updated token and send it to server.
|
||||
*
|
||||
* @returns {Observable<void>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onTokenRefresh(): Observable<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to topic in background.
|
||||
*
|
||||
* @param {string} topic
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
subscribe(topic: string): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from topic in background.
|
||||
*
|
||||
* @param {string} topic
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
unsubscribe(topic: string): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads current badge number (if supported).
|
||||
*
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBadge(): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets current badge number (if supported).
|
||||
*
|
||||
* @param {number} value
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setBadge(value: number): Promise<null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase
|
||||
* @description
|
||||
* This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported (including iOS 10).
|
||||
@@ -36,10 +35,10 @@ import { Observable } from 'rxjs/Observable';
|
||||
export class Firebase extends IonicNativePlugin {
|
||||
/**
|
||||
* Get the device token
|
||||
* @return {Promise<any>}
|
||||
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
|
||||
*/
|
||||
@Cordova()
|
||||
getToken(): Promise<any> {
|
||||
getToken(): Promise<null | string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,35 +270,33 @@ export class Firebase extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param {string} phoneNumber
|
||||
* @returns {Promise<any>}
|
||||
* Start a trace.
|
||||
* @param {string} trace Trace name
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS']
|
||||
})
|
||||
getVerificationID(phoneNumber: string): Promise<any> {
|
||||
@Cordova()
|
||||
startTrace(trace: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param {string} phoneNumber The phone number, including '+' and country code
|
||||
* @param {number} timeoutDuration The timeout in sec - no more SMS will be sent to this number until this timeout expires
|
||||
* @returns {Promise<any>}
|
||||
* To count the performance-related events that occur in your app (such as cache hits or retries), add a line of code
|
||||
* similar to the following whenever the event occurs, using a string other than retry to name that event if you are
|
||||
* counting a different type of event:
|
||||
* @param {string} trace Trace name
|
||||
* @param {string} counter Counter
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
verifyPhoneNumber(
|
||||
phoneNumber: string,
|
||||
timeoutDuration: number
|
||||
): Promise<any> {
|
||||
@Cordova()
|
||||
incrementCounter(trace: string, counter: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the trace
|
||||
* @param {string} trace Trace name
|
||||
*/
|
||||
@Cordova()
|
||||
stopTrace(trace: string): void {}
|
||||
|
||||
/**
|
||||
* Allows the user to enable/disable analytics collection
|
||||
* @param {boolean} enabled value to set collection
|
||||
@@ -309,4 +306,22 @@ export class Firebase extends IonicNativePlugin {
|
||||
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param {string} phoneNumber The phone number, including '+' and country code
|
||||
* @param {number} timeoutDuration (Android only) The timeout in sec - no more SMS will be sent to this number until this timeout expires
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
verifyPhoneNumber(
|
||||
phoneNumber: string,
|
||||
timeoutDuration: number = 0
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name FTP
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name google-nearby
|
||||
* @name Google Nearby
|
||||
* @description
|
||||
* This plugin adds support for the Google Nearby Messages API.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name hce
|
||||
* @description
|
||||
* HCE Cordova Wrapper
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { hce } from '@ionic-native/hce';
|
||||
*
|
||||
*
|
||||
* constructor(private hce: hce) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* function onCommand(command){
|
||||
* var commandAsBytes = new Uint8Array(command);
|
||||
* var commandAsString = hce.util.byteArrayToHexString(commandAsBytes);
|
||||
*
|
||||
* // do something with the command
|
||||
*
|
||||
* // send the response
|
||||
* hce.sendReponse(commandResponse);
|
||||
* }
|
||||
* this.hce.registerCommandCallback().then(onCommand);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'hce',
|
||||
plugin: 'cordova-plugin-hce',
|
||||
pluginRef: 'hce',
|
||||
repo: 'https://github.com/don/cordova-plugin-hce',
|
||||
install: '',
|
||||
installVariables: ['AID_FILTER'],
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class HCE extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Registers command receiver.
|
||||
* @param onCommand {HCECommandEvent} The event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerCommandCallback(onCommand: HCECommandEvent, fail?: Function): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
/**
|
||||
* Registers Deactivated receiver.
|
||||
* @param ok {HCEDeactivatedEvent} Success event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerDeactivatedCallback(ok: HCEDeactivatedEvent, fail?: Function): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends response APDU.
|
||||
* @param response {Uint8Array} Response
|
||||
* @param success {string} Success Callback.
|
||||
* @param success {string} Failure Callback.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
sendResponse(response: Uint8Array, success?: Function, failure?: Function): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
}
|
||||
|
||||
export interface HCECommandEvent { (command: Uint8Array): void; }
|
||||
export interface HCEDeactivatedEvent { (command: number): void; }
|
||||
@@ -1,127 +1,81 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface HealthKitOptions {
|
||||
/**
|
||||
* HKWorkoutActivityType constant
|
||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||
*/
|
||||
* HKWorkoutActivityType constant
|
||||
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||
*/
|
||||
* 'hour', 'week', 'year' or 'day', default 'day'
|
||||
*/
|
||||
aggregation?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
amount?: number;
|
||||
|
||||
/**
|
||||
* specifies if the data returned by querySampleType() should be sorted by
|
||||
* end date in ascending order, default is false
|
||||
*/
|
||||
* specifies if the data returned by querySampleType() should be sorted by
|
||||
* end date in ascending order, default is false
|
||||
*/
|
||||
ascending?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
correlationType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
date?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
distance?: number;
|
||||
|
||||
/**
|
||||
* probably useful with the former param
|
||||
*/
|
||||
* probably useful with the former param
|
||||
*/
|
||||
distanceUnit?: string;
|
||||
|
||||
/**
|
||||
* in seconds, optional, use either this or endDate
|
||||
*/
|
||||
* in seconds, optional, use either this or endDate
|
||||
*/
|
||||
duration?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
endDate?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
energy?: number;
|
||||
|
||||
/**
|
||||
* J|cal|kcal
|
||||
*/
|
||||
* J|cal|kcal
|
||||
*/
|
||||
energyUnit?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
extraData?: any;
|
||||
|
||||
/**
|
||||
* limits the maximum number of records returned by querySampleType()
|
||||
*/
|
||||
* limits the maximum number of records returned by querySampleType()
|
||||
*/
|
||||
limit?: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
metadata?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
quantityType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
readTypes?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
requestWritePermission?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
samples?: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
sampleType?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
startDate?: any;
|
||||
|
||||
/**
|
||||
* m|cm|mm|in|ft
|
||||
*/
|
||||
* m|cm|mm|in|ft
|
||||
*/
|
||||
unit?: string;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
requestReadPermission?: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
writeTypes?: any;
|
||||
}
|
||||
|
||||
@@ -153,168 +107,207 @@ export interface HealthKitOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class HealthKit extends IonicNativePlugin {
|
||||
/**
|
||||
* Check if HealthKit is supported (iOS8+, not on iPad)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
available(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if HealthKit is supported (iOS8+, not on iPad)
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in a type and get back on of undetermined | denied | authorized
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
available(): Promise<any> { return; }
|
||||
checkAuthStatus(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in a type and get back on of undetermined | denied | authorized
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Ask some or all permissions up front
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
checkAuthStatus(options: HealthKitOptions): Promise<any> { return; }
|
||||
requestAuthorization(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask some or all permissions up front
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Formatted as yyyy-MM-dd
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestAuthorization(options: HealthKitOptions): Promise<any> { return; }
|
||||
readDateOfBirth(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formatted as yyyy-MM-dd
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = male|female|other|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readDateOfBirth(): Promise<any> { return; }
|
||||
readGender(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = male|female|other|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readGender(): Promise<any> { return; }
|
||||
readBloodType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Output = I|II|III|IV|V|VI|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readBloodType(): Promise<any> { return; }
|
||||
readFitzpatrickSkinType(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output = I|II|III|IV|V|VI|unknown
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readFitzpatrickSkinType(): Promise<any> { return; }
|
||||
saveWeight(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveWeight(options: HealthKitOptions): Promise<any> { return; }
|
||||
readWeight(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readWeight(options: HealthKitOptions): Promise<any> { return; }
|
||||
saveHeight(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveHeight(options: HealthKitOptions): Promise<any> { return; }
|
||||
readHeight(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
* no params yet, so this will return all workouts ever of any type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
readHeight(options: HealthKitOptions): Promise<any> { return; }
|
||||
findWorkouts(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* no params yet, so this will return all workouts ever of any type
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
findWorkouts(): Promise<any> { return; }
|
||||
saveWorkout(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveWorkout(options: HealthKitOptions): Promise<any> { return; }
|
||||
querySampleType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
querySampleType(options: HealthKitOptions): Promise<any> { return; }
|
||||
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { return; }
|
||||
deleteSamples(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteSamples(options: HealthKitOptions): Promise<any> { return; }
|
||||
monitorSampleType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
monitorSampleType(options: HealthKitOptions): Promise<any> { return; }
|
||||
sumQuantityType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sumQuantityType(options: HealthKitOptions): Promise<any> { return; }
|
||||
saveQuantitySample(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveQuantitySample(options: HealthKitOptions): Promise<any> { return; }
|
||||
saveCorrelation(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
saveCorrelation(options: HealthKitOptions): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @param options {HealthKitOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
queryCorrelationType(options: HealthKitOptions): Promise<any> { return; }
|
||||
|
||||
|
||||
queryCorrelationType(options: HealthKitOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,12 @@ export interface HealthQueryOptionsAggregated {
|
||||
* supported values are: 'hour', 'day', 'week', 'month', 'year'.
|
||||
*/
|
||||
bucket: string;
|
||||
|
||||
/**
|
||||
* In Android, it is possible to query for "raw" steps or to select those as filtered by the Google Fit app.
|
||||
* In the latter case the query object must contain the field filtered: true.
|
||||
*/
|
||||
filtered?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,7 +241,7 @@ export class Health extends IonicNativePlugin {
|
||||
* been given at some point in the past.
|
||||
*
|
||||
* Quirks of requestAuthorization()
|
||||
|
||||
*
|
||||
* In Android, it will try to get authorization from the Google Fit APIs.
|
||||
* It is necessary that the app's package name and the signing key are registered in the Google API console.
|
||||
* In Android, be aware that if the activity is destroyed (e.g. after a rotation) or is put in background,
|
||||
@@ -292,11 +298,11 @@ export class Health extends IonicNativePlugin {
|
||||
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
|
||||
* Automatic conversion is not trivial and depends on the actual substance.
|
||||
*
|
||||
* @param queryOptions {HealthQueryOptions}
|
||||
* @return {Promise<HealthData>}
|
||||
* @param {HealthQueryOptions} queryOptions
|
||||
* @return {Promise<HealthData[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
query(queryOptions: HealthQueryOptions): Promise<HealthData> { return; }
|
||||
query(queryOptions: HealthQueryOptions): Promise<HealthData[]> { return; }
|
||||
|
||||
/**
|
||||
* Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity.
|
||||
@@ -316,7 +322,7 @@ export class Health extends IonicNativePlugin {
|
||||
* To be sure to get all the stored quantities, it's better to query single nutrients.
|
||||
* nutrition.vitamin_a is given in micrograms in HealthKit and International Unit in Google Fit.
|
||||
*
|
||||
* @param queryOptionsAggregated {HealthQueryOptionsAggregated}
|
||||
* @param {HealthQueryOptionsAggregated} queryOptionsAggregated
|
||||
* @return {Promise<HealthData[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
|
||||
@@ -105,6 +105,10 @@ export interface HotspotDevice {
|
||||
* @beta
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* A Cordova plugin for managing Hotspot networks on Android.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-hotspot`. For more info, please see the [Hotspot plugin docs](https://github.com/hypery2k/cordova-hotspot-plugin).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Hotspot, HotspotNetwork } from '@ionic-native/hotspot';
|
||||
|
||||
@@ -481,7 +481,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
startMonitoringForRegion(region: BeaconRegion): Promise<string> { return; }
|
||||
startMonitoringForRegion(region: Region): Promise<string> { return; }
|
||||
|
||||
/**
|
||||
* Stop monitoring the specified region. It is valid to call
|
||||
@@ -498,7 +498,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
stopMonitoringForRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
stopMonitoringForRegion(region: Region): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Request state the for specified region. When result is ready
|
||||
@@ -532,7 +532,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
* native layer acknowledged the dispatch of the monitoring request.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
startRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
startRangingBeaconsInRegion(region: Region): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging the specified region. It is valid to call
|
||||
@@ -549,7 +549,7 @@ export class IBeacon extends IonicNativePlugin {
|
||||
* native layer acknowledged the dispatch of the request to stop monitoring.
|
||||
*/
|
||||
@Cordova({ otherPromise: true })
|
||||
stopRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
|
||||
stopRangingBeaconsInRegion(region: Region): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Queries the native layer to determine the current authorization in effect.
|
||||
|
||||
@@ -23,11 +23,19 @@ export interface ImagePickerOptions {
|
||||
quality?: number;
|
||||
|
||||
/**
|
||||
* Output type, defaults to 0 (FILE_URI).
|
||||
* Choose the format of the return value.
|
||||
* Defined in ImagePicker.OutputType. Default is FILE_URI.
|
||||
* FILE_URI : 0, Return image file URI,
|
||||
* DATA_URL : 1, Return image as base64-encoded string
|
||||
*/
|
||||
outputType?: number;
|
||||
}
|
||||
|
||||
export enum OutputType {
|
||||
FILE_URL = 0,
|
||||
DATA_URL
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Image Picker
|
||||
* @description
|
||||
|
||||
@@ -49,6 +49,8 @@ export interface InAppBrowserOptions {
|
||||
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
|
||||
/** (iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window. */
|
||||
toolbarposition?: 'top' | 'bottom';
|
||||
/** (iOS Only) Set to yes or no to change the visibility of the loading indicator (defaults to no). */
|
||||
hidespinner?: 'yes' | 'no';
|
||||
/** (Windows only) Set to yes to create the browser control without a border around it.
|
||||
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
|
||||
fullscreen?: 'yes';
|
||||
|
||||
@@ -46,7 +46,7 @@ import { Injectable } from '@angular/core';
|
||||
* alert('Store Error ' + JSON.stringify(err));
|
||||
* });
|
||||
*
|
||||
* this.store.ready().then((status) => {
|
||||
* this.store.ready(() => {
|
||||
* console.log(JSON.stringify(this.store.get(productId)));
|
||||
* console.log('Store is Ready: ' + JSON.stringify(status));
|
||||
* console.log('Products: ' + JSON.stringify(this.store.products));
|
||||
@@ -416,12 +416,8 @@ export class InAppPurchase2 extends IonicNativePlugin {
|
||||
@Cordova({ sync: true })
|
||||
order(product: string | IAPProduct, additionalData?: any): { then: Function; error: Function; } { return; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @return {Promise<any>} returns a promise that resolves when the store is ready
|
||||
*/
|
||||
@Cordova()
|
||||
ready(): Promise<void> { return; }
|
||||
ready(callback: Function): void { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
refresh(): void {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IndexItem {
|
||||
domain: string;
|
||||
@@ -84,7 +85,7 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
/**
|
||||
* Add or change items to spotlight index
|
||||
* @param {Array<IndexItem>} Array of items to index
|
||||
* @return {Promise<any>} Returns if index set was successfull
|
||||
* @return {Promise<any>} Returns if index set was successful
|
||||
*/
|
||||
@Cordova()
|
||||
setItems(items: Array<IndexItem>): Promise<any> {
|
||||
@@ -94,7 +95,7 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
/**
|
||||
* Clear all items stored for a given array of domains
|
||||
* @param {Array<string>} Array of domains to clear
|
||||
* @return {Promise<any>} Resolve if successfull
|
||||
* @return {Promise<any>} Resolve if successful
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForDomains(domains: Array<string>): Promise<any> {
|
||||
@@ -104,13 +105,23 @@ export class IndexAppContent extends IonicNativePlugin {
|
||||
/**
|
||||
* Clear all items stored for a given array of identifiers
|
||||
* @param {Array<string>} Array of identifiers to clear
|
||||
* @return {Promise<any>} Resolve if successfull
|
||||
* @return {Promise<any>} Resolve if successful
|
||||
*/
|
||||
@Cordova()
|
||||
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If user taps on a search result in spotlight then the app will be launched.
|
||||
* You can register a Javascript handler to get informed when this happens.
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onItemPressed(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* You might want to avoid to update spotlight index too frequently.
|
||||
* Without calling this function a subsequent call to manipulate the index is only possible after 1440 minutes (= 24 hours)!
|
||||
|
||||
@@ -6,6 +6,10 @@ import { Observable } from 'rxjs/Observable';
|
||||
/**
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* Keyboard plugin for Cordova.
|
||||
*
|
||||
* Requires Cordova plugin: `ionic-plugin-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/ionic-plugin-keyboard).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Keyboard } from '@ionic-native/keyboard';
|
||||
|
||||
@@ -24,7 +24,7 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
|
||||
* // login
|
||||
* const scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
|
||||
* this.linkedin.login(scopes, true)
|
||||
* .then(() => console.log('Logged in!')
|
||||
* .then(() => console.log('Logged in!'))
|
||||
* .catch(e => console.log('Error logging in', e));
|
||||
*
|
||||
*
|
||||
|
||||
@@ -125,7 +125,7 @@ export interface ILocalNotificationAction {
|
||||
/**
|
||||
* Specifies whether the action causes the app to launch in the foreground
|
||||
*/
|
||||
launch?: boolean;
|
||||
foreground?: boolean;
|
||||
|
||||
/**
|
||||
* If the value is 'decline' the action is displayed with special highlighting to indicate that it performs a destructive task
|
||||
@@ -397,6 +397,7 @@ export interface ILocalNotification {
|
||||
* Set the token for the media session
|
||||
*/
|
||||
mediaSession?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,6 +115,10 @@ export interface ConfigurationData {
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* This plugin provides access to the device's audio, image, and video capture capabilities.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-media-capture`. For more info, please see the [Media Capture plugin docs](https://github.com/apache/cordova-plugin-media-capture).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture';
|
||||
|
||||
@@ -8,23 +8,29 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from '@ionic-native/native-geocoder';
|
||||
* import { NativeGeocoder, NativeGeocoderReverseResult, NativeGeocoderForwardResult, NativeGeocoderOptions } from '@ionic-native/native-geocoder';
|
||||
*
|
||||
* constructor(private nativeGeocoder: NativeGeocoder) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818)
|
||||
* .then((result: NativeGeocoderReverseResult) => console.log(JSON.stringify(result)))
|
||||
* let options: NativeGeocoderOptions = {
|
||||
* useLocale: true,
|
||||
* maxResults: 5
|
||||
* };
|
||||
*
|
||||
* this.nativeGeocoder.reverseGeocode(52.5072095, 13.1452818, options)
|
||||
* .then((result: NativeGeocoderReverseResult[]) => console.log(JSON.stringify(result[0])))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* this.nativeGeocoder.forwardGeocode('Berlin')
|
||||
* .then((coordinates: NativeGeocoderForwardResult) => console.log('The coordinates are latitude=' + coordinates.latitude + ' and longitude=' + coordinates.longitude))
|
||||
* this.nativeGeocoder.forwardGeocode('Berlin', options)
|
||||
* .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude))
|
||||
* .catch((error: any) => console.log(error));
|
||||
* ```
|
||||
* @interfaces
|
||||
* NativeGeocoderReverseResult
|
||||
* NativeGeocoderForwardResult
|
||||
* NativeGeocoderOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NativeGeocoder',
|
||||
@@ -40,22 +46,24 @@ export class NativeGeocoder extends IonicNativePlugin {
|
||||
* Reverse geocode a given latitude and longitude to find location address
|
||||
* @param latitude {number} The latitude
|
||||
* @param longitude {number} The longitude
|
||||
* @return {Promise<NativeGeocoderReverseResult>}
|
||||
* @param options {NativeGeocoderOptions} The options
|
||||
* @return {Promise<NativeGeocoderReverseResult[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
reverseGeocode(latitude: number, longitude: number): Promise<NativeGeocoderReverseResult> { return; }
|
||||
reverseGeocode(latitude: number, longitude: number, options?: NativeGeocoderOptions): Promise<NativeGeocoderReverseResult[]> { return; }
|
||||
|
||||
/**
|
||||
* Forward geocode a given address to find coordinates
|
||||
* @param addressString {string} The address to be geocoded
|
||||
* @return {Promise<NativeGeocoderForwardResult>}
|
||||
* @param options {NativeGeocoderOptions} The options
|
||||
* @return {Promise<NativeGeocoderForwardResult[]>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
forwardGeocode(addressString: string): Promise<NativeGeocoderForwardResult> { return; }
|
||||
forwardGeocode(addressString: string, options?: NativeGeocoderOptions): Promise<NativeGeocoderForwardResult[]> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,3 +124,25 @@ export interface NativeGeocoderForwardResult {
|
||||
*/
|
||||
longitude: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for reverse and forward geocoding.
|
||||
*/
|
||||
export interface NativeGeocoderOptions {
|
||||
/**
|
||||
* The locale to use when returning the address information.
|
||||
* If set to 'false' the locale will always be 'en_US'.
|
||||
* Default is 'true'
|
||||
*/
|
||||
useLocale: boolean;
|
||||
/**
|
||||
* The default locale to use when returning the address information.
|
||||
* e.g.: 'fa-IR' or 'de_DE'.
|
||||
*/
|
||||
defaultLocale?: string;
|
||||
/**
|
||||
* The maximum number of result to return (max is 5).
|
||||
* Default is 1
|
||||
*/
|
||||
maxResults: number;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
* @beta
|
||||
* @name Navigation Bar
|
||||
* @description
|
||||
* The NavigationBar plugin can you to hide and auto hide the android navigation bar.
|
||||
* The NavigationBar plugin allows you to hide and auto hide the android navigation bar.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -10,15 +10,21 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* ```typescript
|
||||
* import { NetworkInterface } from '@ionic-native/network-interface';
|
||||
*
|
||||
* constructor( private networkInterface: NetworkInterface ) {
|
||||
*
|
||||
* constructor(private networkInterface: NetworkInterface) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.networkInterface.getWiFiIPAddress(function (ip) { alert(ip); });
|
||||
* this.networkInterface.getCarrierIPAddress(function (ip) { alert(ip); });
|
||||
* this.networkInterface.getWiFiIPAddress()
|
||||
* .then(address => console.info(`IP: ${address.ip}, Subnet: ${address.subnet}`))
|
||||
* .catch(error => console.error(`Unable to get IP: ${error}`));
|
||||
*
|
||||
* this.networkInterface.getCarrierIPAddress() {
|
||||
* .then(address => console.info(`IP: ${address.ip}, Subnet: ${address.subnet}`))
|
||||
* .catch(error => console.error(`Unable to get IP: ${error}`));
|
||||
*
|
||||
* const url = 'www.github.com';
|
||||
* this.networkInterface.getHttpProxyInformation(url)
|
||||
* .then(proxy => console.info(`Type: ${proxy.type}, Host: ${proxy.host}, Port: ${proxy.port}`))
|
||||
* .catch(error => console.error(`Unable to get proxy info: ${error}`));
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -31,28 +37,32 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
@Injectable()
|
||||
export class NetworkInterface extends IonicNativePlugin {
|
||||
|
||||
@Cordova()
|
||||
getIPAddress(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the WiFi IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
* @return {Promise<any>} Returns a Promise that resolves with the IP address information.
|
||||
*/
|
||||
@Cordova()
|
||||
getWiFiIPAddress(): Promise<string> {
|
||||
getWiFiIPAddress(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wireless carrier IP address
|
||||
* @param success {Function} Callback used when successful
|
||||
* @param error {Function} Callback used when failure
|
||||
* @return {Promise<any>} Returns a Promise that resolves with the IP address information.
|
||||
*/
|
||||
@Cordova()
|
||||
getCarrierIPAddress(): Promise<string> {
|
||||
getCarrierIPAddress(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the relevant proxies for the passed URL in order of application
|
||||
* @param {url} message The message to display.
|
||||
* @return {Promise<any>} Returns a Promise that resolves with the proxy information.
|
||||
*/
|
||||
@Cordova()
|
||||
getHttpProxyInformation(url: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaProperty, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||
import {
|
||||
Cordova,
|
||||
CordovaProperty,
|
||||
Plugin,
|
||||
CordovaCheck,
|
||||
IonicNativePlugin
|
||||
} from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/merge';
|
||||
|
||||
import { merge } from 'rxjs/observable/merge';
|
||||
|
||||
declare const navigator: any;
|
||||
|
||||
@@ -57,20 +62,17 @@ declare const navigator: any;
|
||||
})
|
||||
@Injectable()
|
||||
export class Network extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Connection type
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
type: string;
|
||||
@CordovaProperty type: string;
|
||||
|
||||
/**
|
||||
* Downlink Max Speed
|
||||
* @return {string}
|
||||
*/
|
||||
@CordovaProperty
|
||||
downlinkMax: string;
|
||||
@CordovaProperty downlinkMax: string;
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection changes
|
||||
@@ -78,7 +80,7 @@ export class Network extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaCheck()
|
||||
onchange(): Observable<any> {
|
||||
return Observable.merge(this.onConnect(), this.onDisconnect());
|
||||
return merge(this.onConnect(), this.onDisconnect());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +91,9 @@ export class Network extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'offline'
|
||||
})
|
||||
onDisconnect(): Observable<any> { return; }
|
||||
onDisconnect(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notified when the device goes online
|
||||
@@ -99,6 +103,7 @@ export class Network extends IonicNativePlugin {
|
||||
eventObservable: true,
|
||||
event: 'online'
|
||||
})
|
||||
onConnect(): Observable<any> { return; }
|
||||
|
||||
onConnect(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ export interface OSNotification {
|
||||
/**
|
||||
* Was app in focus.
|
||||
*/
|
||||
isAppInFocus: boolean;
|
||||
isAppInFocus?: boolean;
|
||||
/**
|
||||
* Was notification shown to the user. Will be false for silent notifications.
|
||||
*/
|
||||
shown: boolean;
|
||||
shown?: boolean;
|
||||
/**
|
||||
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
|
||||
*/
|
||||
@@ -18,17 +18,17 @@ export interface OSNotification {
|
||||
/**
|
||||
* Payload received from OneSignal.
|
||||
*/
|
||||
payload: OSNotificationPayload;
|
||||
payload?: OSNotificationPayload;
|
||||
/**
|
||||
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
|
||||
*/
|
||||
displayType: OSDisplayType;
|
||||
displayType?: OSDisplayType;
|
||||
/**
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
groupedNotifications?: OSNotificationPayload[];
|
||||
app_id?: string;
|
||||
contents: any;
|
||||
contents?: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
isAndroid?: boolean;
|
||||
@@ -60,6 +60,7 @@ export interface OSNotification {
|
||||
wp_wns_sound?: string;
|
||||
data?: any;
|
||||
buttons?: any;
|
||||
collapse_id?: string;
|
||||
small_icon?: string;
|
||||
large_icon?: string;
|
||||
big_picture?: string;
|
||||
@@ -228,9 +229,13 @@ export interface OSPermissionState {
|
||||
*/
|
||||
hasPrompted: boolean;
|
||||
/**
|
||||
* Permissions Status
|
||||
* Permissions Status (iOS Only)
|
||||
*/
|
||||
status: any;
|
||||
/**
|
||||
* Permissions State (Android Only)
|
||||
*/
|
||||
state: any;
|
||||
}
|
||||
/**
|
||||
* OSSubscriptionState
|
||||
|
||||
@@ -252,6 +252,7 @@ export interface GetLibraryOptions {
|
||||
chunkTimeSec?: number;
|
||||
useOriginalFileNames?: boolean;
|
||||
includeAlbumData?: boolean;
|
||||
maxItems?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,9 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
/**
|
||||
* @name Pin Dialog
|
||||
* @description
|
||||
* PhoneGap numeric password dialog plugin for Android and iOS.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-pin-dialog`. For more info, please see the [Pin Dialog plugin docs](https://github.com/Paldom/PinDialog).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -31,6 +31,8 @@ export interface DeployConfig {
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
export type ProgressMessage = number | string;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -43,7 +45,7 @@ export class ProDeploy {
|
||||
* @param config A valid Deploy config object
|
||||
*/
|
||||
@CordovaInstance()
|
||||
init(config: DeployConfig): Promise<any> { return; }
|
||||
init(config: DeployConfig): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Check a channel for an available update
|
||||
@@ -54,27 +56,27 @@ export class ProDeploy {
|
||||
|
||||
/**
|
||||
* Download an available version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
* @return {Observable<ProgressMessage>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
download(): Observable<any> { return; }
|
||||
download(): Observable<ProgressMessage> { return; }
|
||||
|
||||
/**
|
||||
* Unzip the latest downloaded version
|
||||
* @return {Observable<any>} Updates with percent completion, or errors with a message.
|
||||
* @return {Observable<ProgressMessage>} Updates with percent completion, or errors with a message.
|
||||
*/
|
||||
@CordovaInstance({
|
||||
observable: true
|
||||
})
|
||||
extract(): Observable<any> { return; }
|
||||
extract(): Observable<ProgressMessage> { return; }
|
||||
|
||||
/**
|
||||
* Reload app with the deployed version
|
||||
*/
|
||||
@CordovaInstance()
|
||||
redirect(): Promise<any> { return; }
|
||||
redirect(): Promise<void> { return; }
|
||||
|
||||
/**
|
||||
* Get info about the version running on the device
|
||||
@@ -87,14 +89,14 @@ export class ProDeploy {
|
||||
* List versions stored on the device
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getVersions(): Promise<any> { return; }
|
||||
getVersions(): Promise<string[]> { return; }
|
||||
|
||||
/**
|
||||
* Delete a version stored on the device by UUID
|
||||
* @param version A version UUID
|
||||
*/
|
||||
@CordovaInstance()
|
||||
deleteVersion(version: string): Promise<any> { return; }
|
||||
deleteVersion(version: string): Promise<void> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,6 +61,9 @@ export interface QRScannerStatus {
|
||||
/**
|
||||
* @name QR Scanner
|
||||
* @description
|
||||
* A fast, energy efficient, highly-configurable QR code scanner for Cordova apps.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-qrscanner`. For more info, please see the [QR Scanner plugin docs](https://github.com/bitpay/cordova-plugin-qrscanner).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -18,6 +18,10 @@ export interface SafariViewControllerOptions {
|
||||
/**
|
||||
* @name Safari View Controller
|
||||
* @description
|
||||
* For displaying read-only web content.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-safariviewcontroller`. For more info, please see the [Safari View Controller plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SafariViewController } from '@ionic-native/safari-view-controller';
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export const enum TYPE_SENSOR {
|
||||
PROXIMITY = 'PROXIMITY',
|
||||
ACCELEROMETER = 'ACCELEROMETER',
|
||||
GRAVITY = 'GRAVITY',
|
||||
GYROSCOPE = 'GYROSCOPE',
|
||||
GYROSCOPE_UNCALIBRATED = 'GYROSCOPE_UNCALIBRATED',
|
||||
LINEAR_ACCELERATION = 'LINEAR_ACCELERATION',
|
||||
ROTATION_VECTOR = 'ROTATION_VECTOR',
|
||||
STEP_COUNTER = 'STEP_COUNTER',
|
||||
GAME_ROTATION_VECTOR = 'GAME_ROTATION_VECTOR',
|
||||
GEOMAGNETIC_ROTATION_VECTOR = 'GEOMAGNETIC_ROTATION_VECTOR',
|
||||
MAGNETIC_FIELD = 'MAGNETIC_FIELD',
|
||||
MAGNETIC_FIELD_UNCALIBRATED = 'MAGNETIC_FIELD_UNCALIBRATED',
|
||||
ORIENTATION = 'ORIENTATION',
|
||||
AMBIENT_TEMPERATURE = 'AMBIENT_TEMPERATURE',
|
||||
LIGHT = 'LIGHT',
|
||||
PRESSURE = 'PRESSURE',
|
||||
RELATIVE_HUMIDITY = 'RELATIVE_HUMIDITY',
|
||||
TEMPERATURE = 'TEMPERATURE',
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Sensors
|
||||
* @description
|
||||
* This plugin enables sensors on Android devices
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Sensors, TYPE_SENSOR } from '@ionic-native/sensors';
|
||||
*
|
||||
*
|
||||
* constructor(private sensors: Sensors) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.sensors.enableSensor(TYPE_SENSOR.LIGHT);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Sensors',
|
||||
plugin: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git',
|
||||
pluginRef: 'sensors',
|
||||
repo: 'https://github.com/fabiorogeriosj/cordova-plugin-sensors.git',
|
||||
platforms: ['Android'],
|
||||
})
|
||||
@Injectable()
|
||||
export class Sensors extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function enables the sensor
|
||||
* @param {string} TYPE_SENSOR Specify the sensor to enable
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
enableSensor(TYPE_SENSOR: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function disables the sensor
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
disableSensor(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function calls the success callback
|
||||
* @return {Promise<any>} Returns sensor state
|
||||
*/
|
||||
@Cordova()
|
||||
getState(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface SiriShortcut {
|
||||
persistentIdentifier: string;
|
||||
title: string;
|
||||
userInfo: { [key: string]: string; };
|
||||
suggestedInvocationPhrase: string;
|
||||
}
|
||||
|
||||
export interface SiriShortcutOptions extends SiriShortcut {
|
||||
isEligibleForSearch?: boolean;
|
||||
isEligibleForPrediction?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Siri Shortcuts
|
||||
* @description
|
||||
* This plugin only works when your app is built with XCode 10 Beta. Shortcuts will only appear on iOS-versions >= 12.0
|
||||
*
|
||||
* This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
|
||||
* After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
|
||||
* whether the user launched your app through a shortcut by calling `getActivatedShortcut()` when the app is resumed. It will return `null`
|
||||
* if it has not been launched by Siri, and if it did, it will return an object with `SiriShortcut` properties.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SiriShortcuts } from '@ionic-native/siri-shortcuts';
|
||||
*
|
||||
*
|
||||
* constructor(private siriShortcuts: SiriShortcuts) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.siriShortcuts.donate({
|
||||
* persistentIdentifier: 'open-my-app',
|
||||
* title: 'Open my app',
|
||||
* suggestedInvocationPhrase: 'Open my app',
|
||||
* userInfo: { username: 'username' },
|
||||
* isEligibleForSearch: true,
|
||||
* isEligibleForPrediction: true,
|
||||
* })
|
||||
* .then(() => console.log('Shortcut donated.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.present({
|
||||
* persistentIdentifier: 'open-my-app',
|
||||
* title: 'Open my app',
|
||||
* suggestedInvocationPhrase: 'Open my app',
|
||||
* userInfo: { username: 'username' },
|
||||
* })
|
||||
* .then(() => console.log('Shortcut added.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.remove('open-my-app')
|
||||
* .then(() => console.log('Shortcut removed.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.removeAll()
|
||||
* .then(() => console.log('All shortcuts removed removed.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.getActivatedShortcut()
|
||||
* .then((data: SiriShortcut|null) => console.log(data))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* SiriShortcut
|
||||
* SiriShortcutOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SiriShortcuts',
|
||||
plugin: 'cordova-plugin-siri-shortcuts',
|
||||
pluginRef: 'cordova.plugins.SiriShortcuts',
|
||||
repo: 'https://github.com/bartwesselink/cordova-plugin-siri-shortcuts',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SiriShortcuts extends IonicNativePlugin {
|
||||
/**
|
||||
* Donate shortcut to Siri
|
||||
* @param {SiriShortcutOptions} options Options to specify for the donation
|
||||
* @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it
|
||||
* @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut
|
||||
* @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call
|
||||
* @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally
|
||||
* @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri
|
||||
* @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
donate(options: SiriShortcutOptions): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present shortcut to the user, will popup a view controller asking the user to add it to Siri
|
||||
* @param {SiriShortcutOptions} options Options to specify for the donation
|
||||
* @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it
|
||||
* @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut
|
||||
* @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call
|
||||
* @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally
|
||||
* @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri
|
||||
* @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
present(options: SiriShortcutOptions): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove shortcuts based on identifiers
|
||||
* @param {string|string[]} persistentIdentifiers Specify which shortcut(s) to delete by their persistent identifiers
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
remove(persistentIdentifiers: string|string[]): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all shortcuts from the application
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
removeAll(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current clicked user activity, and return `null` if none
|
||||
* @return Promise<SiriShortcut|null>
|
||||
*/
|
||||
@Cordova()
|
||||
getActivatedShortcut(): Promise<SiriShortcut|null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,10 @@ export interface SpinnerDialogIOSOptions {
|
||||
/**
|
||||
* @name Spinner Dialog
|
||||
* @description
|
||||
* Cordova plugin for showing a native spinner based on Paldom/SpinnerDialog.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-native-spinner`. For more info, please see the [Spinner Dialog plugin docs](https://github.com/greybax/cordova-plugin-native-spinner).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SpinnerDialog } from '@ionic-native/spinner-dialog';
|
||||
|
||||
@@ -36,20 +36,21 @@ export interface SQLiteDatabaseConfig {
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface SQLiteTransaction {
|
||||
start: () => void;
|
||||
export interface DbTransaction {
|
||||
executeSql: (
|
||||
sql: any,
|
||||
values: any,
|
||||
success: Function,
|
||||
error: Function
|
||||
) => void;
|
||||
addStatement: (
|
||||
sql: any,
|
||||
values: any,
|
||||
success: Function,
|
||||
error: Function
|
||||
values?: any[],
|
||||
success?: Function,
|
||||
error?: Function
|
||||
) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface SQLiteTransaction extends DbTransaction {
|
||||
start: () => void;
|
||||
addStatement: DbTransaction['executeSql'];
|
||||
handleStatementSuccess: (handler: Function, response: any) => void;
|
||||
handleStatementFailure: (handler: Function, response: any) => void;
|
||||
run: () => void;
|
||||
@@ -74,14 +75,14 @@ export class SQLiteObject {
|
||||
addTransaction(transaction: (tx: SQLiteTransaction) => void): void {}
|
||||
|
||||
/**
|
||||
* @param fn {any}
|
||||
* @param fn {Function}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance({
|
||||
successIndex: 2,
|
||||
errorIndex: 1
|
||||
})
|
||||
transaction(fn: any): Promise<any> {
|
||||
transaction(fn: (tx: DbTransaction) => void): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,7 +121,7 @@ export class SQLiteObject {
|
||||
* ensure it resolved and successfully opened the database.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeSql(statement: string, params: any): Promise<any> {
|
||||
executeSql(statement: string, params?: any[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,986 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface Printer {
|
||||
/**
|
||||
* Printer model name and model number
|
||||
*/
|
||||
modelName?: string;
|
||||
|
||||
/**
|
||||
* Printer Mac Address
|
||||
*/
|
||||
macAddress?: string;
|
||||
|
||||
/**
|
||||
* Printer port name used to create a new port instance of SMPort or StarIOExtManager
|
||||
*/
|
||||
portName?: string;
|
||||
/**
|
||||
* USB Serial Number (USB Printers Only)
|
||||
*/
|
||||
USBSerialNumber?: string;
|
||||
}
|
||||
/**
|
||||
* Array of Printer objects returned by the portDiscovery() function
|
||||
*/
|
||||
export interface Printers extends Array<Printer> {}
|
||||
|
||||
export interface PrinterStatus {
|
||||
/**
|
||||
* Printer Online/Offline status
|
||||
*/
|
||||
offline?: boolean;
|
||||
|
||||
/**
|
||||
* Printer model name and model number
|
||||
*/
|
||||
ModelName?: string;
|
||||
|
||||
/**
|
||||
* Printer cover status
|
||||
*/
|
||||
coverOpen?: boolean;
|
||||
|
||||
/**
|
||||
* Printer Paper Cutter status
|
||||
*/
|
||||
cutterError?: boolean;
|
||||
|
||||
/**
|
||||
* Printer Paper status
|
||||
*/
|
||||
receiptPaperEmpty?: boolean;
|
||||
|
||||
/**
|
||||
* Printer Firmware information
|
||||
*/
|
||||
FirmwareVersion?: string;
|
||||
}
|
||||
|
||||
export interface PrintObj {
|
||||
/**
|
||||
* string containing the text to print, Example: "Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* Sends a PartialCutWithFeed command to the printer, defaults to true
|
||||
*/
|
||||
cutReceipt?: boolean;
|
||||
|
||||
/**
|
||||
* sends a appendPeripheral command to the printer for channels No1 and No2 - Defaults to true
|
||||
*/
|
||||
openCashDrawer?: boolean;
|
||||
}
|
||||
export interface RasterObj extends PrintObj {
|
||||
/**
|
||||
* Font size number, defaults to 25
|
||||
*/
|
||||
fontSize?: number;
|
||||
|
||||
/**
|
||||
* Paper width (Units: Dots). 2 inches: 384, 3 inches: 576, 4 inches: 832, ESCPos 3 inches: 512, Dot 3 inches: 210. Defaults to 576
|
||||
*/
|
||||
paperWidth?: number;
|
||||
}
|
||||
export interface ImageObj {
|
||||
/**
|
||||
* Image URI to print, this can be obtained via the camera or photo library or as a static resource saved on the phone memory
|
||||
*/
|
||||
uri: string;
|
||||
|
||||
/**
|
||||
* Image width (Units: Dots) defaults to 576
|
||||
*/
|
||||
paperWidth?: number;
|
||||
|
||||
/**
|
||||
* Sends a PartialCutWithFeed command to the printer, defaults to true
|
||||
*/
|
||||
cutReceipt?: boolean;
|
||||
|
||||
/**
|
||||
* sends a appendPeripheral command to the printer for channels No1 and No2 - Defaults to true
|
||||
*/
|
||||
openCashDrawer?: boolean;
|
||||
}
|
||||
export interface PrintCommand {
|
||||
|
||||
/**
|
||||
* Characther encoding is used to getByte data from all subsequent commands. Default 'US-ASCII'
|
||||
* Choose the format of the return value Defined in StarPRNT.Encoding or the Encoding enum.
|
||||
* Example: {appendEncoding:'US-ASCII'}
|
||||
*/
|
||||
appendEncoding?: string;
|
||||
|
||||
/**
|
||||
* Select command of the code page is generated and added to the commands property.
|
||||
* Choose the format of the return value Defined in StarPRNT.CodePageType or the CodePageType enum.
|
||||
* Example: {appendCodePage:'CP858'}
|
||||
*/
|
||||
appendCodePage?: string;
|
||||
|
||||
/**
|
||||
* Data (Text) is added to the command buffer. Example: {append:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"}
|
||||
*/
|
||||
append?: string;
|
||||
|
||||
/**
|
||||
* Data (Text) is added to the command buffer. Example: {appendRaw:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"}
|
||||
*/
|
||||
appendRaw?: string;
|
||||
|
||||
/**
|
||||
* Data (Command) is added to the command buffer. Takes an array of bytes.
|
||||
* Example: {appendBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]}
|
||||
*/
|
||||
appendBytes?: Array<number>;
|
||||
|
||||
/**
|
||||
* Data (Command) is added to the command buffer. Takes an array of bytes.
|
||||
* Example: {appendRawBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]}
|
||||
*/
|
||||
appendRawBytes?: Array<number>;
|
||||
|
||||
/**
|
||||
* Set command of the character space is generated and added to the command buffer. Character Spacs (Unit: Dots) Example: 4
|
||||
*/
|
||||
appendCharacterSpace?: number;
|
||||
|
||||
/**
|
||||
* Select command of the emphasis mode is generated and added to the command buffer. Example: {appendEmphasis:"SALE\n"}
|
||||
*/
|
||||
appendEmphasis?: string;
|
||||
|
||||
/**
|
||||
* Enable emphasis mode is generated and added to the command buffer. Example: {enableEmphasis:true}
|
||||
*/
|
||||
enableEmphasis?: boolean;
|
||||
|
||||
/**
|
||||
* Select command of the invert mode is generated and added to the command buffer. Example: {appendInvert:"Refunds and Exchanges\n"}
|
||||
*/
|
||||
appendInvert?: string;
|
||||
/**
|
||||
* Enable invert mode is generated and added to the command buffer. Example: {enableInvert:true}
|
||||
*/
|
||||
enableInvert?: boolean;
|
||||
/**
|
||||
* Select command of the under line mode is generated and added to the command buffer. Example: {appendUnderline:"30 days"}
|
||||
*/
|
||||
appendUnderline?: string;
|
||||
/**
|
||||
* Enable under line mode is generated and added to the command buffer. Example: {enableUnderline:true}
|
||||
*/
|
||||
enableUnderline?: boolean;
|
||||
|
||||
/**
|
||||
* Select command of the international character mode is generated and added to the command buffer.
|
||||
* Choose the format of the return value Defined in StarPRNT.InternationalType or the InternationalType enum.
|
||||
* 'UK' | 'USA' | 'France' | 'Germany' | 'Denmark' | 'Sweden' | 'Italy' | 'Spain' | 'Japan' | 'Norway' | 'Denmark2' | 'Spain2' | 'LatinAmerica' | 'Korea' | 'Ireland' | 'Legal'
|
||||
* Example {appendInternational:InternationalType.UK}
|
||||
*/
|
||||
appendInternational?: string;
|
||||
|
||||
/**
|
||||
* Line feed command is generated and added to the command buffer. Paper feed units (Units: Lines) Example: 2
|
||||
*/
|
||||
appendLineFeed?: number;
|
||||
|
||||
/**
|
||||
* Unit feed command is generated and added to the command buffer. Paper feed units (Units: Dots) Example: 64
|
||||
*/
|
||||
appendUnitFeed?: number;
|
||||
|
||||
/**
|
||||
* Set command of the line space is generated and added to the command buffer. Line spaces (Units: Dots) Example: 32
|
||||
*/
|
||||
appendLineSpace?: number;
|
||||
|
||||
/**
|
||||
* Select command of the font style is generated and added to the command buffer.
|
||||
* Choose the format of the return value defined in StarPRNT.FontStyleType or the FontStyleType enum. 'A' | 'B'
|
||||
* Example: {appendFontStyle:FontStyleType.A}
|
||||
*/
|
||||
appendFontStyle?: string;
|
||||
|
||||
/**
|
||||
* Paper cut command is generated and added to the command buffer.
|
||||
* Choose the format of the return value defined in StarPRNT.CutPaperAction or the CutPaperAction enum. 'FullCut' | 'FullCutWithFeed' | 'PartialCut' | 'PartialCutWithFeed'
|
||||
* Example: {appendCutPaper:CutPaperAction.PartialCutWithFeed}
|
||||
*/
|
||||
appendCutPaper?: string;
|
||||
|
||||
/**
|
||||
* Black mark command is generated and added to the command buffer.
|
||||
* Choose the format of the return value defined in StarPRNT.BlackMarkType or the BlackMarkType enum. 'Valid' | 'Invalid' | 'ValidWithDetection'
|
||||
* Example: {appendBlackMark: BlackMarkType.Valid}
|
||||
*/
|
||||
appendBlackMark?: string;
|
||||
|
||||
/**
|
||||
* Absolute position command is generated and added to the command buffer. (Unit: Dots). Send in conjunction with the data property to append absolute position just to that string
|
||||
* Example1: Append data with Absolute position {appendAbsolutePosition:40, data: "Text with absolute position"}
|
||||
* Example2: Append absolute position to subsequent commands: {appendAbsolutePosition:40}
|
||||
*/
|
||||
appendAbsolutePosition?: number;
|
||||
|
||||
/**
|
||||
* Alignment command is generated and added to the command buffer. Send in conjunction with the data property to append alignment position just to that string
|
||||
* Choose the format of the return value defined in StarPRNT.AlignmentPosition or the AlignmentPosition enum. 'Left' | 'Center' | 'Right'.
|
||||
* Example1 Append data with Alignment position: {appendAlignment:AlignmentPosition.Center, data: "Text with centered position"}
|
||||
* Example2 Append absolute position to subsequent commands: {appendAlignment:AlignmentPosition.Center}
|
||||
*/
|
||||
appendAlignment?: string;
|
||||
|
||||
/**
|
||||
* Horizontal tab set/clear command is generated and added to the command buffer. (Only works for certain printer models, check the starSDK documentation for details)
|
||||
* Array of horizontal tab positions (Units: ANK character pitch). Specifying empty array deletes all currently set horizontal tab positions.
|
||||
* Example: {appendHorizontalTabPosition:[15, 35]}
|
||||
* Delete positions Example: {appendHorizontalTabPosition:[]}
|
||||
*/
|
||||
appendHorizontalTabPosition?: Array<number>;
|
||||
|
||||
/**
|
||||
* Print command of the logo is generated and added to the command buffer. The logo has to be uploaded to the printer using the Star Print utility.
|
||||
* Send in conjuction with the logoSize property to set the logo size
|
||||
* Example: {appendLogo:1}
|
||||
* Example with LogoSize: {appendLogo:1, logoSize:LogoSize.DoubleWidthDoubleHeight}
|
||||
*/
|
||||
appendLogo?: number;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendLogo command.
|
||||
* Choose the format of the return value defined in StarPRNT.LogoSize or the LogoSize enum. 'Normal' | 'DoubleWidth' | 'DoubleHeight' | 'DoubleWidthDoubleHeight';
|
||||
* Example: {appendLogo:1, logoSize:LogoSize.DoubleWidthDoubleHeight}
|
||||
*/
|
||||
logoSize?: string;
|
||||
|
||||
/**
|
||||
* Print command of the barcode is generated and added to the command buffer.
|
||||
* Additional Properties: BarcodeSymbology, BarcodeWidth, height, hri, absolutePosition, alignment.
|
||||
* Example: {appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true }
|
||||
* Example with absolutePosition: {appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true, absolutePosition:40 }
|
||||
* Example with alignment:{appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true, alignment:alignment:AlignmentPosition.Center }
|
||||
*/
|
||||
appendBarcode?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBarcode command.
|
||||
* Choose the format of the return value defined in StarPRNT.BarcodeSymbology or the BarcodeSymbology enum.
|
||||
* 'Code128' | 'Code39' | 'Code93' | 'ITF' | 'JAN8' | 'JAN13' | 'NW7' | 'UPCA' | 'UPCE' |
|
||||
* Example: {appendBarcode:'{BStar', BarcodeSymbology:BarcodeSymbology.Code128}
|
||||
*/
|
||||
BarcodeSymbology?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBarcode command.
|
||||
* Choose the format of the return value defined in StarPRNT.BarcodeWidth or the BarcodeWidth enum.
|
||||
* Mode1 | Mode2 | Mode3 | Mode4 | Mode5 | Mode6 | Mode7 | Mode8 | Mode9
|
||||
* Example: {appendBarcode:'{BStar', BarcodeWidth:BarcodeWidth.Mode2}
|
||||
*/
|
||||
BarcodeWidth?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBarcode command.
|
||||
* Under-bar characters. true = Valid, false = Invalid
|
||||
* Example: {appendBarcode:'{BStar', hri:true}
|
||||
*/
|
||||
hri?: boolean;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBarcode command or the appendMultiple command (Units:Dots)
|
||||
* appendBarcode Example: {appendBarcode:'{BStar', height:40}
|
||||
* appendMultiple: {appendMultiple:'text to print', height:40}
|
||||
*/
|
||||
height?: number;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command or the appendMultiple command (Units:Dots)
|
||||
* appendBitmap Example: {appendBitmap:uri, width:576}
|
||||
* appendMultiple: {appendMultiple:'text to print', width:40}
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots)
|
||||
* appendBitmap Example: {appendBitmap:uri, absolutePosition:40}.
|
||||
* appendBarcode Example: {appendBarcode:'{BStar', absolutePosition:40}.
|
||||
* appendQrCode Example: {appendQrCode:'{BStar', absolutePosition:40}.
|
||||
*/
|
||||
absolutePosition?: number;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots)
|
||||
* Choose the format of the return value defined in StarPRNT.AlignmentPosition or the AlignmentPosition enum. 'Left' | 'Center' | 'Right'.
|
||||
* appendBitmap Example: {appendBitmap:uri, alignment:AlignmentPosition.Center}.
|
||||
* appendBarcode Example: {appendBarcode:'{BStar', alignment:AlignmentPosition.Center}.
|
||||
* appendQrCode Example: {appendQrCode:'{BStar', alignment:AlignmentPosition.Center}.
|
||||
*/
|
||||
alignment?: string;
|
||||
|
||||
/**
|
||||
* Select command of the multiple mode is generated and added to the command buffer.
|
||||
* Additional properties: width:number, height:number
|
||||
* Example: {appendMultiple:" $156.95\n", width:2, height:2}.
|
||||
*/
|
||||
appendMultiple?: string;
|
||||
|
||||
/**
|
||||
* Enable multiple mode is generated and added to the command buffer.
|
||||
* Additional properties: width:number, height:number
|
||||
* Example: {enableMultiple:true, width:2, height:2}
|
||||
* Disable Example: {enableMultiple:false}
|
||||
*/
|
||||
enableMultiple?: boolean;
|
||||
|
||||
/**
|
||||
* Print command of the QR code is generated and added to the command buffer.
|
||||
* Additional Properties: QrCodeModel, QrCodeLevel, cell, absolutePosition, alignment.
|
||||
* Example: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8}.
|
||||
* Example with absolutePosition: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, absolutePosition: 40 }.
|
||||
* Example with alignment: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, alignment:"Center" }.
|
||||
*/
|
||||
appendQrCode?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendQrCode command.
|
||||
* Choose the format of the return value defined in StarPRNT.QrCodeModel or the QrCodeModel enum. 'No1' | 'No2' Default 'No2'
|
||||
* Example: {appendQrCode:'{BStar', QrCodeModel:QrCodeModel.No1}
|
||||
*/
|
||||
QrCodeModel?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendQrCode command.
|
||||
* Choose the format of the return value defined in StarPRNT.QrCodeLevel or the QrCodeLevel enum. 'No1' | 'No2'. Default 'H'
|
||||
* Example: {appendQrCode:'{BStar', QrCodeLevel:QrCodeLevel.H}
|
||||
*/
|
||||
QrCodeLevel?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendQrCode command. QRCode Cell size. Default 4.
|
||||
* Example: {appendQrCode:'{BStar', cell:8}
|
||||
*/
|
||||
cell?: number;
|
||||
|
||||
/**
|
||||
* Print command of the bitmap is generated and added to the command buffer. Takes a string image URI
|
||||
* this can be obtained via the camera or photo library or as a static resource saved on the phone memory.
|
||||
* Additional Properties: diffusion, width, bothScale, rotation, absolutePosition, alignment.
|
||||
* Example: {appendBitmap:uri, diffusion: true, width:576, bothScale: true}
|
||||
* Example with absolutePosition: {appendBitmap:uri, diffusion: true, width:576, bothScale: true, absolutePosition: 40 }.
|
||||
* Example with alignment: {appendBitmap:uri, diffusion: true, width:576, bothScale: true, alignment:"Center" }.
|
||||
*/
|
||||
appendBitmap?: string;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command. Random dither: true = Valid, false = Invalid. Default true.
|
||||
* Example: {appendBitmap:uri, diffusion: false }
|
||||
*/
|
||||
diffusion?: boolean;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command. Height is changed according to the conversion rate of the width property.
|
||||
* true = Valid, false = Invalid. Default true.
|
||||
* Example: {appendBitmap:uri, bothScale: true }
|
||||
*/
|
||||
bothScale?: boolean;
|
||||
|
||||
/**
|
||||
* Property to be used with the appendBitmap command.
|
||||
* Choose the format of the return value defined in StarPRNT.BitmapConverterRotation or the BitmapConverterRotation enum.
|
||||
* 'Normal' | 'Left90' | 'Right90' | 'Rotate180'
|
||||
* Example: {appendBitmap:uri, rotation: BitmapConverterRotation.Left90 }
|
||||
*/
|
||||
rotation?: string;
|
||||
|
||||
/**
|
||||
* sends a appendPeripheral command to the printer for channel number: Example: 1 = No1, 2 = No2
|
||||
*/
|
||||
openCashDrawer?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emulation constants
|
||||
*/
|
||||
export enum Emulation {
|
||||
/** mPOP, SM-L200, SM-L300, SM-S210i, SM-S220i, SM-S230i, SM-T300i/T300, SM-T400i */
|
||||
StarPRNT = 'StarPRNT',
|
||||
/** SM-L200, SM-L300 */
|
||||
StarPRNTL = 'StarPRNTL',
|
||||
/** FVP10, TSP650II, TSP700II, TSP800II */
|
||||
StarLine = 'StarLine',
|
||||
/** TSP100 */
|
||||
StarGraphic = 'StarGraphic',
|
||||
/** BSC10 */
|
||||
EscPos = 'EscPos',
|
||||
/** SM-S210i, SM-S220i, SM-S230i, SM-T300i/T300, SM-T400i */
|
||||
EscPosMobile = 'EscPosMobile',
|
||||
/** SP700 */
|
||||
StarDotImpact = 'StarDotImpact',
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoding constants
|
||||
*/
|
||||
export enum Encoding {
|
||||
/** English */
|
||||
USASCII = 'US-ASCII',
|
||||
/** French, German, Portuguese, Spanish */
|
||||
Windows1252 = 'Windows-1252',
|
||||
/** Japanese */
|
||||
ShiftJIS = 'Shift-JIS',
|
||||
/** Russian */
|
||||
Windows1251 = 'Windows-1251',
|
||||
/** Simplified Chinese */
|
||||
GB2312 = 'GB2312',
|
||||
/** Traditional Chinese */
|
||||
Big5 = 'Big5',
|
||||
/** UFT8 */
|
||||
UTF8 = 'UTF-8'
|
||||
}
|
||||
|
||||
/**
|
||||
* CodePageType constants
|
||||
*/
|
||||
export enum CodePageType {
|
||||
CP737 = 'CP737',
|
||||
CP772 = 'CP772',
|
||||
CP774 = 'CP774',
|
||||
CP851 = 'CP851',
|
||||
CP852 = 'CP852',
|
||||
CP855 = 'CP855',
|
||||
CP857 = 'CP857',
|
||||
CP858 = 'CP858',
|
||||
CP860 = 'CP860',
|
||||
CP861 = 'CP861',
|
||||
CP862 = 'CP862',
|
||||
CP863 = 'CP863',
|
||||
CP864 = 'CP864',
|
||||
CP865 = 'CP865',
|
||||
CP869 = 'CP869',
|
||||
CP874 = 'CP874',
|
||||
CP928 = 'CP928',
|
||||
CP932 = 'CP932',
|
||||
CP999 = 'CP999',
|
||||
CP1001 = 'CP1001',
|
||||
CP1250 = 'CP1250',
|
||||
CP1251 = 'CP1251',
|
||||
CP1252 = 'CP1252',
|
||||
CP2001 = 'CP2001',
|
||||
CP3001 = 'CP3001',
|
||||
CP3002 = 'CP3002',
|
||||
CP3011 = 'CP3011',
|
||||
CP3012 = 'CP3012',
|
||||
CP3021 = 'CP3021',
|
||||
CP3041 = 'CP3041',
|
||||
CP3840 = 'CP3840',
|
||||
CP3841 = 'CP3841',
|
||||
CP3843 = 'CP3843',
|
||||
CP3845 = 'CP3845',
|
||||
CP3846 = 'CP3846',
|
||||
CP3847 = 'CP3847',
|
||||
CP3848 = 'CP3848',
|
||||
UTF8 = 'UTF8',
|
||||
Blank = 'Blank'
|
||||
}
|
||||
|
||||
/**
|
||||
* InternationalType constants
|
||||
*/
|
||||
export enum InternationalType {
|
||||
UK = 'UK',
|
||||
USA = 'USA',
|
||||
France = 'France',
|
||||
Germany = 'Germany',
|
||||
Denmark = 'Denmark',
|
||||
Sweden = 'Sweden',
|
||||
Italy = 'Italy',
|
||||
Spain = 'Spain',
|
||||
Japan = 'Japan',
|
||||
Norway = 'Norway',
|
||||
Denmark2 = 'Denmark2',
|
||||
Spain2 = 'Spain2',
|
||||
LatinAmerica = 'LatinAmerica',
|
||||
Korea = 'Korea',
|
||||
Ireland = 'Ireland',
|
||||
Legal = 'Legal'
|
||||
}
|
||||
|
||||
/**
|
||||
* FontStyleType constants.
|
||||
*/
|
||||
export enum FontStyleType {
|
||||
/** Font-A (12 x 24 dots) / Specify 7 x 9 font (half dots) */
|
||||
A = 'A',
|
||||
/** Font-B (9 x 24 dots) / Specify 5 x 9 font (2P-1) */
|
||||
B = 'B'
|
||||
}
|
||||
|
||||
/**
|
||||
* CutPaperAction constants.
|
||||
*/
|
||||
export enum CutPaperAction {
|
||||
FullCut = 'FullCut',
|
||||
FullCutWithFeed = 'FullCutWithFeed',
|
||||
PartialCut = 'PartialCut',
|
||||
PartialCutWithFeed = 'PartialCutWithFeed'
|
||||
}
|
||||
|
||||
/**
|
||||
* BlackMarkType constants.
|
||||
*/
|
||||
export enum BlackMarkType {
|
||||
Valid = 'Valid',
|
||||
Invalid = 'Invalid',
|
||||
ValidWithDetection = 'ValidWithDetection'
|
||||
}
|
||||
|
||||
/**
|
||||
* LogoSize constants
|
||||
*/
|
||||
export enum LogoSize {
|
||||
Normal = 'Normal',
|
||||
DoubleWidth = 'DoubleWidth',
|
||||
DoubleHeight = 'DoubleHeight',
|
||||
DoubleWidthDoubleHeight = 'DoubleWidthDoubleHeight'
|
||||
}
|
||||
|
||||
/**
|
||||
* AlignmentPosition constants
|
||||
*/
|
||||
export enum AlignmentPosition {
|
||||
Left = 'Left',
|
||||
Center = 'Center',
|
||||
Right = 'Right'
|
||||
}
|
||||
|
||||
/**
|
||||
* BarcodeSymbology constants
|
||||
*/
|
||||
export enum BarcodeSymbology {
|
||||
Code128 = 'Code128',
|
||||
Code39 = 'Code39',
|
||||
Code93 = 'Code93',
|
||||
ITF = 'ITF',
|
||||
JAN8 = 'JAN8',
|
||||
JAN13 = 'JAN13',
|
||||
NW7 = 'NW7',
|
||||
UPCA = 'UPCA',
|
||||
UPCE = 'UPCE'
|
||||
}
|
||||
|
||||
/**
|
||||
* BarcodeWidth constants
|
||||
*/
|
||||
export enum BarcodeWidth {
|
||||
Mode1 = 'Mode1',
|
||||
Mode2 = 'Mode2',
|
||||
Mode3 = 'Mode3',
|
||||
Mode4 = 'Mode4',
|
||||
Mode5 = 'Mode5',
|
||||
Mode6 = 'Mode6',
|
||||
Mode7 = 'Mode7',
|
||||
Mode8 = 'Mode8',
|
||||
Mode9 = 'Mode9'
|
||||
}
|
||||
|
||||
/**
|
||||
* QrCodeModel constants
|
||||
*/
|
||||
export enum QrCodeModel {
|
||||
No1 = 'No1',
|
||||
No2 = 'No2'
|
||||
}
|
||||
|
||||
/**
|
||||
* QrCodeLevel constants
|
||||
*/
|
||||
export enum QrCodeLevel {
|
||||
H = 'H',
|
||||
L = 'L',
|
||||
M = 'M',
|
||||
Q = 'Q'
|
||||
}
|
||||
|
||||
/**
|
||||
* BitmapConverterRotation constants
|
||||
*/
|
||||
export enum BitmapConverterRotation {
|
||||
Normal = 'Normal',
|
||||
Left90 = 'Left90',
|
||||
Right90 = 'Right90',
|
||||
Rotate180 = 'Rotate180'
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a new PrintCommand object to the array for a separate instruction to the printer. Example [{append:"text"}, {"openCashDrawer: 1"}]
|
||||
*/
|
||||
export interface CommandsArray extends Array<PrintCommand> {}
|
||||
|
||||
/**
|
||||
* @name StarPRNT
|
||||
* @description
|
||||
* * Ionic Native wrappers for the starprnt cordova plugin for Star Micronics Bluetooth/LAN printers
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { StarPRNT } from '@ionic-native/star-prnt';
|
||||
*
|
||||
*
|
||||
* constructor(private starprnt: StarPRNT) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.starprnt.portDiscovery('all')
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'StarPRNT',
|
||||
plugin: 'cordova-plugin-starprnt', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'starprnt', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/auctifera-josed/starprnt', // the github repository URL for the plugin
|
||||
platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class StarPRNT extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Constant for Emulation
|
||||
*/
|
||||
Emulation = {
|
||||
StarPRNT: 'StarPRNT',
|
||||
StarPRNTL: 'StarPRNTL',
|
||||
StarLine: 'StarLine',
|
||||
StarGraphic: 'StarGraphic',
|
||||
EscPos: 'EscPos',
|
||||
EscPosMobile: 'EscPosMobile',
|
||||
StarDotImpact: 'StarDotImpact',
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible Encoding
|
||||
*/
|
||||
Encoding = {
|
||||
USASCII: 'US-ASCII',
|
||||
Windows1252: 'Windows-1252',
|
||||
ShiftJIS: 'Shift-JIS',
|
||||
Windows1251: 'Windows-1251',
|
||||
GB2312: 'GB2312',
|
||||
Big5: 'Big5',
|
||||
UTF8: 'UTF-8'
|
||||
};
|
||||
|
||||
/**
|
||||
* CodePageType constants
|
||||
*/
|
||||
CodePageType = {
|
||||
CP737: 'CP737',
|
||||
CP772: 'CP772',
|
||||
CP774: 'CP774',
|
||||
CP851: 'CP851',
|
||||
CP852: 'CP852',
|
||||
CP855: 'CP855',
|
||||
CP857: 'CP857',
|
||||
CP858: 'CP858',
|
||||
CP860: 'CP860',
|
||||
CP861: 'CP861',
|
||||
CP862: 'CP862',
|
||||
CP863: 'CP863',
|
||||
CP864: 'CP864',
|
||||
CP865: 'CP865',
|
||||
CP869: 'CP869',
|
||||
CP874: 'CP874',
|
||||
CP928: 'CP928',
|
||||
CP932: 'CP932',
|
||||
CP999: 'CP999',
|
||||
CP1001: 'CP1001',
|
||||
CP1250: 'CP1250',
|
||||
CP1251: 'CP1251',
|
||||
CP1252: 'CP1252',
|
||||
CP2001: 'CP2001',
|
||||
CP3001: 'CP3001',
|
||||
CP3002: 'CP3002',
|
||||
CP3011: 'CP3011',
|
||||
CP3012: 'CP3012',
|
||||
CP3021: 'CP3021',
|
||||
CP3041: 'CP3041',
|
||||
CP3840: 'CP3840',
|
||||
CP3841: 'CP3841',
|
||||
CP3843: 'CP3843',
|
||||
CP3845: 'CP3845',
|
||||
CP3846: 'CP3846',
|
||||
CP3847: 'CP3847',
|
||||
CP3848: 'CP3848',
|
||||
UTF8: 'UTF8',
|
||||
Blank: 'Blank'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible InternationalType
|
||||
*/
|
||||
InternationalType = {
|
||||
UK: 'UK',
|
||||
USA: 'USA',
|
||||
France: 'France',
|
||||
Germany: 'Germany',
|
||||
Denmark: 'Denmark',
|
||||
Sweden: 'Sweden',
|
||||
Italy: 'Italy',
|
||||
Spain: 'Spain',
|
||||
Japan: 'Japan',
|
||||
Norway: 'Norway',
|
||||
Denmark2: 'Denmark2',
|
||||
Spain2: 'Spain2',
|
||||
LatinAmerica: 'LatinAmerica',
|
||||
Korea: 'Korea',
|
||||
Ireland: 'Ireland',
|
||||
Legal: 'Legal'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible FontStyleType
|
||||
*/
|
||||
FontStyleType = {
|
||||
/** Font-A (12 x 24 dots) / Specify 7 x 9 font (half dots) */
|
||||
A: 'A',
|
||||
/** Font-B (9 x 24 dots) / Specify 5 x 9 font (2P-1) */
|
||||
B: 'B'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible CutPaperAction
|
||||
*/
|
||||
CutPaperAction = {
|
||||
FullCut: 'FullCut',
|
||||
FullCutWithFeed: 'FullCutWithFeed',
|
||||
PartialCut: 'PartialCut',
|
||||
PartialCutWithFeed: 'PartialCutWithFeed'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible BlackMarkType
|
||||
*/
|
||||
BlackMarkType = {
|
||||
Valid: 'Valid',
|
||||
Invalid: 'Invalid',
|
||||
ValidWithDetection: 'ValidWithDetection'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible AlignmentPosition
|
||||
*/
|
||||
AlignmentPosition = {
|
||||
Left: 'Left',
|
||||
Center: 'Center',
|
||||
Right: 'Right'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible LogoSize
|
||||
*/
|
||||
LogoSize = {
|
||||
Normal: 'Normal',
|
||||
DoubleWidth: 'DoubleWidth',
|
||||
DoubleHeight: 'DoubleHeight',
|
||||
DoubleWidthDoubleHeight: 'DoubleWidthDoubleHeight'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible BarcodeSymbology
|
||||
*/
|
||||
BarcodeSymbology = {
|
||||
Code128: 'Code128',
|
||||
Code39: 'Code39',
|
||||
Code93: 'Code93',
|
||||
ITF: 'ITF',
|
||||
JAN8: 'JAN8',
|
||||
JAN13: 'JAN13',
|
||||
NW7: 'NW7',
|
||||
UPCA: 'UPCA',
|
||||
UPCE: 'UPCE'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible BarcodeWidth
|
||||
*/
|
||||
BarcodeWidth = {
|
||||
Mode1: 'Mode1',
|
||||
Mode2: 'Mode2',
|
||||
Mode3: 'Mode3',
|
||||
Mode4: 'Mode4',
|
||||
Mode5: 'Mode5',
|
||||
Mode6: 'Mode6',
|
||||
Mode7: 'Mode7',
|
||||
Mode8: 'Mode8',
|
||||
Mode9: 'Mode9'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible QrCodeModel
|
||||
*/
|
||||
QrCodeModel = {
|
||||
No1: 'No1',
|
||||
No2: 'No2'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible QrCodeLevel
|
||||
*/
|
||||
QrCodeLevel = {
|
||||
H: 'H',
|
||||
L: 'L',
|
||||
M: 'M',
|
||||
Q: 'Q'
|
||||
};
|
||||
|
||||
/**
|
||||
* Constant for possible BitmapConverterRotation
|
||||
*/
|
||||
BitmapConverterRotation = {
|
||||
Normal: 'Normal',
|
||||
Left90: 'Left90',
|
||||
Right90: 'Right90',
|
||||
Rotate180: 'Rotate180'
|
||||
};
|
||||
|
||||
/**
|
||||
* Find available printers
|
||||
* @param {string} type Interface Type: All, LAN, Bluetooth, USB
|
||||
* @return {Promise<Printers>} Returns a promise that resolves with an array of printers
|
||||
*/
|
||||
@Cordova()
|
||||
portDiscovery(type: string): Promise<Printers> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the status of the printer
|
||||
* @param {string} port Printer name i.e BT:StarMicronics
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @return {Promise<PrinterStatus>} Returns a promise that resolves with the PrinterStatus object
|
||||
*/
|
||||
@Cordova()
|
||||
checkStatus(port: string, emulation: string): Promise<PrinterStatus> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints plain text
|
||||
* @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @param {PrintObj} printObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean
|
||||
* @return {Promise<any>} Success! if printed correctly or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
printRawText(
|
||||
port: string,
|
||||
emulation: string,
|
||||
printObj: PrintObj
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the text into a bitmap image and sends it to the printer
|
||||
* @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @param {RasterObj} rasterObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean, fontSize:number, paperWidth:number
|
||||
* @return {Promise<any>} Success! if printed correctly or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
printRasterReceipt(
|
||||
port: string,
|
||||
emulation: string,
|
||||
rasterObj: RasterObj
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an image from a string URI and converts it to bitmap to send it to the printer
|
||||
* @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @param {ImageObj} imageObj uri:string, paperWidth?:number, cutReceipt?:boolean, openCashDrawer?:boolean
|
||||
* @return {Promise<any>} Success! if printed correctly or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
printImage(
|
||||
port: string,
|
||||
emulation: string,
|
||||
imageObj: ImageObj
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* sends an appendPeripheral command to the printer for channels No1 and No2
|
||||
* @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @return {Promise<any>} Success! if opened or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
openCashDrawer(port: string, emulation: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an Array of commands to the command buffer using the Android ICommandBuilderInterface or iOS ISCBBuilderInterface
|
||||
* @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @param {CommandsArray} commandsArray each command in the array should be an instance of the PrintCommand object. Example [{append:"text"}, {"openCashDrawer: 1"}]
|
||||
* @return {Promise<any>} Success! if printed correctly or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
print(
|
||||
port: string,
|
||||
emulation: string,
|
||||
commandsArray: CommandsArray
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to connect to the printer, keep the connection alive and receive status updates through an observable
|
||||
* @param {string} port printer name i.e BT:StarMicronics.
|
||||
* @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact"
|
||||
* @param {boolean} hasBarcodeReader Set to true if the device has a barcode reader (e.g. mPop)
|
||||
* @return {Observable<any>} Success! if connected or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
callbackStyle: 'node'
|
||||
})
|
||||
connect(port: string, emulation: string, hasBarcodeReader: boolean): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an observable with the device status events. Only fires when a printer is connnected through the connect() function
|
||||
* @return {Observable<any>} dataType: printerOnline, printerOffline, printerImpossible, printerPaperEmpty, printerPaperNearEmpty, printerPaperReady, printerCoverOpen, printerCoverClose, cashDrawerOpen, cashDrawerClose
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'starPrntData'
|
||||
})
|
||||
getStatus(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to disconnect (close the connection to the peripherals), this is useful to avoid keeping alive a connection when not in the app to save device battery
|
||||
* (energy consumption). You should call this function when the app is paused or closed.
|
||||
* @return {Promise<any>} Success! if connected or error message string returned by the SDK.
|
||||
*/
|
||||
@Cordova()
|
||||
disconnect(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,48 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* Object of options to pass into the playVideo method.
|
||||
*/
|
||||
export interface StreamingVideoOptions {
|
||||
/** Executes after success playing audio. */
|
||||
successCallback?: Function;
|
||||
/** Executes after error playing video. */
|
||||
errorCallback?: Function;
|
||||
/** Force one orientation for playing video. */
|
||||
orientation?: string;
|
||||
/** Should the video close after it's over. Defaults to true. */
|
||||
shouldAutoClose?: boolean;
|
||||
/** Should the video have controls. Defaults to true. Android only. */
|
||||
controls?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object of options to pass into the playAudio method.
|
||||
*/
|
||||
export interface StreamingAudioOptions {
|
||||
/** Background color for audio player. */
|
||||
bgColor?: string;
|
||||
/** Background image for audio player. */
|
||||
bgImage?: string;
|
||||
/**
|
||||
* Background image scale for audio player.
|
||||
* Valid values are:
|
||||
* fit
|
||||
* stretch
|
||||
* aspectStretch.
|
||||
*/
|
||||
bgImageScale?: string;
|
||||
/** Start audio player in full screen. iOS only. */
|
||||
initFullscreen?: boolean;
|
||||
/**
|
||||
* Keeps the screen lit and stops it from locking
|
||||
* while audio is playing. Android only.
|
||||
*/
|
||||
keepAwake?: boolean;
|
||||
/** Executes after success playing audio. */
|
||||
successCallback?: Function;
|
||||
/** Executes after error playing audio. */
|
||||
errorCallback?: Function;
|
||||
}
|
||||
|
||||
@@ -30,7 +60,9 @@ export interface StreamingAudioOptions {
|
||||
* let options: StreamingVideoOptions = {
|
||||
* successCallback: () => { console.log('Video played') },
|
||||
* errorCallback: (e) => { console.log('Error streaming') },
|
||||
* orientation: 'landscape'
|
||||
* orientation: 'landscape',
|
||||
* shouldAutoClose: true,
|
||||
* controls: false
|
||||
* };
|
||||
*
|
||||
* this.streamingMedia.playVideo('https://path/to/video/stream', options);
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface StripeCardTokenParams {
|
||||
/**
|
||||
* Postal code / ZIP Code
|
||||
*/
|
||||
postal_code?: string;
|
||||
postalCode?: string;
|
||||
/**
|
||||
* 3-letter ISO code for currency
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @paid
|
||||
* @name TealiumAdIdentifier
|
||||
* @description
|
||||
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything.
|
||||
* Makes the IDFA and Google Ad Identifier available in the Tealium data layer.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { TealiumAdIdentifier } from '@ionic-native/tealium-adidentifier';
|
||||
*
|
||||
*
|
||||
* constructor(private adIdentifier: TealiumAdIdentifier) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.adIdentifier.setPersistent("main");
|
||||
* this.adIdentifier.setVolatile("main");
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'TealiumAdIdentifier',
|
||||
plugin: 'tealium-cordova-adidentifier', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'window.tealiumAdIdentifier', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin
|
||||
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
})
|
||||
|
||||
@Injectable()
|
||||
export class TealiumAdIdentifier extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function stores the ad identifier information as persistent data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
setPersistent(instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function stores the ad identifier information as volatile data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
setVolatile(instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @paid
|
||||
* @name TealiumInstallReferrer
|
||||
* @description
|
||||
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything.
|
||||
* Implements a Broadcast Receiver for the INSTALL_REFERRER intent.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { TealiumInstallReferrer } from '@ionic-native/tealium-installreferrer';
|
||||
*
|
||||
*
|
||||
* constructor(private installReferrer: TealiumInstallReferrer) { }
|
||||
*
|
||||
*
|
||||
* this.installReferrer.setPersistent("main");
|
||||
* this.installReferrer.setVolatile("main");
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'TealiumInstallReferrer',
|
||||
plugin: 'tealium-cordova-installreferrer', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'window.tealiumInstallReferrer', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin
|
||||
platforms: ['Android'], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
})
|
||||
|
||||
@Injectable()
|
||||
export class TealiumInstallReferrer extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function stores the install referrer information as persistent data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
setPersistent(instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function stores the install referrer information as volatile data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
setVolatile(instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface TealConfig {
|
||||
/**
|
||||
* Your Tealium account name
|
||||
*/
|
||||
account: string;
|
||||
/**
|
||||
* Your Tealium profile name
|
||||
*/
|
||||
profile: string;
|
||||
/**
|
||||
* Your Tealium environment name (dev, qa, prod)
|
||||
*/
|
||||
environment: string;
|
||||
/**
|
||||
* Arbitrary instance name string. Must be consistent for all calls to Tealium API.
|
||||
*/
|
||||
instance: string;
|
||||
/**
|
||||
* Enables ("true") or disables ("false") lifecycle reporting. Default true if omitted.
|
||||
*/
|
||||
isLifecycleEnabled?: string;
|
||||
/**
|
||||
* Not usually required. Sets a custom URL override for dispatches to UDH.
|
||||
*/
|
||||
collectDispatchURL?: string;
|
||||
/**
|
||||
* Your Tealium UDH profile. Only active if you do not have collectDispatchURL set.
|
||||
*/
|
||||
collectDispatchProfile?: string;
|
||||
/**
|
||||
* Enables ("true") or disables ("false") Crash Reporter module for Android. Default false if omitted.
|
||||
*/
|
||||
isCrashReporterEnabled?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @paid
|
||||
* @name Tealium
|
||||
* @description
|
||||
* This plugin provides a TypeScript wrapper around the [Tealium](https://www.tealium.com) Cordova plugin for Ionic Native.
|
||||
*
|
||||
* For full documentation, see [https://community.tealiumiq.com/t5/Mobile-Libraries/Tealium-for-Cordova/ta-p/17618](https://community.tealiumiq.com/t5/Mobile-Libraries/Tealium-for-Cordova/ta-p/17618)
|
||||
* @usage
|
||||
* ```
|
||||
* import { Tealium, TealConfig } from '@ionic-native/tealium';
|
||||
*
|
||||
*
|
||||
* constructor(private tealium: Tealium) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let tealConfig: TealConfig = {
|
||||
* account: "<your-account>",
|
||||
* profile: "<your-profile>",
|
||||
* environment: "<your-environment>", // usually "dev", "qa" or "prod"
|
||||
* isLifecycleEnabled: "true", // pass "false" to disable lifecycle tracking
|
||||
* isCrashReporterEnabled: "false", // pass "true" to enable crash reporter (Android only)
|
||||
* instance: "<your-instance-name" // an arbitrary instance name. use the same instance name for all subsequent API calls
|
||||
* }
|
||||
*
|
||||
* this.tealium.init(tealConfig).then(()=>{
|
||||
* this.tealium.trackView({"screen_name": "homescreen"});
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* TealConfig
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'Tealium',
|
||||
plugin: 'tealium-cordova-plugin', // npm package name, example: cordova-plugin-camera
|
||||
pluginRef: 'window.tealium', // the variable reference to call the plugin, example: navigator.geolocation
|
||||
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin
|
||||
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
install: '', // OPTIONAL install command, in case the plugin requires variables
|
||||
})
|
||||
|
||||
@Injectable()
|
||||
export class Tealium extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This function initializes the Tealium Cordova plugin.
|
||||
* This should usually be done inside the "deviceReady" handler.
|
||||
* @param config {TealConfig}
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
init(config: TealConfig): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
/**
|
||||
* This function tracks a view event in the Tealium Cordova plugin
|
||||
* @param dataObject {any} The JSON data object containing your key-value pairs
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
trackView(dataObject: any, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function tracks a link event in the Tealium Cordova plugin
|
||||
* @param dataObject {any} The JSON data object containing your key-value pairs
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
trackEvent(dataObject: any, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function tracks a custom event in the Tealium Cordova plugin
|
||||
* @param eventType {string} The event type, link or view
|
||||
* @param dataObject {any} The JSON data object containing your key-value pairs
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
track(eventType: string, dataObject: any, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds data to the Tealium persistent data store
|
||||
* @param keyName {string} The key name that this data will be stored under for later retrieval
|
||||
* @param value {any} The value to be stored as persistent data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
addPersistent(keyName: string, value: string | string[] | any, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds data to the Tealium volatile data store
|
||||
* @param keyName {string} The key name that this data will be stored under for later retrieval
|
||||
* @param value {any} The value to be stored as volatile data
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
addVolatile(keyName: string, value: string | string[], instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes data from the Tealium volatile data store
|
||||
* @param keyName {string} The key name that this data will removed from the Tealium data store
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
removeVolatile(keyName: string, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes data from the Tealium persistent data store
|
||||
* @param keyName {string} The key name that this data will removed from the Tealium data store
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
removePersistent(keyName: string, instanceName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function retrieves a value from the Tealium Persistent data store
|
||||
* @param keyName {string} The key name that this data will retrieved from the Tealium data store
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @param callback {any} A callback function that will be called when the data has been retrieved
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
getPersistent(keyName: string, instanceName: string, callback: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* This function retrieves a value from the Tealium Volatile data store
|
||||
* @param keyName {string} The key name that this data will retrieved from the Tealium data store
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @param callback {any} A callback function that will be called when the data has been retrieved
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
getVolatile(keyName: string, instanceName: string, callback: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function adds a remote command for later execution
|
||||
* @param commandName {string} The command name for this Remote Command
|
||||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
|
||||
* @param callback {any} A callback function that will be called when the data has been retrieved
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
addRemoteCommand(commandName: string, instanceName: string, callback: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function retrieves the Tealium Visitor ID
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
getVisitorId(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,9 +48,9 @@ export interface ThemeableBrowserOptions {
|
||||
|
||||
// inAppBrowser options
|
||||
location?: string;
|
||||
hidden?: string;
|
||||
clearcache?: string;
|
||||
clearsessioncache?: string;
|
||||
hidden?: boolean;
|
||||
clearcache?: boolean;
|
||||
clearsessioncache?: boolean;
|
||||
zoom?: string;
|
||||
hardwareback?: string;
|
||||
mediaPlaybackRequiresUserAction?: string;
|
||||
|
||||
@@ -58,6 +58,10 @@ export interface ThreeDeeTouchForceTouch {
|
||||
/**
|
||||
* @name 3D Touch
|
||||
* @description
|
||||
* The 3D Touch plugin adds 3D Touch capabilities to your Cordova app.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-3dtouch`. For more info, please see the [3D Touch plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-3dtouch).
|
||||
*
|
||||
* @usage
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
* ```typescript
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
/**
|
||||
* @name Uptime
|
||||
* @description
|
||||
* This plugin return the device uptime, without sleep time.
|
||||
* This plugin provides the time spent in milliseconds since boot (uptime).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -14,7 +14,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.uptime.getUptime()
|
||||
* this.uptime.getUptime(includeDeepSleep)
|
||||
* .then(uptime => console.log(uptime))
|
||||
* .catch(error => console.log(error));
|
||||
*
|
||||
@@ -31,10 +31,11 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
export class Uptime extends IonicNativePlugin {
|
||||
/**
|
||||
* This function return system uptime
|
||||
* @param {boolean} includeDeepSleep Set to true to include system deep sleep
|
||||
* @return {Promise<string>} Returns a promise that return the uptime in milliseconds
|
||||
*/
|
||||
@Cordova()
|
||||
getUptime(): Promise<string> {
|
||||
getUptime(includeDeepSleep: boolean): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,20 @@ import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IntentOptions {
|
||||
requestCode?: number;
|
||||
type?: string;
|
||||
package?: string;
|
||||
url?: string;
|
||||
extras?: object;
|
||||
action?: string;
|
||||
component?: {
|
||||
package: string;
|
||||
class: string;
|
||||
};
|
||||
flags?: number[];
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Web Intent
|
||||
* @description
|
||||
@@ -25,6 +39,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* this.webIntent.startActivity(options).then(onSuccess, onError);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IntentOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'WebIntent',
|
||||
@@ -97,30 +113,21 @@ export class WebIntent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Launches an Android intent
|
||||
* @param options {Object} { action: any, url: string, type?: string }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startActivity(options: {
|
||||
action: any;
|
||||
extras?: any;
|
||||
url: string;
|
||||
type?: string;
|
||||
}): Promise<any> {
|
||||
startActivity(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a new activity and return the result to the application
|
||||
* @param options {Object} { action: any, url: string, type?: string }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startActivityForResult(options: {
|
||||
action: any;
|
||||
url: string;
|
||||
type?: string;
|
||||
}): Promise<any> {
|
||||
startActivityForResult(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -166,36 +173,35 @@ export class WebIntent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Sends a custom intent passing optional extras
|
||||
* @param options {Object} { action: string, extras?: { option: boolean } }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sendBroadcast(options: {
|
||||
action: string;
|
||||
extras?: { option: boolean };
|
||||
}): Promise<any> {
|
||||
sendBroadcast(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that a given application service be started
|
||||
* @param options {Object} { action: string, extras?: { option: boolean } }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startService(options: {
|
||||
action: string;
|
||||
extras?: { option: boolean };
|
||||
}): Promise<any> {
|
||||
startService(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a broadcast receiver for the specified filters
|
||||
* @param filters {any}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
registerBroadcastReceiver(filters: any): void {}
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
registerBroadcastReceiver(filters: any): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters a broadcast receiver
|
||||
@@ -210,4 +216,14 @@ export class WebIntent extends IonicNativePlugin {
|
||||
getIntent(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a result back to the Intent that started this Activity.
|
||||
* The data can be passed using 'extras'.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sendResult({ extras: {}}): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name In App Review
|
||||
* @description
|
||||
* This plugin does use the iOS class SKStoreReviewController to open the inApp review popup available since iOS 10.3
|
||||
*
|
||||
* This functionality only works on iOS devices
|
||||
*
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { InAppReview } from '@ionic-native/in-app-review';
|
||||
*
|
||||
*
|
||||
* constructor(private inAppReview: InAppReview) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.inAppReview.requestReview()
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'InAppReview',
|
||||
plugin: 'com.omarben.inappreview',
|
||||
pluginRef: 'inappreview',
|
||||
repo: 'https://github.com/omaxlive/com.omarben.inappreview',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class InAppReview extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Open the inApp review popup
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
requestReview(): Promise<any> {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user