refactor: update lint rules

This commit is contained in:
Daniel 2018-09-17 17:09:46 +02:00
parent a7830693af
commit 0c7cfeeeb8
95 changed files with 1603 additions and 994 deletions

310
package-lock.json generated
View File

@ -40,6 +40,12 @@
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=",
"dev": true
},
"@types/fancy-log": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/fancy-log/-/fancy-log-1.3.0.tgz",
"integrity": "sha512-mQjDxyOM1Cpocd+vm1kZBP7smwKZ4TNokFeds9LV7OZibmPJFEzY3+xZMrKfUdNT71lv8GoCPD6upKwHxubClw==",
"dev": true
},
"@types/jasmine": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.8.tgz",
@ -201,6 +207,15 @@
}
}
},
"ansi-colors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
"integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
"dev": true,
"requires": {
"ansi-wrap": "^0.1.0"
}
},
"ansi-cyan": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz",
@ -210,6 +225,15 @@
"ansi-wrap": "0.1.0"
}
},
"ansi-gray": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz",
"integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=",
"dev": true,
"requires": {
"ansi-wrap": "0.1.0"
}
},
"ansi-red": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz",
@ -1776,6 +1800,27 @@
"object-visit": "^1.0.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"color-support": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
"dev": true
},
"colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
@ -1824,8 +1869,7 @@
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz",
"integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==",
"dev": true,
"optional": true
"dev": true
},
"compare-func": {
"version": "1.3.2",
@ -5428,14 +5472,108 @@
}
},
"gulp-tslint": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-6.1.2.tgz",
"integrity": "sha1-ni3oLvJaqkN4/Yn+W0Q7Pq9wL+0=",
"version": "8.1.3",
"resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-8.1.3.tgz",
"integrity": "sha512-KEP350N5B9Jg6o6jnyCyKVBPemJePYpMsGfIQq0G0ErvY7tw4Lrfb/y3L4WRf7ek0OsaE8nnj86w+lcLXW8ovw==",
"dev": true,
"requires": {
"gulp-util": "~3.0.7",
"map-stream": "~0.1.0",
"@types/fancy-log": "1.3.0",
"chalk": "2.3.1",
"fancy-log": "1.3.2",
"map-stream": "~0.0.7",
"plugin-error": "1.0.1",
"through": "~2.3.8"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"arr-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
"integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
"dev": true
},
"arr-union": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
"dev": true
},
"chalk": {
"version": "2.3.1",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz",
"integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.0",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.2.0"
}
},
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
"integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
"assign-symbols": "^1.0.0",
"is-extendable": "^1.0.1"
}
},
"fancy-log": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz",
"integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=",
"dev": true,
"requires": {
"ansi-gray": "^0.1.1",
"color-support": "^1.1.3",
"time-stamp": "^1.0.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "^2.0.4"
}
},
"plugin-error": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz",
"integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==",
"dev": true,
"requires": {
"ansi-colors": "^1.0.1",
"arr-diff": "^4.0.0",
"arr-union": "^3.1.0",
"extend-shallow": "^3.0.2"
}
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"gulp-util": {
@ -8193,9 +8331,9 @@
"dev": true
},
"map-stream": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
"integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=",
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz",
"integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=",
"dev": true
},
"map-visit": {
@ -10983,75 +11121,106 @@
"dev": true
},
"tslint": {
"version": "3.15.1",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-3.15.1.tgz",
"integrity": "sha1-2hZcqT2P3CwIa1EWXuG6y0jJjqU=",
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz",
"integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=",
"dev": true,
"requires": {
"colors": "^1.1.2",
"diff": "^2.2.1",
"findup-sync": "~0.3.0",
"glob": "^7.0.3",
"optimist": "~0.6.0",
"resolve": "^1.1.7",
"underscore.string": "^3.3.4"
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.27.2"
},
"dependencies": {
"colors": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
"integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
"dev": true
},
"diff": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz",
"integrity": "sha1-YOr9DSjukG5Oj/ClLBIpUhAzv5k=",
"dev": true
},
"findup-sync": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
"integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"glob": "~5.0.0"
},
"dependencies": {
"glob": {
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
"dev": true,
"requires": {
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"tslint-eslint-rules": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-1.6.1.tgz",
"integrity": "sha1-OekvMZVq0qZsAGHDUfqWwICK4Pg=",
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz",
"integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==",
"dev": true,
"requires": {
"doctrine": "^0.7.2",
"tslint": "^3.15.1"
"doctrine": "0.7.2",
"tslib": "1.9.0",
"tsutils": "^3.0.0"
},
"dependencies": {
"tslib": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==",
"dev": true
},
"tsutils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.0.0.tgz",
"integrity": "sha512-LjHBWR0vWAUHWdIAoTjoqi56Kz+FDKBgVEuL+gVPG/Pv7QW5IdaDDeK9Txlr6U0Cmckp5EgCIq1T25qe3J6hyw==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
}
}
},
"tslint-ionic-rules": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/tslint-ionic-rules/-/tslint-ionic-rules-0.0.8.tgz",
"integrity": "sha1-au1vjjzUBlIzAdHW0Db38DbdKAk=",
"version": "0.0.19",
"resolved": "https://registry.npmjs.org/tslint-ionic-rules/-/tslint-ionic-rules-0.0.19.tgz",
"integrity": "sha512-myxelwnK9FkR4mG+PnktKZ2DJp1UnX+22MyiC0V8QZc0464X6X63kRQU8vMtpVlazpvbifsXP9yxct2tHBrN4w==",
"dev": true,
"requires": {
"tslint-eslint-rules": "^1.3.0"
"@types/node": "^10.9.4",
"tslint-eslint-rules": "^5.3.1"
},
"dependencies": {
"@types/node": {
"version": "10.10.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.10.0.tgz",
"integrity": "sha512-0V36JTaif20jrbTbZeKqnI4R8nLVE8Ah/u9dQT5jIKXjW51/4ipi/B8Xon1ZiEHATYpgLNoBw2LFfdBMoA5Fzg==",
"dev": true
}
}
},
"tsscmp": {
@ -11061,6 +11230,15 @@
"dev": true,
"optional": true
},
"tsutils": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
},
"tty-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
@ -11177,16 +11355,6 @@
"underscore": "1.6.0"
}
},
"underscore.string": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz",
"integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=",
"dev": true,
"requires": {
"sprintf-js": "^1.0.3",
"util-deprecate": "^1.0.2"
}
},
"union-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",

View File

@ -22,7 +22,7 @@
"gulp": "3.9.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "6.1.2",
"gulp-tslint": "^8.1.3",
"jasmine-core": "^3.2.1",
"karma": "^2.0.5",
"karma-cli": "^1.0.1",
@ -38,8 +38,8 @@
"rimraf": "^2.6.2",
"rxjs": "^5.5.12",
"semver": "^5.5.1",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"tslint": "^5.11.0",
"tslint-ionic-rules": "0.0.19",
"typescript": "~2.4.2",
"zone.js": "^0.8.26"
},

View File

@ -133,7 +133,7 @@ describe('Regular Decorators', () => {
delete window.testPlugin;
window.cordova = true;
expect(<any>plugin.pingSync()).toEqual(ERR_PLUGIN_NOT_INSTALLED);
expect(plugin.pingSync() as any).toEqual(ERR_PLUGIN_NOT_INSTALLED);
plugin.ping().catch(e => {
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
@ -145,7 +145,7 @@ describe('Regular Decorators', () => {
it('should throw cordova_not_available error', (done: Function) => {
delete window.testPlugin;
expect(<any>plugin.pingSync()).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
expect(plugin.pingSync() as any).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
plugin.ping().catch(e => {
expect(e).toEqual(ERR_CORDOVA_NOT_AVAILABLE.error);

View File

@ -116,7 +116,7 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> => {
return {
value: function(...args: any[]): any {
value(...args: any[]): any {
if (instanceAvailability(this)) {
return descriptor.value.apply(this, args);
} else {
@ -145,7 +145,7 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> => {
return {
value: function(...args: any[]): any {
value(...args: any[]): any {
const check = checkAvailability(pluginObj);
if (check === true) {
return descriptor.value.apply(this, args);
@ -185,7 +185,7 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
export function Plugin(config: PluginConfig): ClassDecorator {
return function(cls: any) {
// Add these fields to the class
for (let prop in config) {
for (const prop in config) {
cls[prop] = config[prop];
}
@ -238,7 +238,7 @@ export function Cordova(opts: CordovaOptions = {}) {
descriptor: TypedPropertyDescriptor<any>
) => {
return {
value: function(...args: any[]) {
value(...args: any[]) {
return wrap(this, methodName, opts).apply(this, args);
},
enumerable: true
@ -254,7 +254,7 @@ export function Cordova(opts: CordovaOptions = {}) {
export function CordovaInstance(opts: CordovaOptions = {}) {
return (target: Object, methodName: string) => {
return {
value: function(...args: any[]) {
value(...args: any[]) {
return wrapInstance(this, methodName, opts).apply(this, args);
},
enumerable: true
@ -295,10 +295,10 @@ export function CordovaProperty(target: any, key: string) {
export function InstanceProperty(target: any, key: string) {
Object.defineProperty(target, key, {
enumerable: true,
get: function() {
get() {
return this._objectInstance[key];
},
set: function(value) {
set(value) {
this._objectInstance[key] = value;
}
});
@ -317,7 +317,7 @@ export function CordovaFunctionOverride(opts: any = {}) {
descriptor: TypedPropertyDescriptor<any>
) => {
return {
value: function(...args: any[]) {
value(...args: any[]) {
return overrideFunction(this, methodName, opts);
},
enumerable: true

View File

@ -105,7 +105,7 @@ function setIndex(
opts.successName &&
opts.errorName
) {
let obj: any = {};
const obj: any = {};
obj[opts.successName] = resolve;
obj[opts.errorName] = reject;
args.push(obj);

View File

@ -6,7 +6,7 @@ declare const window: any;
export const get = (element: Element | Window, path: string): any => {
const paths: string[] = path.split('.');
let obj: any = element;
for (let i: number = 0; i < paths.length; i++) {
for (let i = 0; i < paths.length; i++) {
if (!obj) {
return null;
}

View File

@ -21,12 +21,12 @@ export interface TextCaptureOptions {
* for example: ["English", "French", "German"]. Empty array
* disables language selection.
*/
selectableRecognitionLanguages?: Array<string>;
selectableRecognitionLanguages?: string[];
/**
* Recognition language selected by default.
*/
recognitionLanguages?: Array<string>;
recognitionLanguages?: string[];
/**
* Width and height of the recognition area, separated by a
@ -75,7 +75,7 @@ export interface TextCaptureResult {
* · rect (string): position and size of the bounding rectangle,
* a string of 4 integers separated with whitespaces ("x y width height").
*/
textLines: Array<{ text: string, quadrangle: string, rect?: string }>;
textLines: { text: string, quadrangle: string, rect?: string }[];
/**
* Additional information. This object has the following keys:
@ -94,7 +94,7 @@ export interface TextCaptureResult {
stabilityStatus: string,
userAction: string,
frameSize: string,
recognitionLanguages: Array<string>
recognitionLanguages: string[]
};
/**
@ -136,8 +136,8 @@ export interface DataCaptureOptions {
customDataCaptureScenario?: {
name: string,
description: string,
recognitionLanguages: Array<string>,
fields: Array<{ regEx: string }>
recognitionLanguages: string[],
fields: { regEx: string }[]
};
/**

View File

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

View File

@ -14,8 +14,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* private secureKey: string;
* private secureIV: string;
*
* constructor(private aes256: AES256) {
*
* constructor(private aes256: AES256) {
* this.generateSecureKeyAndIV(); // To generate the random secureKey and secureIV
* }
*
@ -34,16 +34,16 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* .then(res => console.log('Decrypted Data : ',res))
* .catch((error: any) => console.error(error));
*
*
*
* * this.aes256.generateSecureKey('random password 12345')
* .then(res => console.log('Secure Key : ',res))
* .catch((error: any) => console.error(error));
*
*
*
*
* * this.aes256.generateSecureIV('random password 12345')
* .then(res => console.log('Secure IV : ',res))
* .catch((error: any) => console.error(error));
*
*
* ```
*/
@Plugin({

View File

@ -75,7 +75,7 @@ export interface AppRateCustomLocale {
/** No button label */
noButtonLabel?: string;
/** App rate promt title */
/** App rate prompt title */
appRatePromptTitle?: string;
/** Feedback prompt title */

View File

@ -63,7 +63,7 @@ export interface AppsflyerInviteOptions {
* this.appsflyer.initSdk(options);
*
* ```
*
*
* @interfaces
* AppsflyerOptions
* AppsflyerEvent

View File

@ -3,7 +3,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface BackgroundGeolocationResponse {
/**
* ID of location as stored in DB (or null)
*/
@ -50,8 +49,8 @@ export interface BackgroundGeolocationResponse {
altitude: number;
/**
* accuracy of the altitude if available.
*/
* accuracy of the altitude if available.
*/
altitudeAccuracy: number;
/**
@ -71,7 +70,6 @@ export interface BackgroundGeolocationResponse {
}
export interface BackgroundGeolocationConfig {
/**
* Desired accuracy in meters. Possible values [0, 10, 100, 1000]. The lower
* the number, the more power devoted to GeoLocation resulting in higher
@ -108,19 +106,19 @@ export interface BackgroundGeolocationConfig {
*/
stopOnTerminate?: boolean;
/**
* ANDROID ONLY
* Start background service on device boot.
/**
* ANDROID ONLY
* Start background service on device boot.
*
* Defaults to false
* Defaults to false
*/
startOnBoot?: boolean;
/**
* ANDROID ONLY
/**
* ANDROID ONLY
* If false location service will not be started in foreground and no notification will be shown.
*
* Defaults to true
* Defaults to true
*/
startForeground?: boolean;
@ -155,17 +153,17 @@ export interface BackgroundGeolocationConfig {
*/
notificationIconColor?: string;
/**
* ANDROID ONLY
* The filename of a custom notification icon. See android quirks.
* NOTE: Only available for API Level >=21.
/**
* ANDROID ONLY
* The filename of a custom notification icon. See android quirks.
* NOTE: Only available for API Level >=21.
*/
notificationIconLarge?: string;
/**
* ANDROID ONLY
* The filename of a custom notification icon. See android quirks.
* NOTE: Only available for API Level >=21.
/**
* ANDROID ONLY
* The filename of a custom notification icon. See android quirks.
* NOTE: Only available for API Level >=21.
*/
notificationIconSmall?: string;
@ -183,50 +181,50 @@ export interface BackgroundGeolocationConfig {
*/
activityType?: string;
/**
* IOS ONLY
* Pauses location updates when app is paused
/**
* IOS ONLY
* Pauses location updates when app is paused
*
* Defaults to true
* Defaults to true
*/
pauseLocationUpdates?: boolean;
/**
* Server url where to send HTTP POST with recorded locations
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
/**
* Server url where to send HTTP POST with recorded locations
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
*/
url?: string;
/**
* Server url where to send fail to post locations
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
/**
* Server url where to send fail to post locations
* @see https://github.com/mauron85/cordova-plugin-background-geolocation#http-locations-posting
*/
syncUrl?: string;
/**
* Specifies how many previously failed locations will be sent to server at once
* Specifies how many previously failed locations will be sent to server at once
*
* Defaults to 100
* Defaults to 100
*/
syncThreshold?: number;
/**
* Optional HTTP headers sent along in HTTP request
/**
* Optional HTTP headers sent along in HTTP request
*/
httpHeaders?: any;
/**
* IOS ONLY
* IOS ONLY
* Switch to less accurate significant changes and region monitory when in background (default)
*
* Defaults to 100
* Defaults to 100
*/
saveBatteryOnBackground?: boolean;
/**
* Limit maximum number of locations stored into db
/**
* Limit maximum number of locations stored into db
*
* Defaults to 10000
* Defaults to 10000
*/
maxLocations?: number;
@ -310,15 +308,14 @@ export interface BackgroundGeolocationConfig {
})
@Injectable()
export class BackgroundGeolocation extends IonicNativePlugin {
/**
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers
/**
* Set location service provider @see https://github.com/mauron85/cordova-plugin-background-geolocation/wiki/Android-providers
*
* Possible values:
* ANDROID_DISTANCE_FILTER_PROVIDER: 0,
* ANDROID_ACTIVITY_PROVIDER: 1
* ANDROID_DISTANCE_FILTER_PROVIDER: 0,
* ANDROID_ACTIVITY_PROVIDER: 1
*
* @enum {number}
* @enum {number}
*/
LocationProvider: any = {
ANDROID_DISTANCE_FILTER_PROVIDER: 0,
@ -326,17 +323,17 @@ export class BackgroundGeolocation extends IonicNativePlugin {
};
/**
* Desired accuracy in meters. Possible values [0, 10, 100, 1000].
* The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings.
* 1000 results in lowest power drain and least accurate readings.
* Desired accuracy in meters. Possible values [0, 10, 100, 1000].
* The lower the number, the more power devoted to GeoLocation resulting in higher accuracy readings.
* 1000 results in lowest power drain and least accurate readings.
*
* Possible values:
* HIGH: 0
* MEDIUM: 10
* LOW: 100
* HIGH: 0
* MEDIUM: 10
* LOW: 100
* PASSIVE: 1000
*
* enum {number}
* enum {number}
*/
Accuracy: any = {
HIGH: 0,
@ -345,14 +342,14 @@ export class BackgroundGeolocation extends IonicNativePlugin {
PASSIVE: 1000
};
/**
* Used in the switchMode function
/**
* Used in the switchMode function
*
* Possible values:
* BACKGROUND: 0
* FOREGROUND: 1
* FOREGROUND: 1
*
* @enum {number}
* @enum {number}
*/
Mode: any = {
BACKGROUND: 0,
@ -369,7 +366,11 @@ export class BackgroundGeolocation extends IonicNativePlugin {
callbackOrder: 'reverse',
observable: true
})
configure(options: BackgroundGeolocationConfig): Observable<BackgroundGeolocationResponse> { return; }
configure(
options: BackgroundGeolocationConfig
): Observable<BackgroundGeolocationResponse> {
return;
}
/**
* Turn ON the background-geolocation system.
@ -377,14 +378,18 @@ export class BackgroundGeolocation extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
start(): Promise<any> { return; }
start(): Promise<any> {
return;
}
/**
* Turn OFF background-tracking
* @returns {Promise<any>}
*/
@Cordova()
stop(): Promise<any> { return; }
stop(): Promise<any> {
return;
}
/**
* Inform the native plugin that you're finished, the background-task may be completed
@ -393,7 +398,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
finish(): Promise<any> { return; }
finish(): Promise<any> {
return;
}
/**
* Force the plugin to enter "moving" or "stationary" state
@ -403,7 +410,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
changePace(isMoving: boolean): Promise<any> { return; }
changePace(isMoving: boolean): Promise<any> {
return;
}
/**
* Setup configuration
@ -413,7 +422,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
setConfig(options: BackgroundGeolocationConfig): Promise<any> { return; }
setConfig(options: BackgroundGeolocationConfig): Promise<any> {
return;
}
/**
* Returns current stationaryLocation if available. null if not
@ -422,7 +433,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
getStationaryLocation(): Promise<BackgroundGeolocationResponse> {
return;
}
/**
* Add a stationary-region listener. Whenever the devices enters "stationary-mode",
@ -432,7 +445,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
onStationary(): Promise<any> { return; }
onStationary(): Promise<any> {
return;
}
/**
* Check if location is enabled on the device
@ -441,19 +456,21 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
isLocationEnabled(): Promise<number> { return; }
isLocationEnabled(): Promise<number> {
return;
}
/**
* Display app settings to change permissions
*/
@Cordova({ sync: true })
showAppSettings(): void { }
showAppSettings(): void {}
/**
* Display device location settings
*/
@Cordova({ sync: true })
showLocationSettings(): void { }
showLocationSettings(): void {}
/**
* Method can be used to detect user changes in location services settings.
@ -465,7 +482,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
platforms: ['Android'],
observable: true
})
watchLocationMode(): Observable<number> { return; }
watchLocationMode(): Observable<number> {
return;
}
/**
* Stop watching for location mode changes.
@ -474,7 +493,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
stopWatchingLocationMode(): Promise<any> { return; }
stopWatchingLocationMode(): Promise<any> {
return;
}
/**
* Method will return all stored locations.
@ -488,14 +509,18 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
getLocations(): Promise<any> { return; }
getLocations(): Promise<any> {
return;
}
/**
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
/**
* Method will return locations, which has not been yet posted to server. NOTE: Locations does contain locationId.
* @returns {Promise<any>}
*/
@Cordova()
getValidLocations(): Promise<any> { return; }
getValidLocations(): Promise<any> {
return;
}
/**
* Delete stored location by given locationId.
@ -505,7 +530,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
deleteLocation(locationId: number): Promise<any> { return; }
deleteLocation(locationId: number): Promise<any> {
return;
}
/**
* Delete all stored locations.
@ -514,34 +541,39 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
deleteAllLocations(): Promise<any> { return; }
deleteAllLocations(): Promise<any> {
return;
}
/**
* Normally plugin will handle switching between BACKGROUND and FOREGROUND mode itself.
* Calling switchMode you can override plugin behavior and force plugin to switch into other mode.
*
* In FOREGROUND mode plugin uses iOS local manager to receive locations and behavior is affected by option.desiredAccuracy and option.distanceFilter.
* In BACKGROUND mode plugin uses significant changes and region monitoring to receive locations and uses option.stationaryRadius only.
* In BACKGROUND mode plugin uses significant changes and region monitoring to receive locations and uses option.stationaryRadius only.
*
* BackgroundGeolocation.Mode.FOREGROUND
* BackgroundGeolocation.Mode.BACKGROUND
**
* BackgroundGeolocation.Mode.BACKGROUND
*
* @param modeId {number}
* @returns {Promise<any>}
*/
@Cordova({
platforms: ['iOS']
})
switchMode(modeId: number): Promise<any> { return; }
switchMode(modeId: number): Promise<any> {
return;
}
/**
* Return all logged events. Useful for plugin debugging. Parameter limit limits number of returned entries.
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
/**
* Return all logged events. Useful for plugin debugging. Parameter limit limits number of returned entries.
* @see https://github.com/mauron85/cordova-plugin-background-geolocation/tree/v2.2.1#debugging for more information.
*
* @param limit {number} Limits the number of entries
* @param limit {number} Limits the number of entries
* @returns {Promise<any>}
*/
@Cordova()
getLogEntries(limit: number): Promise<any> { return; }
getLogEntries(limit: number): Promise<any> {
return;
}
}

View File

@ -55,7 +55,7 @@ export interface BackgroundModeConfiguration {
* @description
* Cordova plugin to prevent the app from going to sleep while in background.
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, visit: https://github.com/katzer/cordova-plugin-background-mode
*@usage
* @usage
* ```typescript
* import { BackgroundMode } from '@ionic-native/background-mode';
*

View File

@ -589,7 +589,6 @@ export class BLE extends IonicNativePlugin {
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.
@ -599,7 +598,7 @@ export class BLE extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
*/
@Cordova()
connectedPeripheralsWithServices (services: string[]): Promise<any[]> {
connectedPeripheralsWithServices(services: string[]): Promise<any[]> {
return;
}
@ -611,7 +610,7 @@ export class BLE extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
*/
@Cordova()
peripheralsWithIdentifiers (uuids: string[]): Promise<any[]> {
peripheralsWithIdentifiers(uuids: string[]): Promise<any[]> {
return;
}
@ -622,7 +621,7 @@ export class BLE extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise with a list of peripheral objects
*/
@Cordova()
bondedDevices (): Promise<any[]> {
bondedDevices(): Promise<any[]> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/* Available status of device */
@ -67,7 +72,7 @@ export interface InitParams extends InitPeripheralParams {
export interface ScanParams {
/* An array of service IDs to filter the scan or empty array / null. This parameter is not supported on Windows platform yet */
services?: string[];
/** True/false to allow duplicate advertisement packets, defaults to false (iOS)*/
/* True/false to allow duplicate advertisement packets, defaults to false (iOS)*/
allowDuplicates?: boolean;
/** Defaults to Low Power. Available from API21 / API 23 (Android) */
scanMode?: BluetoothScanMode;
@ -181,7 +186,7 @@ export interface MTU extends DeviceInfo {
}
export interface BondedStatus extends CommonInfo {
/** Bonded status*/
/* Bonded status*/
isBonded: boolean;
}
@ -322,7 +327,7 @@ export interface DescriptorResult extends OperationResult {
export interface Characteristics extends DeviceInfo {
/** Service's id */
service: string;
/** Array of characteristic objects*/
/* Array of characteristic objects*/
characteristics: Characteristic[];
}

View File

@ -7,8 +7,8 @@ export interface CallDirectoryItem {
}
export interface CallDirectoryLog {
plugin: Array<string>;
extension: Array<string>;
plugin: string[];
extension: string[];
}
/**
@ -66,7 +66,7 @@ export class CallDirectory extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when numbers are added
*/
@Cordova()
addIdentification(items: Array<CallDirectoryItem>): Promise<any> {
addIdentification(items: CallDirectoryItem[]): Promise<any> {
return;
}
@ -76,7 +76,7 @@ export class CallDirectory extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when numbers are removed
*/
@Cordova()
removeIdentification(items: Array<CallDirectoryItem>): Promise<any> {
removeIdentification(items: CallDirectoryItem[]): Promise<any> {
return;
}
@ -94,7 +94,7 @@ export class CallDirectory extends IonicNativePlugin {
* @return {Array<CallDirectoryItem>} Returns a promise that resolves with an array of all items
*/
@Cordova()
getAllItems(): Promise<Array<CallDirectoryItem>> {
getAllItems(): Promise<CallDirectoryItem[]> {
return;
}

View File

@ -3,7 +3,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CallLogObject {
name: string;
value: string | Array<string>;
value: string | string[];
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like';
}

View File

@ -33,7 +33,7 @@ export interface CameraOptions {
/**
* Width in pixels to scale image. Must be used with targetHeight.
* Aspect ratio remains constant.
*/
*/
targetWidth?: number;
/**
* Height in pixels to scale image. Must be used with targetWidth.
@ -165,7 +165,6 @@ export enum Direction {
})
@Injectable()
export class Camera extends IonicNativePlugin {
/**
* Constant for possible destination types
*/
@ -200,7 +199,6 @@ export class Camera extends IonicNativePlugin {
ALLMEDIA: 2
};
/**
* Convenience constant
*/
@ -213,7 +211,6 @@ export class Camera extends IonicNativePlugin {
SAVEDPHOTOALBUM: 2
};
/**
* Convenience constant
*/
@ -243,7 +240,9 @@ export class Camera extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getPicture(options?: CameraOptions): Promise<any> { return; }
getPicture(options?: CameraOptions): Promise<any> {
return;
}
/**
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture.
@ -253,6 +252,7 @@ export class Camera extends IonicNativePlugin {
@Cordova({
platforms: ['iOS']
})
cleanup(): Promise<any> { return; };
cleanup(): Promise<any> {
return;
}
}

View File

@ -130,16 +130,16 @@ export interface CardIOResponse {
* @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>
*<string>To scan credit cards.</string>
*```
* <key>NSCameraUsageDescription</key>
* <string>To scan credit cards.</string>
* ```
* ```typescript
* import { CardIO } from '@ionic-native/card-io';
*

View File

@ -11,7 +11,7 @@ declare var clevertap: any;
* @usage
* ```typescript
* import { CleverTap } from '@ionic-native/clevertap';
*
* constructor(private clevertap: CleverTap) { }
*
* ```

View File

@ -25,7 +25,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
* alert('Error: ' + reject);
* }
* );
*
*
* this.clipboard.clear();
* ```
*/
@ -38,27 +38,31 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Clipboard extends IonicNativePlugin {
/**
* Copies the given text
* @param {string} text Text that gets copied on the system clipboard
* @returns {Promise<any>} Returns a promise after the text has been copied
*/
@Cordova()
copy(text: string): Promise<any> { return; }
copy(text: string): Promise<any> {
return;
}
/**
* Pastes the text stored in clipboard
* @returns {Promise<any>} Returns a promise after the text has been pasted
*/
@Cordova()
paste(): Promise<any> { return; }
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; }
clear(): Promise<any> {
return;
}
}

View File

@ -152,15 +152,9 @@ interface NativeUpdateNotification {
appVersion: string;
}
export interface Callback<T> {
(error: Error, parameter: T): void;
}
export interface SuccessCallback<T> {
(result?: T): void;
}
export interface ErrorCallback {
(error?: Error): void;
}
export type Callback<T> = (error: Error, parameter: T) => void;
export type SuccessCallback<T> = (result?: T) => void;
export type ErrorCallback = (error?: Error) => void;
interface Configuration {
appVersion: string;
@ -177,18 +171,18 @@ declare class AcquisitionStatus {
declare class AcquisitionManager {
constructor(httpRequester: Http.Requester, configuration: Configuration);
public queryUpdateWithCurrentPackage(
queryUpdateWithCurrentPackage(
currentPackage: IPackage,
callback?: Callback<IRemotePackage | NativeUpdateNotification>
): void;
public reportStatusDeploy(
reportStatusDeploy(
pkg?: IPackage,
status?: string,
previousLabelOrAppVersion?: string,
previousDeploymentKey?: string,
callback?: Callback<void>
): void;
public reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
}
interface CodePushCordovaPlugin {

View File

@ -117,8 +117,8 @@ export class Contact implements IContactProperties {
@InstanceCheck()
clone(): Contact {
let newContact: any = new Contact();
for (let prop in this) {
const newContact: any = new Contact();
for (const prop in this) {
if (prop === 'id') return;
newContact[prop] = this[prop];
}
@ -403,8 +403,8 @@ export class Contacts extends IonicNativePlugin {
* @hidden
*/
function processContact(contact: any) {
let newContact = new Contact();
for (let prop in contact) {
const newContact = new Contact();
for (const prop in contact) {
if (typeof contact[prop] === 'function') continue;
newContact[prop] = contact[prop];
}

View File

@ -1,7 +1,6 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name Couchbase Lite
* @description
@ -66,8 +65,8 @@ import { Injectable } from '@angular/core';
* .catch((error:any) => {
* return Observable.throw(error.json() || 'Couchbase Lite error');
* }) .
* }
* createDocument(database_name:string,document){
* }
* createDocument(database_name:string,document){
* let url = this.getUrl();
* url = url + database_name;
* return this._http
@ -84,9 +83,9 @@ import { Injectable } from '@angular/core';
* createDocument('justbe', document);
* // successful response
* { "id": "string","rev": "string","ok": true }
* updateDocument(database_name:string,document){
* updateDocument(database_name:string,document){
* let url = this.getUrl();
* url = url + database_name + '/' + document._id;
* url = url + database_name + '/' + document._id;
* return this._http
* .put(url,document)
* .map(data => { this.results = data['results'] })
@ -121,7 +120,6 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class CouchbaseLite extends IonicNativePlugin {
/**
* Get the database url
* @return {Promise<any>} Returns a promise that resolves with the local database url
@ -129,6 +127,7 @@ export class CouchbaseLite extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
getURL(): Promise<any> { return; }
getURL(): Promise<any> {
return;
}
}

View File

@ -123,7 +123,7 @@ export class Deeplinks extends IonicNativePlugin {
* promise result which you can then use to navigate in the app as you see fit.
*
* @param {Object} paths
*
*
* @param {DeeplinkOptions} options
*
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and

View File

@ -1,10 +1,5 @@
import { Injectable } from '@angular/core';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Diagnostic

View File

@ -15,17 +15,17 @@ export interface EmailComposerOptions {
/**
* Email address(es) for To field
*/
to?: string | Array<string>;
to?: string | string[];
/**
* Email address(es) for CC field
*/
cc?: string | Array<string>;
cc?: string | string[];
/**
* Email address(es) for BCC field
*/
bcc?: string | Array<string>;
bcc?: string | string[];
/**
* File paths or base64 data streams

View File

@ -6,7 +6,7 @@ export interface IOSFilePickerPosition {
y: number;
width: number;
height: number;
};
}
/**
* @name iOS File Picker

View File

@ -152,7 +152,7 @@ export interface FileTransferError {
* // error
* })
* }
**
*
* download() {
* const url = 'http://www.example.com/file.pdf';
* fileTransfer.download(url, this.file.dataDirectory + 'file.pdf').then((entry) => {

View File

@ -371,84 +371,52 @@ export interface FileEntry extends Entry {
/**
* When requestFileSystem() succeeds, the following callback is made.
*/
export interface FileSystemCallback {
/**
* @param filesystem The file systems to which the app is granted access.
*/
(filesystem: FileSystem): void;
}
export type FileSystemCallback = (filesystem: FileSystem) => void;
/**
* This export interface is the callback used to look up Entry objects.
*/
export interface EntryCallback {
/**
* @param entry
*/
(entry: Entry): void;
}
export type EntryCallback = (entry: Entry) => void;
/**
* This export interface is the callback used to look up FileEntry objects.
*/
export interface FileEntryCallback {
/**
* @param entry
*/
(entry: FileEntry): void;
}
export type FileEntryCallback = (entry: FileEntry) => void;
/**
* This export interface is the callback used to look up DirectoryEntry objects.
*/
export interface DirectoryEntryCallback {
/**
* @param entry
*/
(entry: DirectoryEntry): void;
}
export type DirectoryEntryCallback = (entry: DirectoryEntry) => void;
/**
* When readEntries() succeeds, the following callback is made.
*/
export interface EntriesCallback {
(entries: Entry[]): void;
}
export type EntriesCallback = (entries: Entry[]) => void;
/**
* This export interface is the callback used to look up file and directory metadata.
*/
export interface MetadataCallback {
(metadata: Metadata): void;
}
export type MetadataCallback = (metadata: Metadata) => void;
/**
* This export interface is the callback used to create a FileWriter.
*/
export interface FileWriterCallback {
(fileWriter: FileWriter): void;
}
export type FileWriterCallback = (fileWriter: FileWriter) => void;
/**
* This export interface is the callback used to obtain a File.
*/
export interface FileCallback {
(file: IFile): void;
}
export type FileCallback = (file: IFile) => void;
/**
* This export interface is the generic callback used to indicate success of an asynchronous method.
*/
export interface VoidCallback {
(): void;
}
export type VoidCallback = () => void;
/**
* When an error occurs, the following callback is made.
*/
export interface ErrorCallback {
(err: FileError): void;
}
export type ErrorCallback = (err: FileError) => void;
export interface RemoveResult {
success: boolean;
@ -681,63 +649,75 @@ export class File extends IonicNativePlugin {
/**
* Read-only directory where the application is installed.
*/
@CordovaProperty applicationDirectory: string;
@CordovaProperty
applicationDirectory: string;
/**
* Read-only directory where the application is installed.
*/
@CordovaProperty applicationStorageDirectory: string;
@CordovaProperty
applicationStorageDirectory: string;
/**
* Where to put app-specific data files.
*/
@CordovaProperty dataDirectory: string;
@CordovaProperty
dataDirectory: string;
/**
* Cached files that should survive app restarts.
* Apps should not rely on the OS to delete files in here.
*/
@CordovaProperty cacheDirectory: string;
@CordovaProperty
cacheDirectory: string;
/**
* Android: the application space on external storage.
*/
@CordovaProperty externalApplicationStorageDirectory: string;
@CordovaProperty
externalApplicationStorageDirectory: string;
/**
* Android: Where to put app-specific data files on external storage.
*/
@CordovaProperty externalDataDirectory: string;
@CordovaProperty
externalDataDirectory: string;
/**
* Android: the application cache on external storage.
*/
@CordovaProperty externalCacheDirectory: string;
@CordovaProperty
externalCacheDirectory: string;
/**
* Android: the external storage (SD card) root.
*/
@CordovaProperty externalRootDirectory: string;
@CordovaProperty
externalRootDirectory: string;
/**
* iOS: Temp directory that the OS can clear at will.
*/
@CordovaProperty tempDirectory: string;
@CordovaProperty
tempDirectory: string;
/**
* iOS: Holds app-specific files that should be synced (e.g. to iCloud).
*/
@CordovaProperty syncedDataDirectory: string;
@CordovaProperty
syncedDataDirectory: string;
/**
* iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
*/
@CordovaProperty documentsDirectory: string;
@CordovaProperty
documentsDirectory: string;
/**
* BlackBerry10: Files globally available to all apps
*/
@CordovaProperty sharedDirectory: string;
@CordovaProperty
sharedDirectory: string;
cordovaFileError: any = {
1: 'NOT_FOUND_ERR',
@ -777,7 +757,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
checkDir(path: string, dir: string): Promise<boolean> {
if (/^\//.test(dir)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<any>(err);
}
@ -805,12 +785,12 @@ export class File extends IonicNativePlugin {
replace: boolean
): Promise<DirectoryEntry> {
if (/^\//.test(dirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<any>(err);
}
let options: Flags = {
const options: Flags = {
create: true
};
@ -833,7 +813,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
removeDir(path: string, dirName: string): Promise<RemoveResult> {
if (/^\//.test(dirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<any>(err);
}
@ -866,7 +846,7 @@ export class File extends IonicNativePlugin {
newDirName = newDirName || dirName;
if (/^\//.test(newDirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<any>(err);
}
@ -899,7 +879,7 @@ export class File extends IonicNativePlugin {
newDirName: string
): Promise<Entry> {
if (/^\//.test(newDirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<any>(err);
}
@ -925,7 +905,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
listDir(path: string, dirName: string): Promise<Entry[]> {
if (/^\//.test(dirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<Entry[]>(err);
}
@ -938,7 +918,7 @@ export class File extends IonicNativePlugin {
});
})
.then(de => {
let reader = de.createReader();
const reader = de.createReader();
return this.readEntries(reader);
});
}
@ -953,7 +933,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
removeRecursively(path: string, dirName: string): Promise<RemoveResult> {
if (/^\//.test(dirName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'directory cannot start with /';
return Promise.reject<RemoveResult>(err);
}
@ -977,7 +957,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
checkFile(path: string, file: string): Promise<boolean> {
if (/^\//.test(file)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file cannot start with /';
return Promise.reject<any>(err);
}
@ -986,7 +966,7 @@ export class File extends IonicNativePlugin {
if (fse.isFile) {
return true;
} else {
let err = new FileError(13);
const err = new FileError(13);
err.message = 'input is not a file';
return Promise.reject<boolean>(err);
}
@ -1010,12 +990,12 @@ export class File extends IonicNativePlugin {
replace: boolean
): Promise<FileEntry> {
if (/^\//.test(fileName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file-name cannot start with /';
return Promise.reject<any>(err);
}
let options: Flags = {
const options: Flags = {
create: true
};
@ -1038,7 +1018,7 @@ export class File extends IonicNativePlugin {
@CordovaCheck()
removeFile(path: string, fileName: string): Promise<RemoveResult> {
if (/^\//.test(fileName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file-name cannot start with /';
return Promise.reject<any>(err);
}
@ -1052,8 +1032,8 @@ export class File extends IonicNativePlugin {
});
}
/** Write a new file to the desired location.
*
/**
* Write a new file to the desired location.
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
* @param {string} fileName path relative to base path
* @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
@ -1087,8 +1067,8 @@ export class File extends IonicNativePlugin {
});
}
/** Write content to FileEntry.
*
/**
* Write content to FileEntry.
* @hidden
* @param {FileEntry} fe file entry object
* @param {string | Blob} text content or blob to write
@ -1115,8 +1095,8 @@ export class File extends IonicNativePlugin {
.then(() => fe);
}
/** Write to an existing file.
*
/**
* Write to an existing file.
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
* @param {string} fileName path relative to base path
* @param {string | Blob} text content or blob to write
@ -1147,7 +1127,7 @@ export class File extends IonicNativePlugin {
* Read file and return data as a base64 encoded data url.
* A data url is of the form:
* data: [<mediatype>][;base64],<data>
*
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
* @param {string} file Name of file, relative to path.
* @returns {Promise<string>} Returns a Promise that resolves with the contents of the file as data URL or rejects with an error.
@ -1185,7 +1165,7 @@ export class File extends IonicNativePlugin {
readAs: 'ArrayBuffer' | 'BinaryString' | 'DataURL' | 'Text'
): Promise<T> {
if (/^\//.test(file)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file-name cannot start with /';
return Promise.reject<any>(err);
}
@ -1199,7 +1179,7 @@ export class File extends IonicNativePlugin {
return new Promise<T>((resolve, reject) => {
reader.onloadend = () => {
if (reader.result !== undefined || reader.result !== null) {
resolve(<T>(<any>reader.result));
resolve((reader.result as any) as T);
} else if (reader.error !== undefined || reader.error !== null) {
reject(reader.error);
} else {
@ -1238,7 +1218,7 @@ export class File extends IonicNativePlugin {
newFileName = newFileName || fileName;
if (/^\//.test(newFileName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file name cannot start with /';
return Promise.reject<any>(err);
}
@ -1273,7 +1253,7 @@ export class File extends IonicNativePlugin {
newFileName = newFileName || fileName;
if (/^\//.test(newFileName)) {
let err = new FileError(5);
const err = new FileError(5);
err.message = 'file name cannot start with /';
return Promise.reject<any>(err);
}
@ -1333,7 +1313,7 @@ export class File extends IonicNativePlugin {
resolveDirectoryUrl(directoryUrl: string): Promise<DirectoryEntry> {
return this.resolveLocalFilesystemUrl(directoryUrl).then(de => {
if (de.isDirectory) {
return <DirectoryEntry>de;
return de as DirectoryEntry;
} else {
const err = new FileError(13);
err.message = 'input is not a directory';

View File

@ -21,7 +21,7 @@ export interface IDynamicLink {
* Preferences GoogleIOSClientId and GoogleAndroidClientId are used to setup dynamic links when you have an app for several platforms.
* You can find values at your GoogleService-Info.plist (key ANDROID_CLIENT_ID) and google-services.json (key client[0].oauth_client[0].client_id).
*
*config.xml:
* config.xml:
* ```xml
* <platform name="ios">
* <preference name="GoogleIOSClientId" value="..." />

View File

@ -320,7 +320,7 @@ export class Firebase extends IonicNativePlugin {
})
verifyPhoneNumber(
phoneNumber: string,
timeoutDuration: number = 0
timeoutDuration = 0
): Promise<any> {
return;
}

View File

@ -96,7 +96,7 @@ export class Geofence extends IonicNativePlugin {
* @return {Observable<any>}
*/
@CordovaFunctionOverride()
onTransitionReceived(): Observable<any> { return; };
onTransitionReceived(): Observable<any> { return; }
/**
* Initializes the plugin. User will be prompted to allow the app to use location and notifications.
@ -104,7 +104,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
initialize(): Promise<void> { return; };
initialize(): Promise<void> { return; }
/**
* Adds a new geofence or array of geofences. For geofence object, see above.
@ -112,7 +112,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
addOrUpdate(geofences: Object | Object[]): Promise<void> { return; }
/**
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
@ -121,7 +121,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
remove(geofenceId: string | Array<string>): Promise<void> { return; };
remove(geofenceId: string | string[]): Promise<void> { return; }
/**
* Removes all geofences.
@ -129,7 +129,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
removeAll(): Promise<void> { return; };
removeAll(): Promise<void> { return; }
/**
* Returns an array of geofences currently being monitored.
@ -137,7 +137,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<Array<string>>}
*/
@Cordova()
getWatched(): Promise<string> { return; };
getWatched(): Promise<string> { return; }
/**
* Called when the user clicks a geofence notification. iOS and Android only.

View File

@ -5,7 +5,6 @@ import { Observable } from 'rxjs/Observable';
declare const navigator: any;
export interface Coordinates {
/**
* a double representing the position's latitude in decimal degrees.
*/
@ -49,7 +48,6 @@ export interface Coordinates {
* This value can be null.
*/
speed: number;
}
export interface Geoposition {
@ -65,7 +63,6 @@ export interface Geoposition {
}
export interface PositionError {
/**
* A code that indicates the error that occurred
*/
@ -75,11 +72,9 @@ export interface PositionError {
* A message that can describe the error that occurred
*/
message: string;
}
export interface GeolocationOptions {
/**
* Is a positive long value indicating the maximum age in milliseconds of a
* possible cached position that is acceptable to return. If set to 0, it
@ -107,7 +102,6 @@ export interface GeolocationOptions {
* @type {boolean}
*/
enableHighAccuracy?: boolean;
}
/**
@ -161,13 +155,13 @@ export interface GeolocationOptions {
plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation',
install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
install:
'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
export class Geolocation extends IonicNativePlugin {
/**
* Get the device's current position.
*
@ -177,7 +171,9 @@ export class Geolocation extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return; }
getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> {
return;
}
/**
* Watch the current device's position. Clear the watch by unsubscribing from
@ -198,12 +194,13 @@ export class Geolocation extends IonicNativePlugin {
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
*/
watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
return new Observable<Geoposition>(
(observer: any) => {
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
return () => navigator.geolocation.clearWatch(watchId);
}
);
return new Observable<Geoposition>((observer: any) => {
const watchId = navigator.geolocation.watchPosition(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.geolocation.clearWatch(watchId);
});
}
}

View File

@ -134,7 +134,7 @@ export class Globalization extends IonicNativePlugin {
getDateNames(options: {
type: string;
item: string;
}): Promise<{ value: Array<string> }> {
}): Promise<{ value: string[] }> {
return;
}

View File

@ -20,7 +20,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
* this.ga.startTrackerWithId('YOUR_TRACKER_ID')
* .then(() => {
* console.log('Google analytics is ready now');
this.ga.trackView('test');
* this.ga.trackView('test');
* // Tracker is ready
* // You can now track pages or set additional information such as AppVersion or UserId
* })

View File

@ -17,7 +17,7 @@ import { Observable } from 'rxjs/Observable';
* this.googleNearby.publish('Hello')
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
*
* this.googleNearby.subscribe()
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
@ -28,13 +28,13 @@ import { Observable } from 'rxjs/Observable';
plugin: 'cordova-plugin-google-nearby',
pluginRef: 'window.nearby',
repo: 'https://github.com/hahahannes/cordova-plugin-google-nearby',
install: 'ionic cordova plugin add cordova-plugin-google-nearby --variable API_KEY="123456789"',
install:
'ionic cordova plugin add cordova-plugin-google-nearby --variable API_KEY="123456789"',
installVariables: ['API_KEY'],
platforms: ['Android']
})
@Injectable()
export class GoogleNearby extends IonicNativePlugin {
/**
* Publish a message
* @param message {string} Message to publish
@ -45,9 +45,9 @@ export class GoogleNearby extends IonicNativePlugin {
return;
}
/**
* Subscribe to recieve messages
* @return {Observable<any>} Returns an observable that emits recieved messages
/**
* Subscribe to receive messages
* @return {Observable<any>} Returns an observable that emits received messages
*/
@Cordova({
observable: true,

View File

@ -67,10 +67,10 @@ export interface Player {
* The title of the player based on their gameplay activity. Not
* all players have this and it may change over time.
*/
title: string|null;
title: string | null;
/**
* Retrieves the URI for loading this player's icon-size profile image.
* Retrieves the URI for loading this player's icon-size profile image.
* Returns null if the player has no profile image.
*/
iconImageUrl: string;
@ -101,12 +101,12 @@ export interface Player {
* this.googlePlayGamesServices.auth()
* .then(() => console.log('Logged in to Play Games Services'))
* .catch(e) => console.log('Error logging in Play Games Services', e);
*
*
* // Sign out of Play Games Services.
* this.googlePlayGamesServices.signOut()
* .then(() => console.log('Logged out of Play Games Services'))
* .catch(e => console.log('Error logging out of Play Games Services', e);
*
*
* // Check auth status.
* this.googlePlayGamesServices.isSignedIn()
* .then((signedIn: SignedInResponse) => {
@ -114,38 +114,38 @@ export interface Player {
* hideLoginButton();
* }
* });
*
*
* // Fetch currently authenticated user's data.
* this.googlePlayGamesServices.showPlayer().then((data: Player) => {
* console.log('Player data', data);
* });
*
*
* // Submit a score.
* this.googlePlayGamesServices.submitScore({
* score: 100,
* leaderboardId: 'SomeLeaderboardId'
* });
*
*
* // Show the native leaderboards window.
* this.googlePlayGamesServices.showAllLeaderboards()
* .then(() => console.log('The leaderboard window is visible.'));
*
*
* // Show a signle native leaderboard window.
* this.googlePlayGamesServices.showLeaderboard({
* leaderboardId: 'SomeLeaderBoardId'
* }).then(() => console.log('The leaderboard window is visible.'));
*
*
* // Unlock an achievement.
* this.googlePlayGamesServices.unlockAchievement({
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement unlocked'));
*
*
* // Incremement an achievement.
* this.googlePlayGamesServices.incrementAchievement({
* step: 1,
* achievementId: 'SomeAchievementId'
* }).then(() => console.log('Achievement incremented'));
*
*
* // Show the native achievements window.
* this.googlePlayGamesServices.showAchivements()
* .then(() => console.log('The achievements window is visible.'));
@ -165,7 +165,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Initialise native Play Games Service login procedure.
*
*
* @return {Promise<any>} Returns a promise that resolves when the player
* is authenticated with Play Games Services.
*/
@ -174,7 +174,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Sign out of Google Play Games Services.
*
*
* @return {Promise<any>} Returns a promise that resolve when the player
* successfully signs out.
*/
@ -183,7 +183,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Check if the user is signed in.
*
*
* @return {Promise<SignedInResponse>} Returns a promise that resolves with
* the signed in response.
*/
@ -192,8 +192,8 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Show the currently authenticated player.
*
* @return {Promise<Player>} Returns a promise that resolves when Play
*
* @return {Promise<Player>} Returns a promise that resolves when Play
* Games Services returns the authenticated player.
*/
@Cordova()
@ -202,7 +202,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Submit a score to a leaderboard. You should ensure that you have a
* successful return from auth() before submitting a score.
*
*
* @param data {ScoreData} The score data you want to submit.
* @return {Promise<any>} Returns a promise that resolves when the
* score is submitted.
@ -213,7 +213,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Launches the native Play Games leaderboard view controller to show all the
* leaderboards.
*
*
* @return {Promise<any>} Returns a promise that resolves when the native
* leaderboards window opens.
*/
@ -223,7 +223,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Launches the native Play Games leaderboard view controll to show the
* specified leaderboard.
*
*
* @param data {LeaderboardData} The leaderboard you want to show.
* @return {Promise<any>} Returns a promise that resolves when the native
* leaderboard window opens.
@ -233,7 +233,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Unlock an achievement.
*
*
* @param data {AchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is unlocked.
@ -243,7 +243,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Increment an achievement.
*
*
* @param data {IncrementableAchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is incremented.
@ -254,7 +254,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
/**
* Lauches the native Play Games achievements view controller to show
* achievements.
*
*
* @return {Promise<any>} Returns a promise that resolves when the
* achievement window opens.
*/

View File

@ -91,7 +91,7 @@ export class Gyroscope extends IonicNativePlugin {
watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
return new Observable<GyroscopeOrientation>(
(observer: any) => {
let watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
const watchId = navigator.gyroscope.watch(observer.next.bind(observer), observer.next.bind(observer), options);
return () => navigator.gyroscope.clearWatch(watchId);
}
);

View File

@ -45,7 +45,7 @@ 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 {
@ -55,7 +55,7 @@ export class HCE extends IonicNativePlugin {
* Registers Deactivated receiver.
* @param ok {HCEDeactivatedEvent} Success event handler.
* @param fail {Function} Error event handler.
*
*
*/
@Cordova()
registerDeactivatedCallback(ok: HCEDeactivatedEvent, fail?: Function): void {
@ -68,7 +68,7 @@ export class HCE extends IonicNativePlugin {
* @param response {Uint8Array} Response
* @param success {string} Success Callback.
* @param success {string} Failure Callback.
*
*
*/
@Cordova()
sendResponse(response: Uint8Array, success?: Function, failure?: Function): void {
@ -76,5 +76,5 @@ export class HCE extends IonicNativePlugin {
}
}
export interface HCECommandEvent { (command: Uint8Array): void; }
export interface HCEDeactivatedEvent { (command: number): void; }
export type HCECommandEvent = (command: Uint8Array) => void;
export type HCEDeactivatedEvent = (command: number) => void;

View File

@ -6,13 +6,13 @@ import { Injectable } from '@angular/core';
*/
export interface HealthDataType {
/**
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
read?: string[];
/**
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
*/
write?: string[];
}
@ -207,7 +207,6 @@ export interface HealthData {
})
@Injectable()
export class Health extends IonicNativePlugin {
/**
* Tells if either Google Fit or HealthKit are available.
*
@ -216,7 +215,9 @@ export class Health extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
isAvailable(): Promise<boolean> { return; }
isAvailable(): Promise<boolean> {
return;
}
/**
* Checks if recent Google Play Services and Google Fit are installed. If the play services are not installed,
@ -232,7 +233,9 @@ export class Health extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
promptInstallFit(): Promise<any> { return; }
promptInstallFit(): Promise<any> {
return;
}
/**
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
@ -254,7 +257,9 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
requestAuthorization(datatypes: (string | HealthDataType)[]): Promise<any> {
return;
}
/**
* Check if the app has authorization to read/write a set of datatypes.
@ -268,7 +273,9 @@ export class Health extends IonicNativePlugin {
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
*/
@Cordova()
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
isAuthorized(datatypes: (string | HealthDataType)[]): Promise<boolean> {
return;
}
/**
* Gets all the data points of a certain data type within a certain time window.
@ -302,7 +309,9 @@ export class Health extends IonicNativePlugin {
* @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.
@ -326,7 +335,11 @@ export class Health extends IonicNativePlugin {
* @return {Promise<HealthData[]>}
*/
@Cordova()
queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise<HealthData[]> { return; }
queryAggregated(
queryOptionsAggregated: HealthQueryOptionsAggregated
): Promise<HealthData[]> {
return;
}
/**
* Stores a data point.
@ -343,6 +356,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
store(storeOptions: HealthStoreOptions): Promise<any> { return; }
store(storeOptions: HealthStoreOptions): Promise<any> {
return;
}
}

View File

@ -85,7 +85,7 @@ export interface HotCodePushEventData {
details?: {
error?: HotCodePushError;
};
};
}
/**
* @name Hot Code Push

View File

@ -203,7 +203,7 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<Array<HotspotDevice>>}
*/
@Cordova()
getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
getAllHotspotDevices(): Promise<HotspotDevice[]> { return; }
/**
* Connect to a WiFi network
@ -235,7 +235,7 @@ export class Hotspot extends IonicNativePlugin {
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
*/
@Cordova()
connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array<string>): Promise<void> { return; }
connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: string[]): Promise<void> { return; }
/**
* Add a WiFi network
@ -299,13 +299,13 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<Array<HotspotNetwork>>}
*/
@Cordova()
scanWifi(): Promise<Array<HotspotNetwork>> { return; }
scanWifi(): Promise<HotspotNetwork[]> { return; }
/**
* @returns {Promise<Array<HotspotNetwork>>}
*/
@Cordova()
scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
scanWifiByLevel(): Promise<HotspotNetwork[]> { return; }
/**
* @returns {Promise<any>}

View File

@ -56,7 +56,6 @@ export interface HttpdOptions {
})
@Injectable()
export class Httpd extends IonicNativePlugin {
/**
* Starts a web server.
* @param options {HttpdOptions}
@ -66,20 +65,25 @@ export class Httpd extends IonicNativePlugin {
observable: true,
clearFunction: 'stopServer'
})
startServer(options?: HttpdOptions): Observable<string> { return; }
startServer(options?: HttpdOptions): Observable<string> {
return;
}
/**
* Gets the URL of the running server
* @returns {Promise<string>} Returns a promise that resolves with the URL of the web server.
*/
@Cordova()
getUrl(): Promise<string> { return; }
getUrl(): Promise<string> {
return;
}
/**
* Get the local path of the running webserver
* @returns {Promise<string>} Returns a promise that resolves with the local path of the web server.
*/
*/
@Cordova()
getLocalPath(): Promise<string> { return; }
getLocalPath(): Promise<string> {
return;
}
}

View File

@ -56,8 +56,8 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
* this.hyperTrack.stopTracking().then(success => {
* // Handle success (String). Should be "OK".
* }, error => {});
*
* }, error => {});*
*
* }, error => {});*
* ```
*/
@Plugin({

View File

@ -296,12 +296,12 @@ export class IBeacon extends IonicNativePlugin {
*/
@CordovaCheck({ sync: true })
Delegate(): IBeaconDelegate {
let delegate = new cordova.plugins.locationManager.Delegate();
const delegate = new cordova.plugins.locationManager.Delegate();
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didChangeAuthorizationStatus = cb;
}
);
@ -310,7 +310,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didDetermineStateForRegion = cb;
}
);
@ -319,7 +319,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didEnterRegion = cb;
}
);
@ -328,7 +328,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didExitRegion = cb;
}
);
@ -337,7 +337,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didRangeBeaconsInRegion = cb;
}
);
@ -346,7 +346,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didStartMonitoringForRegion = cb;
}
);
@ -355,7 +355,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.monitoringDidFailForRegionWithError = cb;
}
);
@ -364,7 +364,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.peripheralManagerDidStartAdvertising = cb;
}
);
@ -373,7 +373,7 @@ export class IBeacon extends IonicNativePlugin {
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
const cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.peripheralManagerDidUpdateState = cb;
}
);

View File

@ -1,42 +1,47 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
import {
Plugin,
CordovaInstance,
InstanceCheck,
IonicNativePlugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
declare const cordova: Cordova & { InAppBrowser: any; };
declare const cordova: Cordova & { InAppBrowser: any };
export interface InAppBrowserOptions {
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
location?: 'yes' | 'no';
/** Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
/* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
* Omit or set to no (default) to have the browser open and load normally. */
hidden?: 'yes' | 'no';
/** Set to yes to have the browser's cookie cache cleared before the new window is opened. */
clearcache?: 'yes';
/** Set to yes to have the session cookie cache cleared before the new window is opened. */
/* Set to yes to have the session cookie cache cleared before the new window is opened. */
clearsessioncache?: 'yes';
/** (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself.
/* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself.
* (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */
closebuttoncaption?: string;
/** (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes.
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled. */
closebuttoncolor?: string;
/** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
zoom?: 'yes' | 'no';
/** (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
/* (Android & Windows Phone Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser. */
hardwareback?: 'yes' | 'no';
/** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */
mediaPlaybackRequiresUserAction?: 'yes' | 'no';
/** (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no.
/* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no.
* (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.*/
hidenavigationbuttons?: 'yes' | 'no';
/** (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/
/* (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/
hideurlbar?: 'yes' | 'no';
/** (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes.
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible. */
navigationbuttoncolor?: string;
/** (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes.
/* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes.
* (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.*/
toolbarcolor?: string;
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
@ -53,7 +58,7 @@ export interface InAppBrowserOptions {
toolbartranslucent?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */
enableViewportScale?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
/* (iOS Only) Set to yes or no to allow in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface.
* The HTML's video element must also include the webkit-playsinline attribute (defaults to no) */
allowInlineMediaPlayback?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
@ -68,7 +73,7 @@ export interface InAppBrowserOptions {
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.
/* (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';
/** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */
@ -93,7 +98,6 @@ export interface InAppBrowserEvent extends Event {
* @hidden
*/
export class InAppBrowserObject {
private _objectInstance: any;
/**
@ -107,20 +111,26 @@ export class InAppBrowserObject {
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
constructor(
url: string,
target?: string,
options?: string | InAppBrowserOptions
) {
try {
if (options && typeof options !== 'string') {
options = Object.keys(options).map((key: string) => `${key}=${(<InAppBrowserOptions>options)[key]}`).join(',');
options = Object.keys(options)
.map(
(key: string) => `${key}=${(options as InAppBrowserOptions)[key]}`
)
.join(',');
}
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
} catch (e) {
window.open(url, target);
console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
console.warn(
'Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.'
);
}
}
@ -129,20 +139,20 @@ export class InAppBrowserObject {
* if the InAppBrowser was already visible.
*/
@CordovaInstance({ sync: true })
show(): void { }
show(): void {}
/**
* Closes the InAppBrowser window.
*/
@CordovaInstance({ sync: true })
close(): void { }
close(): void {}
/**
* Hides an InAppBrowser window that is currently shown. Calling this has no effect
* if the InAppBrowser was already hidden.
*/
@CordovaInstance({ sync: true })
hide(): void { }
hide(): void {}
/**
* Injects JavaScript code into the InAppBrowser window.
@ -150,7 +160,9 @@ export class InAppBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
executeScript(script: { file?: string, code?: string }): Promise<any> { return; }
executeScript(script: { file?: string; code?: string }): Promise<any> {
return;
}
/**
* Injects CSS into the InAppBrowser window.
@ -158,7 +170,9 @@ export class InAppBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
insertCSS(css: { file?: string, code?: string }): Promise<any> { return; }
insertCSS(css: { file?: string; code?: string }): Promise<any> {
return;
}
/**
* A method that allows you to listen to events happening in the browser.
@ -167,10 +181,19 @@ export class InAppBrowserObject {
*/
@InstanceCheck()
on(event: string): Observable<InAppBrowserEvent> {
return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
this._objectInstance.addEventListener(event, observer.next.bind(observer));
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
});
return new Observable<InAppBrowserEvent>(
(observer: Observer<InAppBrowserEvent>) => {
this._objectInstance.addEventListener(
event,
observer.next.bind(observer)
);
return () =>
this._objectInstance.removeEventListener(
event,
observer.next.bind(observer)
);
}
);
}
}
@ -214,7 +237,6 @@ export class InAppBrowserObject {
})
@Injectable()
export class InAppBrowser extends IonicNativePlugin {
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url {string} The URL to load.
@ -224,8 +246,11 @@ export class InAppBrowser extends IonicNativePlugin {
* name/value pairs must be separated by a comma. Feature names are case insensitive.
* @returns {InAppBrowserObject}
*/
create(url: string, target?: string, options?: string | InAppBrowserOptions): InAppBrowserObject {
create(
url: string,
target?: string,
options?: string | InAppBrowserOptions
): InAppBrowserObject {
return new InAppBrowserObject(url, target, options);
}
}

View File

@ -77,7 +77,7 @@ export interface IAPProductOptions {
type: string;
}
export type IAPProducts = Array<IAPProduct> & {
export type IAPProducts = IAPProduct[] & {
/**
* Get product by ID
*/
@ -383,7 +383,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
* Add or register a product
* @param product {IAPProductOptions}
*/
@Cordova({ sync: true})
@Cordova({ sync: true })
register(product: IAPProductOptions): void {}
/**

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/* tslint:disable */
/**
* @name In App Review
* @description
@ -25,6 +25,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
*
* ```
*/
/* tslint:enable */
@Plugin({
pluginName: 'InAppReview',
plugin: 'com.omarben.inappreview',
@ -34,7 +35,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class InAppReview extends IonicNativePlugin {
/**
* Open the inApp review popup
* @return {Promise<any>} Returns a promise that resolves when something happens
@ -43,5 +43,4 @@ export class InAppReview extends IonicNativePlugin {
requestReview(): Promise<any> {
return; // We add return; here to avoid any IDE / Compiler errors
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaFunctionOverride, IonicNativePlugin, Plugin } from '@ionic-native/core';
import {
Cordova,
CordovaFunctionOverride,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface IndexItem {
@ -16,7 +21,7 @@ export interface IndexItem {
/**
* Item keywords
*/
keywords?: Array<string>;
keywords?: string[];
/**
* Lifetime in minutes
@ -88,7 +93,7 @@ export class IndexAppContent extends IonicNativePlugin {
* @return {Promise<any>} Returns if index set was successful
*/
@Cordova()
setItems(items: Array<IndexItem>): Promise<any> {
setItems(items: IndexItem[]): Promise<any> {
return;
}
@ -98,7 +103,7 @@ export class IndexAppContent extends IonicNativePlugin {
* @return {Promise<any>} Resolve if successful
*/
@Cordova()
clearItemsForDomains(domains: Array<string>): Promise<any> {
clearItemsForDomains(domains: string[]): Promise<any> {
return;
}
@ -108,11 +113,11 @@ export class IndexAppContent extends IonicNativePlugin {
* @return {Promise<any>} Resolve if successful
*/
@Cordova()
clearItemsForIdentifiers(identifiers: Array<string>): Promise<any> {
clearItemsForIdentifiers(identifiers: 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

View File

@ -4,7 +4,7 @@ import { Injectable } from '@angular/core';
declare const window: any;
export interface IntelSecurityDataOptions {
/** Non-empty string. **/
/* Non-empty string. **/
data: String;
/** Tag text. */
tag?: String;
@ -76,7 +76,6 @@ export interface IntelSecurityDataOptions {
})
@Injectable()
export class IntelSecurity extends IonicNativePlugin {
/**
* returns an IntelSecurityStorage object
* @type {IntelSecurityStorage}
@ -88,7 +87,6 @@ export class IntelSecurity extends IonicNativePlugin {
* @type {IntelSecurityData}
*/
data: IntelSecurityData = new IntelSecurityData();
}
/**
@ -100,14 +98,15 @@ export class IntelSecurity extends IonicNativePlugin {
pluginRef: 'intel.security.secureData'
})
export class IntelSecurityData {
/**
* This creates a new instance of secure data using plain-text data.
* @param options {IntelSecurityDataOptions}
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
*/
* This creates a new instance of secure data using plain-text data.
* @param options {IntelSecurityDataOptions}
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
*/
@Cordova({ otherPromise: true })
createFromData(options: IntelSecurityDataOptions): Promise<Number> { return; }
createFromData(options: IntelSecurityDataOptions): Promise<Number> {
return;
}
/**
* This creates a new instance of secure data (using sealed data)
@ -116,7 +115,9 @@ export class IntelSecurityData {
* @returns {Promise<any>} Returns a Promise that resolves with the instanceID of the created data instance, or rejects with an error.
*/
@Cordova({ otherPromise: true })
createFromSealedData(options: { sealedData: string }): Promise<Number> { return; }
createFromSealedData(options: { sealedData: string }): Promise<Number> {
return;
}
/**
* This returns the plain-text data of the secure data instance.
@ -124,7 +125,9 @@ export class IntelSecurityData {
* @returns {Promise<string>} Returns a Promise that resolves to the data as plain-text, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getData(instanceID: Number): Promise<string> { return; }
getData(instanceID: Number): Promise<string> {
return;
}
/**
* This returns the sealed chunk of a secure data instance.
@ -132,7 +135,9 @@ export class IntelSecurityData {
* @returns {Promise<any>} Returns a Promise that resolves to the sealed data, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getSealedData(instanceID: any): Promise<any> { return; }
getSealedData(instanceID: any): Promise<any> {
return;
}
/**
* This returns the tag of the secure data instance.
@ -140,7 +145,9 @@ export class IntelSecurityData {
* @returns {Promise<string>} Returns a Promise that resolves to the tag, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getTag(instanceID: any): Promise<string> { return; }
getTag(instanceID: any): Promise<string> {
return;
}
/**
* This returns the data policy of the secure data instance.
@ -148,7 +155,9 @@ export class IntelSecurityData {
* @returns {Promise<any>} Returns a promise that resolves to the policy object, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getPolicy(instanceID: any): Promise<any> { return; }
getPolicy(instanceID: any): Promise<any> {
return;
}
/**
* This returns an array of the data owners unique IDs.
@ -156,7 +165,9 @@ export class IntelSecurityData {
* @returns {Promise<Array>} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getOwners(instanceID: any): Promise<Array<any>> { return; }
getOwners(instanceID: any): Promise<any[]> {
return;
}
/**
* This returns the data creator unique ID.
@ -164,7 +175,9 @@ export class IntelSecurityData {
* @returns {Promise<Number>} Returns a promsie that resolves to the creator's unique ID, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getCreator(instanceID: any): Promise<Number> { return; }
getCreator(instanceID: any): Promise<Number> {
return;
}
/**
* This returns an array of the trusted web domains of the secure data instance.
@ -172,7 +185,9 @@ export class IntelSecurityData {
* @returns {Promise<Array>} Returns a promise that resolves to a list of web owners, or rejects with an error.
*/
@Cordova({ otherPromise: true })
getWebOwners(instanceID: any): Promise<Array<any>> { return; }
getWebOwners(instanceID: any): Promise<any[]> {
return;
}
/**
* This changes the extra key of a secure data instance. To successfully replace the extra key, the calling application must have sufficient access to the plain-text data.
@ -182,7 +197,9 @@ export class IntelSecurityData {
* @returns {Promise<any>} Returns a promise that resolves with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
changeExtraKey(options: any): Promise<any> { return; }
changeExtraKey(options: any): Promise<any> {
return;
}
/**
* This releases a secure data instance.
@ -190,8 +207,9 @@ export class IntelSecurityData {
* @returns {Promise<any>} Returns a promise that resovles with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
destroy(instanceID: any): Promise<any> { return; }
destroy(instanceID: any): Promise<any> {
return;
}
}
/**
@ -203,7 +221,6 @@ export class IntelSecurityData {
pluginRef: 'intel.security.secureStorage'
})
export class IntelSecurityStorage {
/**
* This deletes a secure storage resource (indicated by id).
* @param options {Object}
@ -212,10 +229,9 @@ export class IntelSecurityStorage {
* @returns {Promise<any>} Returns a Promise that resolves with no parameters, or rejects with an error.
*/
@Cordova({ otherPromise: true })
delete(options: {
id: string,
storageType?: Number
}): Promise<any> { return; }
delete(options: { id: string; storageType?: Number }): Promise<any> {
return;
}
/**
* This reads the data from secure storage (indicated by id) and creates a new secure data instance.
@ -227,10 +243,12 @@ export class IntelSecurityStorage {
*/
@Cordova({ otherPromise: true })
read(options: {
id: string,
storageType?: Number,
extraKey?: Number
}): Promise<Number> { return; }
id: string;
storageType?: Number;
extraKey?: Number;
}): Promise<Number> {
return;
}
/**
* This writes the data contained in a secure data instance into secure storage.
@ -242,9 +260,10 @@ export class IntelSecurityStorage {
*/
@Cordova({ otherPromise: true })
write(options: {
id: String,
instanceID: Number,
storageType?: Number
}): Promise<any> { return; }
id: String;
instanceID: Number;
storageType?: Number;
}): Promise<any> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import {
Plugin,
Cordova,
CordovaCheck,
IonicNativePlugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const cordova: any;
@ -44,12 +49,14 @@ export class JinsMeme extends IonicNativePlugin {
* Must call this method first.
* Sign up for an app ID (and get an app/client secret) at developers.jins.com
*
*@param {string} setAppClientID
*@param {string} clientSecret
*@returns {Promise<any>}
* @param {string} setAppClientID
* @param {string} clientSecret
* @returns {Promise<any>}
*/
@Cordova()
setAppClientID(appClientId: string, clientSecret: string): Promise<any> { return; }
setAppClientID(appClientId: string, clientSecret: string): Promise<any> {
return;
}
/**
* Starts scanning for JINS MEME.
* @returns {Observable<any>}
@ -59,13 +66,17 @@ export class JinsMeme extends IonicNativePlugin {
clearFunction: 'stopScan',
clearWithArgs: true
})
startScan(): Observable<any> { return; }
startScan(): Observable<any> {
return;
}
/**
* Stops scanning JINS MEME.
* @returns {Promise<any>}
*/
@Cordova()
stopScan(): Promise<any> { return; }
stopScan(): Promise<any> {
return;
}
/**
* Establishes connection to JINS MEME.
* @param {string} target
@ -76,29 +87,40 @@ export class JinsMeme extends IonicNativePlugin {
})
connect(target: string): Observable<any> {
return new Observable<any>((observer: any) => {
let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
const data = cordova.plugins.JinsMemePlugin.connect(
target,
observer.next.bind(observer),
observer.complete.bind(observer),
observer.error.bind(observer)
);
return data;
});
}
/**
* Set auto connection mode.
*@param {Boolean} flag
*@returns {Promise<any>}
* @param {Boolean} flag
* @returns {Promise<any>}
*/
@Cordova()
setAutoConnect(flag: boolean): Promise<any> { return; }
setAutoConnect(flag: boolean): Promise<any> {
return;
}
/**
* Returns whether a connection to JINS MEME has been established.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
isConnected(): Promise<any> { return; }
isConnected(): Promise<any> {
return;
}
/**
* Disconnects from JINS MEME.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
disconnect(): Promise<any> { return; }
disconnect(): Promise<any> {
return;
}
/**
* Starts receiving realtime data.
* @returns {Observable<any>}
@ -108,60 +130,80 @@ export class JinsMeme extends IonicNativePlugin {
clearFunction: 'stopDataReport',
clearWithArgs: true
})
startDataReport(): Observable<any> { return; }
startDataReport(): Observable<any> {
return;
}
/**
* Stops receiving data.
*@returns {Promise<any>}
*/
* Stops receiving data.
* @returns {Promise<any>}
*/
@Cordova()
stopDataReport(): Promise<any> { return; }
stopDataReport(): Promise<any> {
return;
}
/**
* Returns SDK version.
*
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getSDKVersion(): Promise<any> { return; }
getSDKVersion(): Promise<any> {
return;
}
/**
* Returns JINS MEME connected with other apps.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getConnectedByOthers(): Promise<any> { return; }
getConnectedByOthers(): Promise<any> {
return;
}
/**
* Returns calibration status
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
isCalibrated(): Promise<any> { return; }
isCalibrated(): Promise<any> {
return;
}
/**
* Returns device type.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getConnectedDeviceType(): Promise<any> { return; }
getConnectedDeviceType(): Promise<any> {
return;
}
/**
* Returns hardware version.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getConnectedDeviceSubType(): Promise<any> { return; }
getConnectedDeviceSubType(): Promise<any> {
return;
}
/**
* Returns FW Version.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getFWVersion(): Promise<any> { return; }
getFWVersion(): Promise<any> {
return;
}
/**
* Returns HW Version.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
getHWVersion(): Promise<any> { return; }
getHWVersion(): Promise<any> {
return;
}
/**
* Returns response about whether data was received or not.
*@returns {Promise<any>}
* @returns {Promise<any>}
*/
@Cordova()
isDataReceiving(): Promise<any> { return; }
isDataReceiving(): Promise<any> {
return;
}
}

View File

@ -2,12 +2,11 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
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
@ -33,13 +32,12 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class Keyboard extends IonicNativePlugin {
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
@Cordova({ sync: true })
hideKeyboardAccessoryBar(hide: boolean): void { }
hideKeyboardAccessoryBar(hide: boolean): void {}
/**
* Force keyboard to be shown.
@ -48,7 +46,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
})
show(): void { }
show(): void {}
/**
* Close the keyboard if open.
@ -57,7 +55,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
close(): void { }
close(): void {}
/**
* Prevents the native UIScrollView from moving when an input is focused.
@ -67,7 +65,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS', 'Windows']
})
disableScroll(disable: boolean): void { }
disableScroll(disable: boolean): void {}
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
@ -78,7 +76,9 @@ export class Keyboard extends IonicNativePlugin {
event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
onKeyboardShow(): Observable<any> { return; }
onKeyboardShow(): Observable<any> {
return;
}
/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
@ -89,6 +89,7 @@ export class Keyboard extends IonicNativePlugin {
event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
onKeyboardHide(): Observable<any> { return; }
onKeyboardHide(): Observable<any> {
return;
}
}

View File

@ -223,13 +223,13 @@ export interface UserPrompted {
* Sets flag indicating user has already been prompted whether to remember their choice a preferred navigator app.
* @param callback - function to call once operation is complete.
*/
set: ( callback: () => void) => void;
set: (callback: () => void) => void;
/**
* Clears flag which indicates if user has already been prompted whether to remember their choice a preferred navigator app.
* @param callback - function to call once operation is complete.
*/
clear: ( callback: () => void) => void;
clear: (callback: () => void) => void;
}
export interface AppSelection {

View File

@ -490,7 +490,7 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova({
sync: true
})
schedule(options?: ILocalNotification | Array<ILocalNotification>): void {}
schedule(options?: ILocalNotification | ILocalNotification[]): void {}
/**
* Updates a previously scheduled notification. Must include the id in the options parameter.
@ -574,7 +574,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<number>>}
*/
@Cordova()
getIds(): Promise<Array<number>> {
getIds(): Promise<number[]> {
return;
}
@ -583,7 +583,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<Array<number>> {
getTriggeredIds(): Promise<number[]> {
return;
}
@ -592,7 +592,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<number>>} Returns a promise
*/
@Cordova()
getScheduledIds(): Promise<Array<number>> {
getScheduledIds(): Promise<number[]> {
return;
}
@ -631,7 +631,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<Array<ILocalNotification>> {
getAll(): Promise<ILocalNotification[]> {
return;
}
@ -640,7 +640,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<Array<ILocalNotification>> {
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
@ -649,7 +649,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<Array<ILocalNotification>> {
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}
@ -680,7 +680,7 @@ export class LocalNotifications extends IonicNativePlugin {
@Cordova()
addActions(
groupId: any,
actions: Array<ILocalNotificationAction>
actions: ILocalNotificationAction[]
): Promise<any> {
return;
}
@ -743,7 +743,7 @@ export class LocalNotifications extends IonicNativePlugin {
/**
* Not an official interface, however its possible to manually fire events.
** @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions
* @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions
* @param args Optional arguments
*/
@Cordova({

View File

@ -105,11 +105,11 @@ export interface ConfigurationData {
/**
* The height of the image or video in pixels. The value is zero for sound clips.
*/
height: number;
height: number;
/**
* The width of the image or video in pixels. The value is zero for sound clips.
*/
width: number;
width: number;
}
/**

View File

@ -293,41 +293,41 @@ export class Media extends IonicNativePlugin {
/**
* @hidden
*/
MEDIA_NONE: number = 0;
MEDIA_NONE = 0;
/**
* @hidden
*/
MEDIA_STARTING: number = 1;
MEDIA_STARTING = 1;
/**
* @hidden
*/
MEDIA_RUNNING: number = 2;
MEDIA_RUNNING = 2;
/**
* @hidden
*/
MEDIA_PAUSED: number = 3;
MEDIA_PAUSED = 3;
/**
* @hidden
*/
MEDIA_STOPPED: number = 4;
MEDIA_STOPPED = 4;
// error codes
/**
* @hidden
*/
MEDIA_ERR_ABORTED: number = 1;
MEDIA_ERR_ABORTED = 1;
/**
* @hidden
*/
MEDIA_ERR_NETWORK: number = 2;
MEDIA_ERR_NETWORK = 2;
/**
* @hidden
*/
MEDIA_ERR_DECODE: number = 3;
MEDIA_ERR_DECODE = 3;
/**
* @hidden
*/
MEDIA_ERR_NONE_SUPPORTED: number = 4;
MEDIA_ERR_NONE_SUPPORTED = 4;
/**
* Open a media file

View File

@ -250,7 +250,7 @@ export class MixpanelPeople extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
unset(propertiesArray: Array<string>): Promise<any> {
unset(propertiesArray: string[]): Promise<any> {
return;
}

View File

@ -95,7 +95,7 @@ export interface UserInfo {
export class MSAdal extends IonicNativePlugin {
createAuthenticationContext(
authority: string,
validateAuthority: boolean = true
validateAuthority = true
) {
let authContext: any;
if (

View File

@ -71,7 +71,6 @@ export interface MusicControlsOptions {
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
* ticker : 'Now playing "Time is Running Out"',
* // All icons default to their built-in android equivalents
* // The supplied drawable name, e.g. 'media_play', is the name of a drawable found under android/res/drawable* folders
* playIcon: 'media_play',
* pauseIcon: 'media_pause',
* prevIcon: 'media_prev',

View File

@ -18,7 +18,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
* 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));
@ -68,7 +68,7 @@ export class NativeGeocoder extends IonicNativePlugin {
/**
* Encapsulates format information about a reverse geocoding result.
* more Info:
* more Info:
* - https://developer.apple.com/documentation/corelocation/clplacemark
* - https://developer.android.com/reference/android/location/Address.html
*/

View File

@ -32,7 +32,7 @@ export class NavigationBar extends IonicNativePlugin {
/**
* hide automatically (or not) the navigation bar.
* @param autohide {boolean}  
* @param autohide {boolean}
* @return {Promise<any>}
*/
@Cordova({
@ -43,7 +43,7 @@ export class NavigationBar extends IonicNativePlugin {
setUp(autohide?: boolean): Promise<any> { return; }
/**
* Hide the navigation bar. 
* Hide the navigation bar.
* @return {Promise<any>}
*/
@Cordova({

View File

@ -37,7 +37,7 @@ declare const navigator: any;
* let connectSubscription = this.network.onConnect().subscribe(() => {
* console.log('network connected!');
* // We just got a connection but we need to wait briefly
* // before we determine the connection type. Might need to wait.
* // before we determine the connection type. Might need to wait.
* // prior to doing any api requests as well.
* setTimeout(() => {
* if (this.network.type === 'wifi') {

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin, CordovaProperty } from '@ionic-native/core';
import {
Plugin,
Cordova,
IonicNativePlugin,
CordovaProperty
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare let window: any;
@ -67,8 +72,8 @@ export interface NdefTag {
platforms: ['Android', 'BlackBerry 10', 'Windows', 'Windows Phone 8']
})
/**
*@{ NFC } class methods
*/
* @{ NFC } class methods
*/
@Injectable()
export class NFC extends IonicNativePlugin {
/**
@ -84,7 +89,9 @@ export class NFC extends IonicNativePlugin {
clearFunction: 'invalidateSession',
clearWithArgs: true
})
beginSession(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
beginSession(onSuccess?: Function, onFailure?: Function): Observable<any> {
return;
}
/**
* Registers an event listener for any NDEF tag.
@ -99,7 +106,12 @@ export class NFC extends IonicNativePlugin {
clearFunction: 'removeNdefListener',
clearWithArgs: true
})
addNdefListener(onSuccess?: Function, onFailure?: Function): Observable<NdefEvent> { return; }
addNdefListener(
onSuccess?: Function,
onFailure?: Function
): Observable<NdefEvent> {
return;
}
/**
* Registers an event listener for tags matching any tag type.
@ -114,7 +126,12 @@ export class NFC extends IonicNativePlugin {
clearFunction: 'removeTagDiscoveredListener',
clearWithArgs: true
})
addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
addTagDiscoveredListener(
onSuccess?: Function,
onFailure?: Function
): Observable<any> {
return;
}
/**
* Registers an event listener for NDEF tags matching a specified MIME type.
@ -130,7 +147,13 @@ export class NFC extends IonicNativePlugin {
clearFunction: 'removeMimeTypeListener',
clearWithArgs: true
})
addMimeTypeListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
addMimeTypeListener(
mimeType: string,
onSuccess?: Function,
onFailure?: Function
): Observable<any> {
return;
}
/**
* Registers an event listener for formatable NDEF tags.
@ -143,7 +166,12 @@ export class NFC extends IonicNativePlugin {
successIndex: 0,
errorIndex: 3
})
addNdefFormatableListener(onSuccess?: Function, onFailure?: Function): Observable<any> { return; }
addNdefFormatableListener(
onSuccess?: Function,
onFailure?: Function
): Observable<any> {
return;
}
/**
* Writes an NdefMessage(array of ndef records) to a NFC tag.
@ -151,13 +179,17 @@ export class NFC extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
write(message: any[]): Promise<any> { return; }
write(message: any[]): Promise<any> {
return;
}
/**
* Makes a NFC tag read only. **Warning** this is permanent.
* @returns {Promise<any>}
*/
@Cordova()
makeReadyOnly(): Promise<any> { return; }
makeReadyOnly(): Promise<any> {
return;
}
/**
* Shares an NDEF Message(array of ndef records) via peer-to-peer.
@ -165,20 +197,26 @@ export class NFC extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
share(message: any[]): Promise<any> { return; }
share(message: any[]): Promise<any> {
return;
}
/**
* Stop sharing NDEF data via peer-to-peer.
* @returns {Promise<any>}
*/
@Cordova()
unshare(): Promise<any> { return; }
unshare(): Promise<any> {
return;
}
/**
* Erase a NDEF tag
*/
@Cordova()
erase(): Promise<any> { return; }
erase(): Promise<any> {
return;
}
/**
* Send a file to another device via NFC handover.
@ -186,46 +224,58 @@ export class NFC extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
handover(uris: string[]): Promise<any> { return; }
handover(uris: string[]): Promise<any> {
return;
}
/**
* Stop sharing NDEF data via NFC handover.
* @returns {Promise<any>}
*/
@Cordova()
stopHandover(): Promise<any> { return; }
stopHandover(): Promise<any> {
return;
}
/**
* Opens the device's NFC settings.
* @returns {Promise<any>}
*/
@Cordova()
showSettings(): Promise<any> { return; }
showSettings(): Promise<any> {
return;
}
/**
* Check if NFC is available and enabled on this device.
* @returns {Promise<any>}
*/
@Cordova()
enabled(): Promise<any> { return; }
enabled(): Promise<any> {
return;
}
/**
* @{ NFC } class utility methods
* for use with
*/
* @{ NFC } class utility methods
* for use with
*/
/**
* Convert byte array to string
* @param bytes {number[]}
* @returns {string}
*/
@Cordova({ sync: true })
bytesToString(bytes: number[]): string { return; }
bytesToString(bytes: number[]): string {
return;
}
/**
* Convert string to byte array.
* @param str {string}
* @returns {number[]}
*/
@Cordova({ sync: true })
stringToBytes(str: string): number[] { return; };
stringToBytes(str: string): number[] {
return;
}
/**
* Convert byte array to hex string
*
@ -233,8 +283,9 @@ export class NFC extends IonicNativePlugin {
* @returns {string}
*/
@Cordova({ sync: true })
bytesToHexString(bytes: number[]): string { return; };
bytesToHexString(bytes: number[]): string {
return;
}
}
/**
* @hidden
@ -245,16 +296,14 @@ export class NFC extends IonicNativePlugin {
pluginRef: 'ndef'
})
/**
*@{ Ndef } class methods
*@description
* Utility methods for creating ndef records for the ndef tag format.
* Move records into array before usage. Then pass an array to methods as parameters.
* Do not pass bytes as parameters for these methods, conversion is built in.
* For usage with nfc.write() and nfc.share()
*/
* @description
* Utility methods for creating ndef records for the ndef tag format.
* Move records into array before usage. Then pass an array to methods as parameters.
* Do not pass bytes as parameters for these methods, conversion is built in.
* For usage with nfc.write() and nfc.share()
*/
@Injectable()
export class Ndef extends IonicNativePlugin {
@CordovaProperty
TNF_EMPTY: number;
@CordovaProperty
@ -288,43 +337,82 @@ export class Ndef extends IonicNativePlugin {
RTD_HANDOVER_SELECT: number[];
@Cordova({ sync: true })
record(tnf: number, type: number[] | string, id: number[] | string, payload: number[] | string): NdefRecord { return; }
record(
tnf: number,
type: number[] | string,
id: number[] | string,
payload: number[] | string
): NdefRecord {
return;
}
@Cordova({ sync: true })
textRecord(text: string, languageCode?: string, id?: number[] | string): NdefRecord { return; }
textRecord(
text: string,
languageCode?: string,
id?: number[] | string
): NdefRecord {
return;
}
@Cordova({ sync: true })
uriRecord(uri: string, id?: number[] | string): NdefRecord { return; }
uriRecord(uri: string, id?: number[] | string): NdefRecord {
return;
}
@Cordova({ sync: true })
absoluteUriRecord(uri: string, payload: number[] | string, id?: number[] | string): NdefRecord { return; }
absoluteUriRecord(
uri: string,
payload: number[] | string,
id?: number[] | string
): NdefRecord {
return;
}
@Cordova({ sync: true })
mimeMediaRecord(mimeType: string, payload: string): NdefRecord { return; }
mimeMediaRecord(mimeType: string, payload: string): NdefRecord {
return;
}
@Cordova({ sync: true })
smartPoster(ndefRecords: any[], id?: number[] | string ): NdefRecord { return; }
smartPoster(ndefRecords: any[], id?: number[] | string): NdefRecord {
return;
}
@Cordova({ sync: true })
emptyRecord(): NdefRecord { return; }
emptyRecord(): NdefRecord {
return;
}
@Cordova({ sync: true })
androidApplicationRecord(packageName: string): NdefRecord { return; }
androidApplicationRecord(packageName: string): NdefRecord {
return;
}
@Cordova({ sync: true })
encodeMessage(ndefRecords: any): any { return; }
encodeMessage(ndefRecords: any): any {
return;
}
@Cordova({ sync: true })
decodeMessage(bytes: any): any { return; }
decodeMessage(bytes: any): any {
return;
}
@Cordova({ sync: true })
docodeTnf(tnf_byte: any): any { return; }
docodeTnf(tnf_byte: any): any {
return;
}
@Cordova({ sync: true })
encodeTnf(mb: any, me: any, cf: any, sr: any, il: any, tnf: any): any { return; }
encodeTnf(mb: any, me: any, cf: any, sr: any, il: any, tnf: any): any {
return;
}
@Cordova({ sync: true })
tnfToString(tnf: any): string { return; }
tnfToString(tnf: any): string {
return;
}
@CordovaProperty
textHelper: TextHelper;
@ -343,32 +431,51 @@ export class Ndef extends IonicNativePlugin {
})
@Injectable()
export class NfcUtil extends IonicNativePlugin {
@Cordova({ sync: true })
toHex(i: number): string {
return;
}
@Cordova({ sync: true })
toHex(i: number): string { return; }
toPrintable(i: number): string {
return;
}
@Cordova({ sync: true })
toPrintable(i: number): string { return; }
bytesToString(i: number[]): string {
return;
}
@Cordova({ sync: true })
bytesToString(i: number[]): string { return; }
stringToBytes(s: string): number[] {
return;
}
@Cordova({ sync: true })
stringToBytes(s: string): number[] { return; }
bytesToHexString(bytes: number[]): string {
return;
}
@Cordova({ sync: true })
bytesToHexString(bytes: number[]): string { return; }
@Cordova({ sync: true })
isType(record: NdefRecord, tnf: number, type: number[]|string): boolean { return; }
isType(record: NdefRecord, tnf: number, type: number[] | string): boolean {
return;
}
}
export class TextHelper extends IonicNativePlugin {
decodePayload(data: number[]): string { return; }
encodePayload(text: string, lang: string): number[] { return; }
decodePayload(data: number[]): string {
return;
}
encodePayload(text: string, lang: string): number[] {
return;
}
}
export class UriHelper extends IonicNativePlugin {
decodePayload(data: number[]): string { return; }
encodePayload(uri: string): number[] { return; }
decodePayload(data: number[]): string {
return;
}
encodePayload(uri: string): number[] {
return;
}
}

View File

@ -325,10 +325,10 @@ export enum OSActionType {
*
* ```
* #!/usr/bin/env node
*
* var fs = require('fs');
* var path = require('path');
*
* var filestocopy = [{
* "resources/android/icon/drawable-hdpi-icon.png":
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
@ -345,12 +345,12 @@ export enum OSActionType {
* "resources/android/icon/drawable-xxxhdpi-icon.png":
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
* } ];
*
* module.exports = function(context) {
*
* // no need to configure below
* var rootdir = context.opts.projectRoot;
*
* filestocopy.forEach(function(obj) {
* Object.keys(obj).forEach(function(key) {
* var val = obj[key];
@ -364,7 +364,7 @@ export enum OSActionType {
* }
* });
* });
*
* };
* ```
*
@ -660,7 +660,7 @@ export class OneSignal extends IonicNativePlugin {
/**
* Enable logging to help debug if you run into an issue setting up OneSignal.
* The logging levels are as follows: 0 = None, 1= Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
*
* The higher the value the more information is shown.
*
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)

View File

@ -8,77 +8,77 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* @usage
* You can open any of these settings:
* ```
* "about", // ios
"accessibility", // ios, android
"account", // ios, android
"airplane_mode", // ios, android
"apn", // android
"application_details", // ios, android
"application_development", // android
"application", // android
"autolock", // ios
"battery_optimization", // android
"bluetooth", // ios, android
"castle", // ios
"captioning", // android
"cast", // android
"cellular_usage", // ios
"configuration_list", // ios
"data_roaming", // android
"date", // ios, android
"display", // ios, android
"dream", // android
"facetime", // ios
"home", // android
"keyboard", // ios, android
"keyboard_subtype", // android
"locale", // ios, android
"location", // ios, android
"locations", // ios
"manage_all_applications", // android
"manage_applications", // android
"memory_card", // android
"music", // ios
"music_equalizer", // ios
"music_volume", // ios
"network", // ios, android
"nike_ipod", // ios
"nfcsharing", // android
"nfc_payment", // android
"nfc_settings", // android
"notes", // ios
"notification_id", // ios
"passbook", // ios
"phone", // ios
"photos", // ios
"print", // android
"privacy", // android
"quick_launch", // android
"reset", // ios
"ringtone", // ios
"browser", // ios
"search", // ios, android
"security", // android
"settings", // ios, android
"show_regulatory_info",
"sound", // ios, android
"software_update", // ios
"storage", // ios, android
"store", // ios, android
"sync", // android
"tethering", // ios
"twitter", // ios
"touch", // ios
"usage", // ios, android
"user_dictionary", // android
"video", // ios
"voice_input", // android
"vpn", // ios
"wallpaper", // ios
"wifi_ip", // android
"wifi", // ios, android
"wireless" // android
```
* "about", // ios
* "accessibility", // ios, android
* "account", // ios, android
* "airplane_mode", // ios, android
* "apn", // android
* "application_details", // ios, android
* "application_development", // android
* "application", // android
* "autolock", // ios
* "battery_optimization", // android
* "bluetooth", // ios, android
* "castle", // ios
* "captioning", // android
* "cast", // android
* "cellular_usage", // ios
* "configuration_list", // ios
* "data_roaming", // android
* "date", // ios, android
* "display", // ios, android
* "dream", // android
* "facetime", // ios
* "home", // android
* "keyboard", // ios, android
* "keyboard_subtype", // android
* "locale", // ios, android
* "location", // ios, android
* "locations", // ios
* "manage_all_applications", // android
* "manage_applications", // android
* "memory_card", // android
* "music", // ios
* "music_equalizer", // ios
* "music_volume", // ios
* "network", // ios, android
* "nike_ipod", // ios
* "nfcsharing", // android
* "nfc_payment", // android
* "nfc_settings", // android
* "notes", // ios
* "notification_id", // ios
* "passbook", // ios
* "phone", // ios
* "photos", // ios
* "print", // android
* "privacy", // android
* "quick_launch", // android
* "reset", // ios
* "ringtone", // ios
* "browser", // ios
* "search", // ios, android
* "security", // android
* "settings", // ios, android
* "show_regulatory_info",
* "sound", // ios, android
* "software_update", // ios
* "storage", // ios, android
* "store", // ios, android
* "sync", // android
* "tethering", // ios
* "twitter", // ios
* "touch", // ios
* "usage", // ios, android
* "user_dictionary", // android
* "video", // ios
* "voice_input", // android
* "vpn", // ios
* "wallpaper", // ios
* "wifi_ip", // android
* "wifi", // ios, android
* "wireless" // android
* ```
* ```typescript
* import { OpenNativeSettings } from '@ionic-native/open-native-settings';
*

View File

@ -78,7 +78,9 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<string>}
*/
@Cordova()
version(): Promise<string> { return; }
version(): Promise<string> {
return;
}
/**
* You must preconnect to PayPal to prepare the device for processing payments.
@ -90,7 +92,9 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
init(clientIdsForEnvironments: PayPalEnvironment): Promise<any> { return; }
init(clientIdsForEnvironments: PayPalEnvironment): Promise<any> {
return;
}
/**
* You must preconnect to PayPal to prepare the device for processing payments.
@ -102,7 +106,12 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
prepareToRender(environment: string, configuration: PayPalConfiguration): Promise<any> { return; }
prepareToRender(
environment: string,
configuration: PayPalConfiguration
): Promise<any> {
return;
}
/**
* Start PayPal UI to collect payment from the user.
@ -113,7 +122,9 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
renderSinglePaymentUI(payment: PayPalPayment): Promise<any> { return; }
renderSinglePaymentUI(payment: PayPalPayment): Promise<any> {
return;
}
/**
* Once a user has consented to future payments, when the user subsequently initiates a PayPal payment
@ -126,14 +137,18 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
clientMetadataID(): Promise<any> { return; }
clientMetadataID(): Promise<any> {
return;
}
/**
* Please Read Docs on Future Payments at https://github.com/paypal/PayPal-iOS-SDK#future-payments
* @returns {Promise<any>}
*/
@Cordova()
renderFuturePaymentUI(): Promise<any> { return; }
renderFuturePaymentUI(): Promise<any> {
return;
}
/**
* Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing
@ -143,7 +158,9 @@ export class PayPal extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
renderProfileSharingUI(scopes: string[]): Promise<any> { return; }
renderProfileSharingUI(scopes: string[]): Promise<any> {
return;
}
}
export interface PayPalEnvironment {
@ -155,7 +172,13 @@ export interface PayPalEnvironment {
* @hidden
*/
export class PayPalPayment {
constructor(amount: string, currency: string, shortDescription: string, intent: string, details?: PayPalPaymentDetails) {
constructor(
amount: string,
currency: string,
shortDescription: string,
intent: string,
details?: PayPalPaymentDetails
) {
this.amount = amount;
this.currency = currency;
this.shortDescription = shortDescription;
@ -183,7 +206,7 @@ export class PayPalPayment {
* Optional Build Notation code ("BN code"), obtained from partnerprogram@paypal.com,
* for your tracking purposes.
*/
bnCode: string = 'PhoneGap_SP';
bnCode = 'PhoneGap_SP';
/**
* Optional invoice number, for your tracking purposes. (up to 256 characters)
*/
@ -202,12 +225,12 @@ export class PayPalPayment {
/**
* Optional array of PayPalItem objects.
*/
items: Array<PayPalItem>;
items: PayPalItem[];
/**
* Optional payee email, if your app is paying a third-party merchant.
* The payee's email. It must be a valid PayPal email address.
*/
* Optional payee email, if your app is paying a third-party merchant.
* The payee's email. It must be a valid PayPal email address.
*/
payeeEmail: string;
/**
@ -235,7 +258,13 @@ export class PayPalItem {
* @param {String} currency: ISO standard currency code.
* @param {String} sku: The stock keeping unit for this item. 50 characters max (optional)
*/
constructor(name: string, quantity: number, price: string, currency: string, sku?: string) {
constructor(
name: string,
quantity: number,
price: string,
currency: string,
sku?: string
) {
this.name = name;
this.quantity = quantity;
this.price = price;
@ -405,8 +434,7 @@ export class PayPalConfiguration implements PayPalConfigurationOptions {
* see defaults for options available
*/
constructor(options?: PayPalConfigurationOptions) {
let defaults: PayPalConfigurationOptions = {
const defaults: PayPalConfigurationOptions = {
defaultUserEmail: null,
defaultUserPhoneCountryCode: null,
defaultUserPhoneNumber: null,
@ -425,7 +453,7 @@ export class PayPalConfiguration implements PayPalConfigurationOptions {
};
if (options && typeof options === 'object') {
for (let i in options) {
for (const i in options) {
if (defaults.hasOwnProperty(i)) {
defaults[i] = options[i];
}
@ -450,7 +478,15 @@ export class PayPalShippingAddress {
* @param {String} postalCode: ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
* @param {String} countryCode: 2-letter country code. 2 characters max.
*/
constructor(recipientName: string, line1: string, line2: string, city: string, state: string, postalCode: string, countryCode: string) {
constructor(
recipientName: string,
line1: string,
line2: string,
city: string,
state: string,
postalCode: string,
countryCode: string
) {
this.recipientName = recipientName;
this.line1 = line1;
this.line2 = line2;

View File

@ -43,13 +43,14 @@ export interface IPedometerData {
})
@Injectable()
export class Pedometer extends IonicNativePlugin {
/**
* Checks if step counting is available. Only works on iOS.
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
*/
@Cordova()
isStepCountingAvailable(): Promise<boolean> { return; }
isStepCountingAvailable(): Promise<boolean> {
return;
}
/**
* Distance estimation indicates the ability to use step information to supply the approximate distance travelled by the user.
@ -58,7 +59,9 @@ export class Pedometer extends IonicNativePlugin {
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
*/
@Cordova()
isDistanceAvailable(): Promise<boolean> { return; }
isDistanceAvailable(): Promise<boolean> {
return;
}
/**
* Floor counting indicates the ability to count the number of floors the user walks up or down using stairs.
@ -67,27 +70,33 @@ export class Pedometer extends IonicNativePlugin {
* @return {Promise<boolean>} Returns a promise that resolves when feature is supported (true) or not supported (false)
*/
@Cordova()
isFloorCountingAvailable(): Promise<boolean> { return; }
isFloorCountingAvailable(): Promise<boolean> {
return;
}
/**
* Starts the delivery of recent pedestrian-related data to your Cordova app.
*
* When the app is suspended, the delivery of updates stops temporarily.
* Upon returning to foreground or background execution, the pedometer object begins updates again.
* @return {Observable<IPedometerData>} Returns a Observable that recieves repeatly data from pedometer in background.
*/
* Starts the delivery of recent pedestrian-related data to your Cordova app.
*
* When the app is suspended, the delivery of updates stops temporarily.
* Upon returning to foreground or background execution, the pedometer object begins updates again.
* @return {Observable<IPedometerData>} Returns a Observable that recieves repeatly data from pedometer in background.
*/
@Cordova({
observable: true,
clearFunction: 'stopPedometerUpdates'
})
startPedometerUpdates(): Observable<IPedometerData> { return; }
startPedometerUpdates(): Observable<IPedometerData> {
return;
}
/**
* Stops the delivery of recent pedestrian data updates to your Cordova app.
* @return {Promise<boolean>} Returns a promise that resolves when pedometer watching was stopped
*/
@Cordova()
stopPedometerUpdates(): Promise<any> { return; }
stopPedometerUpdates(): Promise<any> {
return;
}
/**
* Retrieves the data between the specified start and end dates.
@ -100,6 +109,10 @@ export class Pedometer extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
queryData(options: { startDate: Date, endDate: Date }): Promise<IPedometerData> { return; }
queryData(options: {
startDate: Date;
endDate: Date;
}): Promise<IPedometerData> {
return;
}
}

View File

@ -1,5 +1,11 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaInstance, Plugin, IonicNativePlugin, checkAvailability } from '@ionic-native/core';
import {
Cordova,
CordovaInstance,
Plugin,
IonicNativePlugin,
checkAvailability
} from '@ionic-native/core';
declare const Notification: any;
@ -7,22 +13,25 @@ declare const Notification: any;
* @hidden
*/
export class PLNObject {
private _objectInstance: any;
constructor(title: string, options: LocalNotificationOptions) {
if (checkAvailability(PhonegapLocalNotification.pluginRef, null, PhonegapLocalNotification.pluginName) === true) {
if (
checkAvailability(
PhonegapLocalNotification.pluginRef,
null,
PhonegapLocalNotification.pluginName
) === true
) {
this._objectInstance = new Notification(title, options);
}
}
@CordovaInstance({ sync: true })
close(): void { }
close(): void {}
}
export interface LocalNotificationOptions {
/**
* Sets the direction of the notification. One of "auto", "ltr" or "rtl"
*/
@ -47,7 +56,6 @@ export interface LocalNotificationOptions {
* Sets the icon of the notification
*/
icon?: string;
}
/**
@ -94,20 +102,22 @@ export interface LocalNotificationOptions {
})
@Injectable()
export class PhonegapLocalNotification extends IonicNativePlugin {
/**
* A global object that lets you interact with the Notification API.
* @param title {string} Title of the local notification.
* @param Options {LocalNotificationOptions} An object containing optional property/value pairs.
* @returns {PLNObject}
*/
create(title: string, options: LocalNotificationOptions) { return new PLNObject(title, options); }
create(title: string, options: LocalNotificationOptions) {
return new PLNObject(title, options);
}
/**
* requests permission from the user to show a local notification.
* @returns {Promise<any>}
*/
* requests permission from the user to show a local notification.
* @returns {Promise<any>}
*/
@Cordova()
requestPermission(): Promise<any> { return; }
requestPermission(): Promise<any> {
return;
}
}

View File

@ -1,4 +1,10 @@
import { Plugin, Cordova, IonicNativePlugin, CordovaOptions, wrap } from '@ionic-native/core';
import {
Plugin,
Cordova,
IonicNativePlugin,
CordovaOptions,
wrap
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Injectable } from '@angular/core';
@ -22,12 +28,22 @@ export interface CordovaFiniteObservableOptions extends CordovaOptions {
*
* Wraps method that returns an observable that can be completed. Provided opts.resultFinalPredicate dictates when the observable completes.
*/
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
export function CordovaFiniteObservable(
opts: CordovaFiniteObservableOptions = {}
) {
opts.observable = true;
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return (
target: Object,
methodName: string,
descriptor: TypedPropertyDescriptor<any>
) => {
return {
value: function(...args: any[]) {
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
value(...args: any[]) {
const wrappedObservable: Observable<any> = wrap(
this,
methodName,
opts
).apply(this, args);
return new Observable<any>((observer: Observer<any>) => {
const wrappedSubscription = wrappedObservable.subscribe({
next: (x: any) => {
@ -36,8 +52,12 @@ export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {
observer.complete();
}
},
error: (err: any) => { observer.error(err); },
complete: () => { observer.complete(); }
error: (err: any) => {
observer.error(err);
},
complete: () => {
observer.complete();
}
});
return () => {
wrappedSubscription.unsubscribe();
@ -91,13 +111,13 @@ export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {
plugin: 'cordova-plugin-photo-library',
pluginRef: 'cordova.plugins.photoLibrary',
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
install: 'ionic cordova plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
install:
'ionic cordova plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class PhotoLibrary extends IonicNativePlugin {
/**
* Retrieves library items. Library item contains photo metadata like width and height, as well as photoURL and thumbnailURL.
* @param options {GetLibraryOptions} Optional, like thumbnail size and chunks settings.
@ -108,7 +128,9 @@ export class PhotoLibrary extends IonicNativePlugin {
resultFinalPredicate: 'isLastChunk',
resultTransform: 'library'
})
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> { return; }
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> {
return;
}
/**
* Asks user permission to access photo library.
@ -118,7 +140,9 @@ export class PhotoLibrary extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> { return; }
requestAuthorization(options?: RequestAuthorizationOptions): Promise<void> {
return;
}
/**
* Returns list of photo albums on device.
@ -127,7 +151,9 @@ export class PhotoLibrary extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getAlbums(): Promise<AlbumItem[]> { return; }
getAlbums(): Promise<AlbumItem[]> {
return;
}
/**
* Provides means to request URL of thumbnail, with specified size or quality.
@ -139,7 +165,12 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getThumbnailURL(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<string> { return; }
getThumbnailURL(
photo: string | LibraryItem,
options?: GetThumbnailOptions
): Promise<string> {
return;
}
/**
* Provides means to request photo URL by id.
@ -151,7 +182,9 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getPhotoURL(photo: string | LibraryItem, options?: any): Promise<string> { return; }
getPhotoURL(photo: string | LibraryItem, options?: any): Promise<string> {
return;
}
/**
* Returns thumbnail as Blob.
@ -163,7 +196,12 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getThumbnail(photo: string | LibraryItem, options?: GetThumbnailOptions): Promise<Blob> { return; }
getThumbnail(
photo: string | LibraryItem,
options?: GetThumbnailOptions
): Promise<Blob> {
return;
}
/**
* Returns photo as Blob.
@ -175,7 +213,9 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getPhoto(photo: string | LibraryItem, options?: any): Promise<Blob> { return; }
getPhoto(photo: string | LibraryItem, options?: any): Promise<Blob> {
return;
}
/**
* Saves image to specified album. Album will be created if not exists.
@ -189,7 +229,13 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
saveImage(url: string, album: AlbumItem | string, options?: GetThumbnailOptions): Promise<LibraryItem> { return; }
saveImage(
url: string,
album: AlbumItem | string,
options?: GetThumbnailOptions
): Promise<LibraryItem> {
return;
}
/**
* Saves video to specified album. Album will be created if not exists.
@ -201,8 +247,9 @@ export class PhotoLibrary extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
saveVideo(url: string, album: AlbumItem | string): Promise<void> { return; }
saveVideo(url: string, album: AlbumItem | string): Promise<void> {
return;
}
}
/**

View File

@ -39,6 +39,6 @@ export class PhotoViewer extends IonicNativePlugin {
* @param title {string}
* @param options {PhotoViewerOptions}
*/
@Cordova({sync: true})
show(url: string, title?: string, options?: PhotoViewerOptions): void { }
@Cordova({ sync: true })
show(url: string, title?: string, options?: PhotoViewerOptions): void {}
}

View File

@ -2,7 +2,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name Pin Check
* @name Pin Check
* @description
* This plugin is for use with Apache Cordova and allows your application to check whether pin/keyguard or passcode is setup on iOS and Android phones.
*
@ -34,7 +34,7 @@ import { Injectable } from '@angular/core';
@Injectable()
export class PinCheck extends IonicNativePlugin {
/**
* check whether pin/keyguard or passcode is setup
* check whether pin/keyguard or passcode is setup
* @returns {Promise<boolean>}
*/
@Cordova()

View File

@ -1,12 +1,11 @@
import { Injectable } from '@angular/core';
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
@ -47,6 +46,11 @@ export class PinDialog extends IonicNativePlugin {
successIndex: 1,
errorIndex: 4 // no error callback
})
prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number, input1: string }> { return; }
prompt(
message: string,
title: string,
buttons: string[]
): Promise<{ buttonIndex: number; input1: string }> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
import {
Plugin,
Cordova,
CordovaProperty,
IonicNativePlugin
} from '@ionic-native/core';
export interface PinterestUser {
/**
@ -172,13 +177,13 @@ export interface PinterestPin {
plugin: 'cordova-plugin-pinterest',
pluginRef: 'cordova.plugins.Pinterest',
repo: 'https://github.com/zyramedia/cordova-plugin-pinterest',
install: 'ionic cordova plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID',
install:
'ionic cordova plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID',
installVariables: ['APP_ID'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Pinterest extends IonicNativePlugin {
/**
* Convenience constant for authentication scopes
*/
@ -196,7 +201,9 @@ export class Pinterest extends IonicNativePlugin {
* @returns {Promise<any>} The response object will contain the user's profile data, as well as the access token (if you need to use it elsewhere, example: send it to your server and perform actions on behalf of the user).
*/
@Cordova()
login(scopes: string[]): Promise<any> { return; }
login(scopes: string[]): Promise<any> {
return;
}
/**
* Gets the authenticated user's profile
@ -206,7 +213,9 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMe(fields?: string): Promise<PinterestUser> { return; }
getMe(fields?: string): Promise<PinterestUser> {
return;
}
/**
*
@ -217,7 +226,9 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyPins(fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
getMyPins(fields?: string, limit?: number): Promise<PinterestPin[]> {
return;
}
/**
*
@ -228,7 +239,9 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyBoards(fields?: string, limit?: number): Promise<Array<PinterestBoard>> { return; }
getMyBoards(fields?: string, limit?: number): Promise<PinterestBoard[]> {
return;
}
/**
* Get the authenticated user's likes.
@ -239,7 +252,9 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyLikes(fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
getMyLikes(fields?: string, limit?: number): Promise<PinterestPin[]> {
return;
}
/**
* Get the authenticated user's followers.
@ -250,7 +265,12 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyFollowers(fields?: string, limit?: number): Promise<Array<PinterestUser>> { return; }
getMyFollowers(
fields?: string,
limit?: number
): Promise<PinterestUser[]> {
return;
}
/**
* Get the authenticated user's followed boards.
@ -261,7 +281,12 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyFollowedBoards(fields?: string, limit?: number): Promise<Array<PinterestBoard>> { return; }
getMyFollowedBoards(
fields?: string,
limit?: number
): Promise<PinterestBoard[]> {
return;
}
/**
* Get the authenticated user's followed interests.
@ -272,7 +297,9 @@ export class Pinterest extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getMyFollowedInterests(fields?: string, limit?: number): Promise<any> { return; }
getMyFollowedInterests(fields?: string, limit?: number): Promise<any> {
return;
}
/**
* Get a user's profile.
@ -284,7 +311,9 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getUser(username: string, fields?: string): Promise<PinterestUser> { return; }
getUser(username: string, fields?: string): Promise<PinterestUser> {
return;
}
/**
* Get a board's data.
@ -296,7 +325,9 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getBoard(boardId: string, fields?: string): Promise<PinterestBoard> { return; }
getBoard(boardId: string, fields?: string): Promise<PinterestBoard> {
return;
}
/**
* Get Pins of a specific board.
@ -309,7 +340,13 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getBoardPins(boardId: string, fields?: string, limit?: number): Promise<Array<PinterestPin>> { return; }
getBoardPins(
boardId: string,
fields?: string,
limit?: number
): Promise<PinterestPin[]> {
return;
}
/**
* Delete a board.
@ -317,7 +354,9 @@ export class Pinterest extends IonicNativePlugin {
* @returns {Promise<PinterestUser>}
*/
@Cordova()
deleteBoard(boardId: string): Promise<any> { return; }
deleteBoard(boardId: string): Promise<any> {
return;
}
/**
* Create a new board for the authenticated user.
@ -329,7 +368,9 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
createBoard(name: string, desc?: string): Promise<PinterestBoard> { return; }
createBoard(name: string, desc?: string): Promise<PinterestBoard> {
return;
}
/**
* Get a Pin by ID.
@ -341,7 +382,9 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
getPin(pinId: string, fields?: string): Promise<PinterestPin> { return; }
getPin(pinId: string, fields?: string): Promise<PinterestPin> {
return;
}
/**
* Deletes a pin
@ -349,7 +392,9 @@ export class Pinterest extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
deletePin(pinId: string): Promise<any> { return; }
deletePin(pinId: string): Promise<any> {
return;
}
/**
* Creates a Pin
@ -363,6 +408,12 @@ export class Pinterest extends IonicNativePlugin {
successIndex: 4,
errorIndex: 5
})
createPin(note: string, boardId: string, imageUrl: string, link?: string): Promise<PinterestPin> { return; }
createPin(
note: string,
boardId: string,
imageUrl: string,
link?: string
): Promise<PinterestPin> {
return;
}
}

View File

@ -110,17 +110,17 @@ export class ProDeploy {
*
*
* constructor(private pro: Pro) { }
*
*
* // Get app info
* this.pro.getAppInfo().then((res: AppInfo) => {
* console.log(res)
* })
*
*
* // Get live update info
* this.pro.deploy.info().then((res: DeployInfo) => {
* console.log(res)
* })
* ```
* ```
*/
@Plugin({
pluginName: 'Pro',

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaProperty,
Plugin,
IonicNativePlugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@ -35,7 +40,7 @@ import { Observable } from 'rxjs/Observable';
* );
*
* ```
*
*
* @advanced
*
* Accepted orientation values:
@ -59,7 +64,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class ScreenOrientation extends IonicNativePlugin {
/**
* Convenience enum for possible orientations
*/
@ -81,7 +85,9 @@ export class ScreenOrientation extends IonicNativePlugin {
eventObservable: true,
event: 'orientationchange'
})
onChange(): Observable<void> { return; }
onChange(): Observable<void> {
return;
}
/**
* Lock the orientation to the passed value.
@ -90,18 +96,19 @@ export class ScreenOrientation extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
lock(orientation: string): Promise<any> { return; }
lock(orientation: string): Promise<any> {
return;
}
/**
* Unlock and allow all orientations.
*/
@Cordova({ sync: true })
unlock(): void { }
unlock(): void {}
/**
* Get the current orientation of the device.
*/
@CordovaProperty
type: string;
}

View File

@ -119,7 +119,7 @@ export class SiriShortcuts extends IonicNativePlugin {
* @return Promise<void>
*/
@Cordova()
remove(persistentIdentifiers: string|string[]): Promise<void> {
remove(persistentIdentifiers: string | string[]): Promise<void> {
return;
}
@ -137,7 +137,7 @@ export class SiriShortcuts extends IonicNativePlugin {
* @return Promise<SiriShortcut|null>
*/
@Cordova()
getActivatedShortcut(): Promise<SiriShortcut|null> {
getActivatedShortcut(): Promise<SiriShortcut | null> {
return;
}
}

View File

@ -127,7 +127,7 @@ export class SpeechRecognition extends IonicNativePlugin {
})
startListening(
options?: SpeechRecognitionListeningOptions
): Observable<Array<string>> {
): Observable<string[]> {
return;
}
@ -144,7 +144,7 @@ export class SpeechRecognition extends IonicNativePlugin {
* @return {Promise< Array<string> >} list of languages
*/
@Cordova()
getSupportedLanguages(): Promise<Array<string>> {
getSupportedLanguages(): Promise<string[]> {
return;
}

View File

@ -130,7 +130,7 @@ export class SQLiteObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any> {
sqlBatch(sqlStatements: (string | string[] | any)[]): Promise<any> {
return;
}

View File

@ -108,7 +108,6 @@ export interface ImageObj {
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.
@ -137,13 +136,13 @@ export interface PrintCommand {
* 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>;
appendBytes?: 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>;
appendRawBytes?: number[];
/**
* Set command of the character space is generated and added to the command buffer. Character Spacs (Unit: Dots) Example: 4
@ -156,7 +155,7 @@ export interface PrintCommand {
appendEmphasis?: string;
/**
* Enable emphasis mode is generated and added to the command buffer. Example: {enableEmphasis:true}
* Enable emphasis mode is generated and added to the command buffer. Example: {enableEmphasis:true}
*/
enableEmphasis?: boolean;
@ -242,7 +241,7 @@ export interface PrintCommand {
* Example: {appendHorizontalTabPosition:[15, 35]}
* Delete positions Example: {appendHorizontalTabPosition:[]}
*/
appendHorizontalTabPosition?: Array<number>;
appendHorizontalTabPosition?: 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.
@ -335,7 +334,7 @@ export interface PrintCommand {
* Example: {enableMultiple:true, width:2, height:2}
* Disable Example: {enableMultiple:false}
*/
enableMultiple?: boolean;
enableMultiple?: boolean;
/**
* Print command of the QR code is generated and added to the command buffer.
@ -420,7 +419,7 @@ export enum Emulation {
/** SM-S210i, SM-S220i, SM-S230i, SM-T300i/T300, SM-T400i */
EscPosMobile = 'EscPosMobile',
/** SP700 */
StarDotImpact = 'StarDotImpact',
StarDotImpact = 'StarDotImpact'
}
/**
@ -651,18 +650,17 @@ export interface CommandsArray extends Array<PrintCommand> {}
})
@Injectable()
export class StarPRNT extends IonicNativePlugin {
/**
* Constant for Emulation
*/
Emulation = {
Emulation = {
StarPRNT: 'StarPRNT',
StarPRNTL: 'StarPRNTL',
StarLine: 'StarLine',
StarGraphic: 'StarGraphic',
EscPos: 'EscPos',
EscPosMobile: 'EscPosMobile',
StarDotImpact: 'StarDotImpact',
StarDotImpact: 'StarDotImpact'
};
/**
@ -958,7 +956,11 @@ export class StarPRNT extends IonicNativePlugin {
observable: true,
callbackStyle: 'node'
})
connect(port: string, emulation: string, hasBarcodeReader: boolean): Observable<any> {
connect(
port: string,
emulation: string,
hasBarcodeReader: boolean
): Observable<any> {
return;
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaProperty,
Plugin,
IonicNativePlugin
} from '@ionic-native/core';
/**
* @name Status Bar
@ -42,7 +47,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
overlaysWebView(doesOverlay: boolean) { };
overlaysWebView(doesOverlay: boolean) {}
/**
* Use the default statusbar (dark text, for light backgrounds).
@ -50,7 +55,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
styleDefault() { };
styleDefault() {}
/**
* Use the lightContent statusbar (light text, for dark backgrounds).
@ -58,7 +63,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
styleLightContent() { };
styleLightContent() {}
/**
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
@ -66,7 +71,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
styleBlackTranslucent() { };
styleBlackTranslucent() {}
/**
* Use the blackOpaque statusbar (light text, for dark backgrounds).
@ -74,7 +79,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
styleBlackOpaque() { };
styleBlackOpaque() {}
/**
* Set the status bar to a specific named color. Valid options:
@ -87,7 +92,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
backgroundColorByName(colorName: string) { };
backgroundColorByName(colorName: string) {}
/**
* Set the status bar to a specific hex color (CSS shorthand supported!).
@ -99,7 +104,7 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
backgroundColorByHexString(hexString: string) { };
backgroundColorByHexString(hexString: string) {}
/**
* Hide the StatusBar
@ -107,20 +112,19 @@ export class StatusBar extends IonicNativePlugin {
@Cordova({
sync: true
})
hide() { };
hide() {}
/**
* Show the StatusBar
*/
* Show the StatusBar
*/
@Cordova({
sync: true
})
show() { };
show() {}
/**
* Whether the StatusBar is currently visible or not.
*/
@CordovaProperty
isVisible: boolean;
}

View File

@ -25,9 +25,9 @@ export interface StreamingAudioOptions {
bgColor?: string;
/** Background image for audio player. */
bgImage?: string;
/**
/**
* Background image scale for audio player.
* Valid values are:
* Valid values are:
* fit
* stretch
* aspectStretch.
@ -35,9 +35,9 @@ export interface StreamingAudioOptions {
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.
/**
* Keeps the screen lit and stops it from locking
* while audio is playing. Android only.
*/
keepAwake?: boolean;
/** Executes after success playing audio. */
@ -87,7 +87,7 @@ export class StreamingMedia extends IonicNativePlugin {
* @param options {StreamingVideoOptions} Options
*/
@Cordova({ sync: true })
playVideo(videoUrl: string, options?: StreamingVideoOptions): void { }
playVideo(videoUrl: string, options?: StreamingVideoOptions): void {}
/**
* Streams an audio
@ -95,24 +95,23 @@ export class StreamingMedia extends IonicNativePlugin {
* @param options {StreamingAudioOptions} Options
*/
@Cordova({ sync: true })
playAudio(audioUrl: string, options?: StreamingAudioOptions): void { }
playAudio(audioUrl: string, options?: StreamingAudioOptions): void {}
/**
* Stops streaming audio
*/
@Cordova({ sync: true })
stopAudio(): void { }
stopAudio(): void {}
/**
* Pauses streaming audio
*/
@Cordova({ sync: true, platforms: ['iOS'] })
pauseAudio(): void { }
pauseAudio(): void {}
/**
* Resumes streaming audio
*/
@Cordova({ sync: true, platforms: ['iOS'] })
resumeAudio(): void { }
resumeAudio(): void {}
}

View File

@ -7,7 +7,7 @@ import { Injectable } from '@angular/core';
* @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';
@ -30,12 +30,10 @@ import { Injectable } from '@angular/core';
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
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
@ -55,5 +53,4 @@ export class TealiumAdIdentifier extends IonicNativePlugin {
setVolatile(instanceName: string): Promise<any> {
return;
}
}

View File

@ -7,7 +7,7 @@ import { Injectable } from '@angular/core';
* @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';
@ -15,7 +15,7 @@ import { Injectable } from '@angular/core';
*
* constructor(private installReferrer: TealiumInstallReferrer) { }
*
*
*
* this.installReferrer.setPersistent("main");
* this.installReferrer.setVolatile("main");
*
@ -30,12 +30,10 @@ import { Injectable } from '@angular/core';
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
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
@ -55,5 +53,4 @@ export class TealiumInstallReferrer extends IonicNativePlugin {
setVolatile(instanceName: string): Promise<any> {
return;
}
}

View File

@ -2,38 +2,38 @@ 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;
/**
* 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;
}
/**
@ -76,14 +76,12 @@ export interface TealConfig {
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
install: '' // OPTIONAL install command, in case the plugin requires variables
})
@Injectable()
export class Tealium extends IonicNativePlugin {
/**
* This function initializes the Tealium Cordova plugin.
* 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
@ -123,7 +121,11 @@ export class Tealium extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
track(eventType: string, dataObject: any, instanceName: string): Promise<any> {
track(
eventType: string,
dataObject: any,
instanceName: string
): Promise<any> {
return;
}
@ -135,7 +137,11 @@ export class Tealium extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
addPersistent(keyName: string, value: string | string[] | any, instanceName: string): Promise<any> {
addPersistent(
keyName: string,
value: string | string[] | any,
instanceName: string
): Promise<any> {
return;
}
@ -147,7 +153,11 @@ export class Tealium extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
addVolatile(keyName: string, value: string | string[], instanceName: string): Promise<any> {
addVolatile(
keyName: string,
value: string | string[],
instanceName: string
): Promise<any> {
return;
}
@ -181,10 +191,14 @@ export class Tealium extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
getPersistent(keyName: string, instanceName: string, callback: any): Promise<any> {
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
@ -192,19 +206,27 @@ export class Tealium extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
getVolatile(keyName: string, instanceName: string, callback: any): Promise<any> {
getVolatile(
keyName: string,
instanceName: string,
callback: any
): Promise<any> {
return;
}
/**
* This function adds a remote command for later execution
/**
* 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> {
addRemoteCommand(
commandName: string,
instanceName: string,
callback: any
): Promise<any> {
return;
}
@ -216,5 +238,4 @@ export class Tealium extends IonicNativePlugin {
getVisitorId(): Promise<any> {
return;
}
}

View File

@ -59,9 +59,9 @@ 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
@ -160,7 +160,7 @@ export class ThreeDeeTouch extends IonicNativePlugin {
@Cordova({
sync: true
})
configureQuickActions(quickActions: Array<ThreeDeeTouchQuickAction>): void { }
configureQuickActions(quickActions: ThreeDeeTouchQuickAction[]): void { }
/**
* When a home icon is pressed, your app launches and this JS callback is invoked.

View File

@ -46,17 +46,22 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
@Injectable()
export class Uid extends IonicNativePlugin {
/** Get the device Universally Unique Identifier (UUID). */
@CordovaProperty UUID: string;
@CordovaProperty
UUID: string;
/** Get the device International Mobile Station Equipment Identity (IMEI). */
@CordovaProperty IMEI: string;
@CordovaProperty
IMEI: string;
/** Get the device International mobile Subscriber Identity (IMSI). */
@CordovaProperty IMSI: string;
@CordovaProperty
IMSI: string;
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
@CordovaProperty ICCID: string;
@CordovaProperty
ICCID: string;
/** Get the Media Access Control address (MAC). */
@CordovaProperty MAC: string;
@CordovaProperty
MAC: string;
}

View File

@ -45,6 +45,6 @@ export class Vibration extends IonicNativePlugin {
@Cordova({
sync: true
})
vibrate(time: number | Array<number>) { }
vibrate(time: number | number[]) { }
}

View File

@ -30,7 +30,10 @@ export interface MediaFile {
* @param {Function} successCallback
* @param {Function} [errorCallback]
*/
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): any;
getFormatData(
successCallback: (data: MediaFileData) => any,
errorCallback?: (err: any) => any
): any;
}
export interface MediaFileData {
@ -57,43 +60,41 @@ export interface MediaFileData {
}
export interface VideoCapturePlusOptions {
/**
* The number of videos to record, default 1 (on iOS always 1)
*/
* The number of videos to record, default 1 (on iOS always 1)
*/
limit?: number;
/**
* Max duration in seconds, default 0, which is 'forever'
*/
* Max duration in seconds, default 0, which is 'forever'
*/
duration?: number;
/**
* Set to true to override the default low quality setting
*/
* Set to true to override the default low quality setting
*/
highquality?: boolean;
/**
* Set to true to override the default backfacing camera setting.
* You'll want to sniff the useragent/device and pass the best overlay based on that.. assuming iphone here
*/
* Set to true to override the default backfacing camera setting.
* You'll want to sniff the useragent/device and pass the best overlay based on that.. assuming iphone here
*/
frontcamera?: boolean;
/**
* put the png overlay in your assets folder
*/
* put the png overlay in your assets folder
*/
portraitOverlay?: string;
/**
* not passing an overlay means no image is shown for the landscape orientation
*/
* not passing an overlay means no image is shown for the landscape orientation
*/
landscapeOverlay?: string;
/**
* iOS only
*/
* iOS only
*/
overlayText?: string;
}
/**
@ -138,7 +139,6 @@ export interface VideoCapturePlusOptions {
})
@Injectable()
export class VideoCapturePlus extends IonicNativePlugin {
/**
* Starts recordings
* @param [options] {VideoCapturePlusOptions} Configure options
@ -147,6 +147,7 @@ export class VideoCapturePlus extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
captureVideo(options?: VideoCapturePlusOptions): Promise<MediaFile[]> { return; }
captureVideo(options?: VideoCapturePlusOptions): Promise<MediaFile[]> {
return;
}
}

View File

@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface TranscodeOptions {
/** The path to the video on the device. */
fileUri: string;
@ -39,7 +38,7 @@ export interface TranscodeOptions {
/** Number of audio channels. iOS only. Defaults to 2. */
audioChannels?: number;
/** Sample rate for the audio. iOS only. Defaults to 44100*/
/* Sample rate for the audio. iOS only. Defaults to 44100*/
audioSampleRate?: number;
/** Sample rate for the audio. iOS only. Defaults to 128 kilobits (128000). */
@ -50,7 +49,6 @@ export interface TranscodeOptions {
}
export interface TrimOptions {
/** Path to input video. */
fileUri: string;
@ -65,11 +63,9 @@ export interface TrimOptions {
/** Progress on transcode. info will be a number from 0 to 100 */
progress?: (info: any) => void;
}
export interface CreateThumbnailOptions {
/** The path to the video on the device */
fileUri: string;
@ -87,18 +83,14 @@ export interface CreateThumbnailOptions {
/** Quality of the thumbnail (between 1 and 100). */
quality?: number;
}
export interface GetVideoInfoOptions {
/** The path to the video on the device. */
fileUri: string;
}
export interface VideoInfo {
/** Width of the video in pixels. */
width: number;
@ -116,7 +108,6 @@ export interface VideoInfo {
/** Bitrate of the video in bits per second. */
bitrate: number;
}
/**
@ -156,7 +147,6 @@ export interface VideoInfo {
})
@Injectable()
export class VideoEditor extends IonicNativePlugin {
OptimizeForNetworkUse = {
NO: 0,
YES: 1
@ -177,7 +167,9 @@ export class VideoEditor extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
transcodeVideo(options: TranscodeOptions): Promise<string> { return; }
transcodeVideo(options: TranscodeOptions): Promise<string> {
return;
}
/**
* Trim a video
@ -188,7 +180,9 @@ export class VideoEditor extends IonicNativePlugin {
callbackOrder: 'reverse',
platforms: ['iOS']
})
trim(options: TrimOptions): Promise<string> { return; }
trim(options: TrimOptions): Promise<string> {
return;
}
/**
* Create a JPEG thumbnail from a video
@ -198,7 +192,9 @@ export class VideoEditor extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
createThumbnail(options: CreateThumbnailOptions): Promise<string> { return; }
createThumbnail(options: CreateThumbnailOptions): Promise<string> {
return;
}
/**
* Get info on a video (width, height, orientation, duration, size, & bitrate)
@ -208,6 +204,7 @@ export class VideoEditor extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getVideoInfo(options: GetVideoInfoOptions): Promise<VideoInfo> { return; }
getVideoInfo(options: GetVideoInfoOptions): Promise<VideoInfo> {
return;
}
}

View File

@ -6,9 +6,9 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
*/
export interface VideoOptions {
/**
* Set the initial volume of the video playback, where 0.0 is 0% volume and 1.0 is 100%.
* For example: for a volume of 30% set the value to 0.3.
*/
* Set the initial volume of the video playback, where 0.0 is 0% volume and 1.0 is 100%.
* For example: for a volume of 30% set the value to 0.3.
*/
volume?: number;
/**
* There are two options for the scaling mode. SCALE_TO_FIT which is default and SCALE_TO_FIT_WITH_CROPPING.
@ -52,7 +52,6 @@ export interface VideoOptions {
})
@Injectable()
export class VideoPlayer extends IonicNativePlugin {
/**
* Plays the video from the passed url.
* @param fileUrl {string} File url to the video.
@ -60,11 +59,13 @@ export class VideoPlayer extends IonicNativePlugin {
* @returns {Promise<any>} Resolves promise when the video was played successfully.
*/
@Cordova()
play(fileUrl: string, options?: VideoOptions): Promise<any> { return; }
play(fileUrl: string, options?: VideoOptions): Promise<any> {
return;
}
/**
* Stops the video playback immediatly.
*/
@Cordova({ sync: true })
close(): void { }
close(): void {}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaProperty,
Plugin,
IonicNativePlugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface IntentOptions {
@ -14,7 +19,7 @@ export interface IntentOptions {
class: string;
};
flags?: number[];
};
}
/**
* @name Web Intent
@ -46,7 +51,8 @@ export interface IntentOptions {
pluginName: 'WebIntent',
plugin: 'com-darryncampbell-cordova-plugin-intent',
pluginRef: 'plugins.intentShim',
repo: 'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
repo:
'https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent',
platforms: ['Android']
})
@Injectable()
@ -55,61 +61,71 @@ export class WebIntent extends IonicNativePlugin {
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_SEND: string;
@CordovaProperty
ACTION_SEND: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_VIEW: string;
@CordovaProperty
ACTION_VIEW: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty EXTRA_TEXT: string;
@CordovaProperty
EXTRA_TEXT: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty EXTRA_SUBJECT: string;
@CordovaProperty
EXTRA_SUBJECT: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty EXTRA_STREAM: string;
@CordovaProperty
EXTRA_STREAM: string;
/**
* Convenience constant for extras
* @type {string}
*/
@CordovaProperty EXTRA_EMAIL: string;
@CordovaProperty
EXTRA_EMAIL: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_CALL: string;
@CordovaProperty
ACTION_CALL: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_SENDTO: string;
@CordovaProperty
ACTION_SENDTO: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_GET_CONTENT: string;
@CordovaProperty
ACTION_GET_CONTENT: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty ACTION_PICK: string;
@CordovaProperty
ACTION_PICK: string;
/**
* Launches an Android intent
@ -223,7 +239,7 @@ export class WebIntent extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
sendResult({ extras: {}}): Promise<any> {
sendResult({ extras: {} }): Promise<any> {
return;
}
}

View File

@ -19,12 +19,12 @@ export interface WheelSelectorOptions {
/**
* The items to display (array of items).
*/
items: Array<Array<WheelSelectorItem>>;
items: WheelSelectorItem[][];
/**
* Which items to display by default.
*/
defaultItems?: Array<DefaultItem>;
defaultItems?: DefaultItem[];
/**
* The 'ok' button text
@ -55,7 +55,7 @@ export interface WheelSelectorOptions {
* key/value to be displayed
* Default: description
*/
displayKey?: string;
displayKey?: string;
}
export interface WheelSelectorData {
@ -155,7 +155,7 @@ export interface WheelSelectorData {
* ],
* displayKey: 'name',
* defaultItems: [
* {index:0, value: this.jsonData.firstNames[2].name},
* {index:0, value: this.jsonData.firstNames[2].name},
* {index: 0, value: this.jsonData.lastNames[3].name}
* ]
* }).then(

View File

@ -8,8 +8,8 @@ export interface ZeroconfService {
name: string;
port: number;
hostname: string;
ipv4Addresses: Array<string>;
ipv6Addresses: Array<string>;
ipv4Addresses: string[];
ipv6Addresses: string[];
txtRecord: any;
}

View File

@ -1,3 +1,16 @@
{
"extends": "tslint-ionic-rules"
"extends": ["tslint-ionic-rules"],
"rules": {
"ordered-imports": false,
"no-empty": false,
"no-import-side-effect": false,
"no-redundant-jsdoc": false,
"ban-types": false,
"no-shadowed-variable": false,
"only-arrow-functions": false,
"ter-no-proto": false,
"adjacent-overload-signatures": false,
"no-constant-condition": false,
"no-extra-boolean-cast": false
}
}