chore(package): bump dependencies and lint rules

This commit is contained in:
Daniel 2018-03-16 22:04:01 +01:00
parent 7547a94c80
commit 21ad4734fa
178 changed files with 10565 additions and 4194 deletions

5122
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,45 +6,44 @@
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
"license": "MIT",
"devDependencies": {
"@angular/compiler": "4.4.4",
"@angular/compiler-cli": "4.4.4",
"@angular/core": "4.4.4",
"@angular/compiler": "5.2.9",
"@angular/compiler-cli": "5.2.9",
"@angular/core": "5.2.9",
"@types/cordova": "0.0.34",
"@types/jasmine": "^2.6.3",
"@types/node": "^8.0.50",
"@types/jasmine": "^2.8.6",
"@types/node": "^8.9.5",
"canonical-path": "0.0.2",
"child-process-promise": "2.2.1",
"conventional-changelog-cli": "1.3.4",
"cpr": "2.0.0",
"cz-conventional-changelog": "2.0.0",
"decamelize": "1.2.0",
"dgeni": "0.4.7",
"conventional-changelog-cli": "^1.3.16",
"cpr": "^3.0.1",
"cz-conventional-changelog": "^2.1.0",
"decamelize": "^2.0.0",
"dgeni": "^0.4.9",
"dgeni-packages": "0.16.10",
"fs-extra": "2.0.0",
"fs-extra-promise": "0.4.1",
"fs-extra": "^5.0.0",
"gulp": "3.9.1",
"gulp-rename": "1.2.2",
"gulp-replace": "0.5.4",
"gulp-tslint": "6.1.2",
"jasmine-core": "^2.6.1",
"karma": "^1.7.0",
"gulp-replace": "^0.6.1",
"gulp-tslint": "^8.1.3",
"jasmine-core": "^3.1.0",
"karma": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-jasmine": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-typescript": "^3.0.1",
"karma-typescript-es6-transform": "^1.0.0",
"lodash": "4.17.4",
"karma-typescript": "^3.0.12",
"karma-typescript-es6-transform": "^1.0.4",
"lodash": "^4.17.5",
"minimist": "1.2.0",
"node-html-encoder": "0.0.2",
"q": "1.5.0",
"queue": "4.2.1",
"rimraf": "2.6.1",
"rxjs": "5.5.2",
"semver": "5.3.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "~2.4.2",
"zone.js": "0.8.18"
"q": "^1.5.1",
"queue": "^4.4.2",
"rimraf": "^2.6.2",
"rxjs": "^5.5.7",
"semver": "^5.5.0",
"tslint": "^5.9.1",
"tslint-ionic-rules": "0.0.9",
"typescript": "~2.6.2",
"zone.js": "0.8.20"
},
"scripts": {
"start": "npm run test:watch",

View File

@ -1,6 +1,6 @@
"use strict";
'use strict';
// Node module dependencies
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
const fs = require('fs-extra'),
queue = require('queue'),
path = require('path'),
exec = require('child_process').exec;
@ -15,7 +15,6 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
BUILD_DIST_ROOT = path.resolve(ROOT, 'dist/@ionic-native'), // dist directory root path
BUILD_CORE_DIST = path.resolve(BUILD_DIST_ROOT, 'core'); // core dist directory path
// dependency versions
const ANGULAR_VERSION = '*',
RXJS_VERSION = '^5.0.1',
@ -24,13 +23,13 @@ const ANGULAR_VERSION = '*',
// package dependencies
const CORE_PEER_DEPS = {
'rxjs': RXJS_VERSION
rxjs: RXJS_VERSION
};
const PLUGIN_PEER_DEPS = {
'@ionic-native/core': MIN_CORE_VERSION,
'@angular/core': ANGULAR_VERSION,
'rxjs': RXJS_VERSION
rxjs: RXJS_VERSION
};
// set peer dependencies for all plugins
@ -44,8 +43,10 @@ fs.mkdirpSync(BUILD_TMP);
console.log('Preparing core module package.json');
CORE_PACKAGE_JSON.version = IONIC_NATIVE_VERSION;
CORE_PACKAGE_JSON.peerDependencies = CORE_PEER_DEPS;
fs.writeJsonSync(path.resolve(BUILD_CORE_DIST, 'package.json'), CORE_PACKAGE_JSON);
fs.writeJsonSync(
path.resolve(BUILD_CORE_DIST, 'package.json'),
CORE_PACKAGE_JSON
);
// Fetch a list of the plugins
const PLUGINS = fs.readdirSync(PLUGINS_PATH);
@ -59,7 +60,9 @@ const index = pluginsToBuild.indexOf('ignore-errors');
if (index > -1) {
ignoreErrors = true;
pluginsToBuild.splice(index, 1);
console.log('Build will continue even if errors were thrown. Errors will be printed when build finishes.');
console.log(
'Build will continue even if errors were thrown. Errors will be printed when build finishes.'
);
}
if (!pluginsToBuild.length) {
@ -71,12 +74,9 @@ const QUEUE = queue({
concurrency: require('os').cpus().length
});
// Function to process a single plugin
const addPluginToQueue = pluginName => {
QUEUE.push((callback) => {
QUEUE.push(callback => {
console.log(`Building plugin: ${pluginName}`);
const PLUGIN_BUILD_DIR = path.resolve(BUILD_TMP, 'plugins', pluginName),
@ -84,10 +84,10 @@ const addPluginToQueue = pluginName => {
let tsConfigPath;
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
.then(() => fs.mkdirpAsync(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
fs
.mkdirs(PLUGIN_BUILD_DIR) // create tmp build dir
.then(() => fs.mkdirs(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
.then(() => {
// Write tsconfig.json
const tsConfig = JSON.parse(JSON.stringify(PLUGIN_TS_CONFIG));
tsConfig.files = [PLUGIN_SRC_PATH];
@ -95,7 +95,7 @@ const addPluginToQueue = pluginName => {
tsConfigPath = path.resolve(PLUGIN_BUILD_DIR, 'tsconfig.json');
return fs.writeJsonAsync(tsConfigPath, tsConfig);
return fs.writeJson(tsConfigPath, tsConfig);
})
.then(() => {
// clone package.json
@ -104,42 +104,39 @@ const addPluginToQueue = pluginName => {
packageJson.name = `@ionic-native/${pluginName}`;
packageJson.version = IONIC_NATIVE_VERSION;
return fs.writeJsonAsync(path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'), packageJson);
return fs.writeJson(
path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'),
packageJson
);
})
.then(() => {
// compile the plugin
exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => {
if (err) {
if (!ignoreErrors) {
// oops! something went wrong.
console.log(err);
callback(`\n\nBuilding ${pluginName} failed.`);
return;
} else {
errors.push(err);
exec(
`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`,
(err, stdout, stderr) => {
if (err) {
if (!ignoreErrors) {
// oops! something went wrong.
console.log(err);
callback(`\n\nBuilding ${pluginName} failed.`);
return;
} else {
errors.push(err);
}
}
// we're done with this plugin!
callback();
}
// we're done with this plugin!
callback();
});
);
})
.catch(callback);
}); // QUEUE.push end
};
pluginsToBuild.forEach(addPluginToQueue);
QUEUE.start((err) => {
QUEUE.start(err => {
if (err) {
console.log('Error building plugins.');
console.log(err);
@ -155,5 +152,4 @@ QUEUE.start((err) => {
} else {
console.log('Done processing plugins!');
}
});

View File

@ -1,11 +1,10 @@
"use strict";
'use strict';
// Node module dependencies
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
const fs = require('fs-extra'),
queue = require('queue'),
path = require('path'),
exec = require('child-process-promise').exec;
const ROOT = path.resolve(path.join(__dirname, '../../')),
DIST = path.resolve(ROOT, 'dist', '@ionic-native');
@ -20,15 +19,16 @@ const QUEUE = queue({
});
PACKAGES.forEach(packageName => {
QUEUE.push(done => {
console.log(`Publishing @ionic-native/${packageName}`);
const packagePath = path.resolve(DIST, packageName);
exec(`npm publish ${packagePath} ${FLAGS}`)
.then(() => done())
.catch((e) => {
if (e.stderr && e.stderr.indexOf('previously published version') === -1) {
.catch(e => {
if (
e.stderr &&
e.stderr.indexOf('previously published version') === -1
) {
failedPackages.push({
cmd: e.cmd,
stderr: e.stderr
@ -36,13 +36,10 @@ PACKAGES.forEach(packageName => {
}
done();
});
});
});
QUEUE.start((err) => {
QUEUE.start(err => {
if (err) {
console.log('Error publishing ionic-native. ', err);
} else if (failedPackages.length > 0) {
@ -51,8 +48,4 @@ QUEUE.start((err) => {
} else {
console.log('Done publishing ionic-native!');
}
});

View File

@ -1,39 +1,40 @@
"use strict";
'use strict';
const config = require('../config.json'),
projectPackage = require('../../package.json'),
path = require('path'),
fs = require('fs-extra-promise').useFs(require('fs-extra')),
fs = require('fs-extra'),
Dgeni = require('dgeni');
module.exports = gulp => {
gulp.task('docs', [], () => {
try {
const ionicPackage = require('./dgeni-config')(projectPackage.version),
dgeni = new Dgeni([ionicPackage]);
return dgeni.generate().then(docs => console.log(docs.length + ' docs generated'));
return dgeni
.generate()
.then(docs => console.log(docs.length + ' docs generated'));
} catch (err) {
console.log(err.stack);
}
});
gulp.task('readmes', [], function() {
fs.copySync(path.resolve(__dirname, '..', '..', 'README.md'), path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md'));
fs.copySync(
path.resolve(__dirname, '..', '..', 'README.md'),
path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md')
);
try {
const ionicPackage = require('./dgeni-readmes-config')(projectPackage.version),
const ionicPackage = require('./dgeni-readmes-config')(
projectPackage.version
),
dgeni = new Dgeni([ionicPackage]);
return dgeni.generate().then(docs => console.log(docs.length + ' README files generated'));
return dgeni
.generate()
.then(docs => console.log(docs.length + ' README files generated'));
} catch (err) {
console.log(err.stack);
}
});
};

View File

@ -9,13 +9,17 @@ export function checkReady() {
let didFireReady = false;
document.addEventListener('deviceready', () => {
console.log(`Ionic Native: deviceready event fired after ${(Date.now() - before)} ms`);
console.log(
`Ionic Native: deviceready event fired after ${Date.now() - before} ms`
);
didFireReady = true;
});
setTimeout(() => {
if (!didFireReady && !!window.cordova) {
console.warn(`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`);
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);
}
}, DEVICE_READY_TIMEOUT);
}

View File

@ -1,24 +1,34 @@
import 'core-js';
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
import { Observable } from 'rxjs/Observable';
import {
Cordova,
CordovaCheck,
CordovaInstance,
CordovaProperty,
InstanceProperty,
Plugin
} from './decorators';
import { IonicNativePlugin } from './ionic-native-plugin';
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
import { Observable } from 'rxjs/Observable';
declare const window: any;
class TestObject {
constructor(public _objectInstance: any) {}
@InstanceProperty
name: string;
@InstanceProperty name: string;
@CordovaInstance({ sync: true })
pingSync(): string { return; }
pingSync(): string {
return;
}
@CordovaInstance()
ping(): Promise<any> { return; }
ping(): Promise<any> {
return;
}
}
@Plugin({
@ -29,15 +39,17 @@ class TestObject {
platforms: ['Android', 'iOS']
})
class TestPlugin extends IonicNativePlugin {
@CordovaProperty
name: string;
@CordovaProperty name: string;
@Cordova({ sync: true })
pingSync(): string { return; }
pingSync(): string {
return;
}
@Cordova()
ping(): Promise<string> { return; }
ping(): Promise<string> {
return;
}
@CordovaCheck()
customPing(): Promise<string> {
@ -51,14 +63,17 @@ class TestPlugin extends IonicNativePlugin {
@Cordova({
destruct: true
})
destructPromise(): Promise<any> { return; }
destructPromise(): Promise<any> {
return;
}
@Cordova({
destruct: true,
observable: true
})
destructObservable(): Observable<any> { return; }
destructObservable(): Observable<any> {
return;
}
}
function definePlugin() {
@ -78,7 +93,6 @@ function definePlugin() {
}
describe('Regular Decorators', () => {
let plugin: TestPlugin;
beforeEach(() => {
@ -87,7 +101,6 @@ describe('Regular Decorators', () => {
});
describe('Plugin', () => {
it('should set pluginName', () => {
expect(TestPlugin.getPluginName()).toEqual('TestPlugin');
});
@ -103,17 +116,16 @@ describe('Regular Decorators', () => {
it('should return supported platforms', () => {
expect(TestPlugin.getSupportedPlatforms()).toEqual(['Android', 'iOS']);
});
});
describe('Cordova', () => {
it('should do a sync function', () => {
expect(plugin.pingSync()).toEqual('pong');
});
it('should do an async function', (done: Function) => {
plugin.ping()
plugin
.ping()
.then(res => {
expect(res).toEqual('pong');
done();
@ -125,39 +137,31 @@ describe('Regular Decorators', () => {
});
it('should throw plugin_not_installed error', (done: Function) => {
delete window.testPlugin;
window.cordova = true;
expect(<any>plugin.pingSync()).toEqual(ERR_PLUGIN_NOT_INSTALLED);
plugin.ping()
.catch(e => {
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
delete window.cordova;
done();
});
plugin.ping().catch(e => {
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
delete window.cordova;
done();
});
});
it('should throw cordova_not_available error', (done: Function) => {
delete window.testPlugin;
expect(<any>plugin.pingSync()).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
plugin.ping()
.catch(e => {
expect(e).toEqual(ERR_CORDOVA_NOT_AVAILABLE.error);
done();
});
plugin.ping().catch(e => {
expect(e).toEqual(ERR_CORDOVA_NOT_AVAILABLE.error);
done();
});
});
});
describe('CordovaProperty', () => {
it('should return property value', () => {
expect(plugin.name).toEqual('John Smith');
});
@ -166,61 +170,47 @@ describe('Regular Decorators', () => {
plugin.name = 'value2';
expect(plugin.name).toEqual('value2');
});
});
describe('CordovaCheck', () => {
it('should run the method when plugin exists', (done) => {
plugin.customPing()
.then(res => {
expect(res).toEqual('pong');
done();
});
it('should run the method when plugin exists', done => {
plugin.customPing().then(res => {
expect(res).toEqual('pong');
done();
});
});
it('shouldnt run the method when plugin doesnt exist', (done) => {
it('shouldnt run the method when plugin doesnt exist', done => {
delete window.testPlugin;
window.cordova = true;
plugin.customPing()
.catch(e => {
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
done();
});
plugin.customPing().catch(e => {
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
done();
});
});
});
describe('CordovaOptions', () => {
describe('destruct', () => {
it('should destruct values returned by a Promise', (done) => {
plugin.destructPromise()
.then((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
it('should destruct values returned by a Promise', done => {
plugin.destructPromise().then((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
});
it('should destruct values returned by an Observable', (done) => {
plugin.destructObservable()
.subscribe((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
it('should destruct values returned by an Observable', done => {
plugin.destructObservable().subscribe((args: any[]) => {
expect(args).toEqual(['hello', 'world']);
done();
});
});
});
});
});
describe('Instance Decorators', () => {
let instance: TestObject,
plugin: TestPlugin;
let instance: TestObject, plugin: TestPlugin;
beforeEach(() => {
definePlugin();
@ -228,20 +218,14 @@ describe('Instance Decorators', () => {
instance = plugin.create();
});
describe('Instance plugin', () => {
});
describe('Instance plugin', () => {});
describe('CordovaInstance', () => {
it('should call instance async method', (done) => {
instance.ping()
.then(r => {
expect(r).toEqual('pong');
done();
});
it('should call instance async method', done => {
instance.ping().then(r => {
expect(r).toEqual('pong');
done();
});
});
it('should call instance sync method', () => {
@ -249,18 +233,16 @@ describe('Instance Decorators', () => {
});
it('shouldnt call instance method when _objectInstance is undefined', () => {
delete instance._objectInstance;
instance.ping()
instance
.ping()
.then(r => {
expect(r).toBeUndefined();
})
.catch(e => {
expect(e).toBeUndefined();
});
});
});
describe('InstanceProperty', () => {
@ -273,5 +255,4 @@ describe('Instance Decorators', () => {
expect(instance.name).toEqual('John Cena');
});
});
});

View File

@ -1,8 +1,16 @@
import { instanceAvailability, checkAvailability, wrap, wrapInstance, overrideFunction } from './plugin';
import { getPlugin, getPromise } from './util';
import { Observable } from 'rxjs/Observable';
import 'rxjs/observable/throw';
import { Observable } from 'rxjs/Observable';
import {
checkAvailability,
instanceAvailability,
overrideFunction,
wrap,
wrapInstance
} from './plugin';
import { getPlugin, getPromise } from './util';
export interface PluginConfig {
/**
* Plugin name, this should match the class name
@ -109,21 +117,23 @@ export interface CordovaCheckOptions {
* @private
*/
export function InstanceCheck(opts: CordovaCheckOptions = {}) {
return (pluginObj: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
return (
pluginObj: Object,
methodName: string,
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> => {
return {
value: function(...args: any[]): any {
if (instanceAvailability(this)) {
return descriptor.value.apply(this, args);
} else {
if (opts.sync) {
return;
} else if (opts.observable) {
return new Observable<any>(() => { });
return new Observable<any>(() => {});
}
return getPromise(() => { });
return getPromise(() => {});
}
},
enumerable: true
@ -136,7 +146,11 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
* @private
*/
export function CordovaCheck(opts: CordovaCheckOptions = {}) {
return (pluginObj: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> => {
return (
pluginObj: Object,
methodName: string,
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> => {
return {
value: function(...args: any[]): any {
const check = checkAvailability(pluginObj);
@ -177,7 +191,6 @@ 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) {
cls[prop] = config[prop];
@ -226,7 +239,11 @@ export function Plugin(config: PluginConfig): ClassDecorator {
* and the required plugin are installed.
*/
export function Cordova(opts: CordovaOptions = {}) {
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return (
target: Object,
methodName: string,
descriptor: TypedPropertyDescriptor<any>
) => {
return {
value: function(...args: any[]) {
return wrap(this, methodName, opts).apply(this, args);
@ -268,7 +285,7 @@ export function CordovaProperty(target: any, key: string) {
return null;
}
},
set: (value) => {
set: value => {
if (checkAvailability(target, key) === true) {
getPlugin(target.constructor.getPluginRef())[key] = value;
}
@ -301,7 +318,11 @@ export function InstanceProperty(target: any, key: string) {
* and the required plugin are installed.
*/
export function CordovaFunctionOverride(opts: any = {}) {
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
return (
target: Object,
methodName: string,
descriptor: TypedPropertyDescriptor<any>
) => {
return {
value: function(...args: any[]) {
return overrideFunction(this, methodName, opts);
@ -310,4 +331,3 @@ export function CordovaFunctionOverride(opts: any = {}) {
};
};
}

View File

@ -1,8 +1,7 @@
// This is to verify that new (FileTransfer.getPlugin)() works
import { Plugin, CordovaInstance } from './decorators';
import { checkAvailability } from './plugin';
import { CordovaInstance, Plugin } from './decorators';
import { IonicNativePlugin } from './ionic-native-plugin';
import { checkAvailability } from './plugin';
class FT {
hello(): string {
@ -21,7 +20,13 @@ class FT {
export class FileTransfer extends IonicNativePlugin {
create(): FileTransferObject {
let instance: any;
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
if (
checkAvailability(
FileTransfer.getPluginRef(),
null,
FileTransfer.getPluginName()
) === true
) {
instance = new (FileTransfer.getPlugin())();
}
return new FileTransferObject(instance);
@ -29,20 +34,21 @@ export class FileTransfer extends IonicNativePlugin {
}
export class FileTransferObject {
constructor(public _objectInstance: any) {
console.info('Creating a new FileTransferObject with instance: ', _objectInstance);
console.info(
'Creating a new FileTransferObject with instance: ',
_objectInstance
);
}
@CordovaInstance({ sync: true })
hello(): string { return; }
hello(): string {
return;
}
}
describe('Mock FileTransfer Plugin', () => {
let plugin: FileTransfer,
instance: FileTransferObject;
let plugin: FileTransfer, instance: FileTransferObject;
beforeAll(() => {
plugin = new FileTransfer();
@ -65,5 +71,4 @@ describe('Mock FileTransfer Plugin', () => {
console.info('instance hello is', instance.hello());
expect(instance.hello()).toEqual('world');
});
});

View File

@ -1,5 +1,4 @@
export class IonicNativePlugin {
static pluginName: string;
static pluginRef: string;
@ -16,31 +15,40 @@ export class IonicNativePlugin {
* Returns a boolean that indicates whether the plugin is installed
* @return {boolean}
*/
static installed(): boolean { return false; }
static installed(): boolean {
return false;
}
/**
* Returns the original plugin object
*/
static getPlugin(): any { }
static getPlugin(): any {}
/**
* Returns the plugin's name
*/
static getPluginName(): string { return; }
static getPluginName(): string {
return;
}
/**
* Returns the plugin's reference
*/
static getPluginRef(): string { return; }
static getPluginRef(): string {
return;
}
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string { return; }
static getPluginInstallName(): string {
return;
}
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] { return; }
static getSupportedPlatforms(): string[] {
return;
}
}

View File

@ -1,9 +1,10 @@
import { getPlugin, getPromise, cordovaWarn, pluginWarn } from './util';
import { checkReady } from './bootstrap';
import { CordovaOptions } from './decorators';
import 'rxjs/add/observable/fromEvent';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
import { checkReady } from './bootstrap';
import { CordovaOptions } from './decorators';
import { cordovaWarn, getPlugin, getPromise, pluginWarn } from './util';
checkReady();
@ -13,16 +14,26 @@ checkReady();
export const ERR_CORDOVA_NOT_AVAILABLE = { error: 'cordova_not_available' };
export const ERR_PLUGIN_NOT_INSTALLED = { error: 'plugin_not_installed' };
/**
* Checks if plugin/cordova is available
* @return {boolean | { error: string } }
* @private
*/
export function checkAvailability(pluginRef: string, methodName?: string, pluginName?: string): boolean | { error: string };
export function checkAvailability(pluginObj: any, methodName?: string, pluginName?: string): boolean | { error: string };
export function checkAvailability(plugin: any, methodName?: string, pluginName?: string): boolean | { error: string } {
export function checkAvailability(
pluginRef: string,
methodName?: string,
pluginName?: string
): boolean | { error: string };
export function checkAvailability(
pluginObj: any,
methodName?: string,
pluginName?: string
): boolean | { error: string };
export function checkAvailability(
plugin: any,
methodName?: string,
pluginName?: string
): boolean | { error: string } {
let pluginRef, pluginInstance, pluginPackage;
if (typeof plugin === 'string') {
@ -35,7 +46,10 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
pluginInstance = getPlugin(pluginRef);
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
if (
!pluginInstance ||
(!!methodName && typeof pluginInstance[methodName] === 'undefined')
) {
if (!window.cordova) {
cordovaWarn(pluginName, methodName);
return ERR_CORDOVA_NOT_AVAILABLE;
@ -52,11 +66,23 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
* Checks if _objectInstance exists and has the method/property
* @private
*/
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
return pluginObj._objectInstance && (!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined');
export function instanceAvailability(
pluginObj: any,
methodName?: string
): boolean {
return (
pluginObj._objectInstance &&
(!methodName ||
typeof pluginObj._objectInstance[methodName] !== 'undefined')
);
}
function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
function setIndex(
args: any[],
opts: any = {},
resolve?: Function,
reject?: Function
): any {
// ignore resolve and reject in case sync
if (opts.sync) {
return args;
@ -75,12 +101,19 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
resolve(result);
}
});
} else if (opts.callbackStyle === 'object' && opts.successName && opts.errorName) {
} else if (
opts.callbackStyle === 'object' &&
opts.successName &&
opts.errorName
) {
let obj: any = {};
obj[opts.successName] = resolve;
obj[opts.errorName] = reject;
args.push(obj);
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
} else if (
typeof opts.successIndex !== 'undefined' ||
typeof opts.errorIndex !== 'undefined'
) {
const setSuccessIndex = () => {
// If we've specified a success/error index
if (opts.successIndex > args.length) {
@ -106,8 +139,6 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
setSuccessIndex();
setErrorIndex();
}
} else {
// Otherwise, let's tack them on to the end of the argument list
// which is 90% of cases
@ -117,7 +148,14 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
return args;
}
function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts: any = {}, resolve?: Function, reject?: Function) {
function callCordovaPlugin(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {},
resolve?: Function,
reject?: Function
) {
// Try to figure out where the success/error callbacks need to be bound
// to our promise resolve/reject handlers.
args = setIndex(args, opts, resolve, reject);
@ -130,16 +168,34 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
} else {
return availabilityCheck;
}
}
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
function wrapPromise(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
let pluginResult: any, rej: Function;
const p = getPromise((resolve: Function, reject: Function) => {
if (opts.destruct) {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
(...args: any[]) => resolve(args),
(...args: any[]) => reject(args)
);
} else {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
}
rej = reject;
});
@ -147,13 +203,18 @@ function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
// to error
if (pluginResult && pluginResult.error) {
p.catch(() => { });
p.catch(() => {});
typeof rej === 'function' && rej(pluginResult.error);
}
return p;
}
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
function wrapOtherPromise(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
return getPromise((resolve: Function, reject: Function) => {
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
if (pluginResult) {
@ -168,14 +229,33 @@ function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts:
});
}
function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
function wrapObservable(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
) {
return new Observable(observer => {
let pluginResult;
if (opts.destruct) {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
(...args: any[]) => observer.next(args),
(...args: any[]) => observer.error(args)
);
} else {
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
pluginResult = callCordovaPlugin(
pluginObj,
methodName,
args,
opts,
observer.next.bind(observer),
observer.error.bind(observer)
);
}
if (pluginResult && pluginResult.error) {
@ -186,26 +266,45 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
try {
if (opts.clearFunction) {
if (opts.clearWithArgs) {
return callCordovaPlugin(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
return callCordovaPlugin(
pluginObj,
opts.clearFunction,
args,
opts,
observer.next.bind(observer),
observer.error.bind(observer)
);
}
return callCordovaPlugin(pluginObj, opts.clearFunction, []);
}
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
console.warn(
'Unable to clear the previous observable watch for',
pluginObj.constructor.getPluginName(),
methodName
);
console.warn(e);
}
};
});
}
function callInstance(pluginObj: any, methodName: string, args: any[], opts: any = {}, resolve?: Function, reject?: Function) {
function callInstance(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {},
resolve?: Function,
reject?: Function
) {
args = setIndex(args, opts, resolve, reject);
if (instanceAvailability(pluginObj, methodName)) {
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
return pluginObj._objectInstance[methodName].apply(
pluginObj._objectInstance,
args
);
}
}
/**
@ -215,7 +314,10 @@ function callInstance(pluginObj: any, methodName: string, args: any[], opts: any
* @param element The element to attach the event listener to
* @returns {Observable}
*/
export function wrapEventObservable(event: string, element: any = window): Observable<any> {
export function wrapEventObservable(
event: string,
element: any = window
): Observable<any> {
return Observable.fromEvent(element, event);
}
@ -227,28 +329,38 @@ export function wrapEventObservable(event: string, element: any = window): Obser
* does just this.
* @private
*/
export function overrideFunction(pluginObj: any, methodName: string, args: any[], opts: any = {}): Observable<any> {
export function overrideFunction(
pluginObj: any,
methodName: string,
args: any[],
opts: any = {}
): Observable<any> {
return new Observable(observer => {
const availabilityCheck = checkAvailability(pluginObj, null, pluginObj.constructor.getPluginName());
const availabilityCheck = checkAvailability(
pluginObj,
null,
pluginObj.constructor.getPluginName()
);
if (availabilityCheck === true) {
const pluginInstance = getPlugin(pluginObj.constructor.getPluginRef());
pluginInstance[methodName] = observer.next.bind(observer);
return () => pluginInstance[methodName] = () => { };
return () => (pluginInstance[methodName] = () => {});
} else {
observer.error(availabilityCheck);
observer.complete();
}
});
}
/**
* @private
*/
export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOptions = {}) {
export const wrap = function(
pluginObj: any,
methodName: string,
opts: CordovaOptions = {}
) {
return (...args: any[]) => {
if (opts.sync) {
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
@ -268,22 +380,36 @@ export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOp
/**
* @private
*/
export function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
export function wrapInstance(
pluginObj: any,
methodName: string,
opts: any = {}
) {
return (...args: any[]) => {
if (opts.sync) {
return callInstance(pluginObj, methodName, args, opts);
} else if (opts.observable) {
return new Observable(observer => {
let pluginResult;
if (opts.destruct) {
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => observer.next(args), (...args: any[]) => observer.error(args));
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
(...args: any[]) => observer.next(args),
(...args: any[]) => observer.error(args)
);
} else {
pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
observer.next.bind(observer),
observer.error.bind(observer)
);
}
if (pluginResult && pluginResult.error) {
@ -294,23 +420,47 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
return () => {
try {
if (opts.clearWithArgs) {
return callInstance(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
return callInstance(
pluginObj,
opts.clearFunction,
args,
opts,
observer.next.bind(observer),
observer.error.bind(observer)
);
}
return callInstance(pluginObj, opts.clearFunction, []);
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
console.warn(
'Unable to clear the previous observable watch for',
pluginObj.constructor.getPluginName(),
methodName
);
console.warn(e);
}
};
});
} else if (opts.otherPromise) {
return getPromise((resolve: Function, reject: Function) => {
let result;
if (opts.destruct) {
result = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
result = callInstance(
pluginObj,
methodName,
args,
opts,
(...args: any[]) => resolve(args),
(...args: any[]) => reject(args)
);
} else {
result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
result = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
}
if (result && !!result.then) {
result.then(resolve, reject);
@ -318,14 +468,27 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
reject();
}
});
} else {
let pluginResult: any, rej: Function;
const p = getPromise((resolve: Function, reject: Function) => {
if (opts.destruct) {
pluginResult = callInstance(pluginObj, methodName, args, opts, (...args: any[]) => resolve(args), (...args: any[]) => reject(args));
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
(...args: any[]) => resolve(args),
(...args: any[]) => reject(args)
);
} else {
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
pluginResult = callInstance(
pluginObj,
methodName,
args,
opts,
resolve,
reject
);
}
rej = reject;
});
@ -333,12 +496,10 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
// a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
// to error
if (pluginResult && pluginResult.error) {
p.catch(() => { });
p.catch(() => {});
typeof rej === 'function' && rej(pluginResult.error);
}
return p;
}
};
}

View File

@ -7,25 +7,27 @@ 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++) {
if (!obj) { return null; }
if (!obj) {
return null;
}
obj = obj[paths[i]];
}
return obj;
};
/**
* @private
*/
export const getPromise = (callback: Function): Promise<any> => {
const tryNativePromise = () => {
if (window.Promise) {
return new Promise((resolve, reject) => {
callback(resolve, reject);
});
} else {
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.');
console.error(
'No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.'
);
}
};
@ -44,14 +46,24 @@ export const getPlugin = (pluginRef: string): any => {
/**
* @private
*/
export const pluginWarn = (pluginName: string, plugin?: string, method?: string): void => {
export const pluginWarn = (
pluginName: string,
plugin?: string,
method?: string
): void => {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
console.warn(
`Native: tried calling ${pluginName}.${method}, but the ${pluginName} plugin is not installed.`
);
} else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed.');
console.warn(
`Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
}
if (plugin) {
console.warn('Install the ' + pluginName + ' plugin: \'ionic cordova plugin add ' + plugin + '\'');
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
}
};
@ -62,8 +74,12 @@ export const pluginWarn = (pluginName: string, plugin?: string, method?: string)
*/
export const cordovaWarn = (pluginName: string, method?: string): void => {
if (method) {
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
console.warn(
`Native: tried calling ${pluginName}.${method}, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator`
);
} else {
console.warn('Native: tried accessing the ' + pluginName + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
console.warn(
`Native: tried accessing the ${pluginName} plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator`
);
}
};

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ActionSheetOptions {
/**
* The labels for the buttons. Uses the index x
*/
@ -98,7 +97,6 @@ export interface ActionSheetOptions {
})
@Injectable()
export class ActionSheet extends IonicNativePlugin {
/**
* Convenience property to select an Android theme value
*/
@ -123,13 +121,16 @@ export class ActionSheet extends IonicNativePlugin {
* button pressed (1 based, so 1, 2, 3, etc.)
*/
@Cordova()
show(options?: ActionSheetOptions): Promise<number> { return; }
show(options?: ActionSheetOptions): Promise<number> {
return;
}
/**
* Progamtically hide the native ActionSheet
* @returns {Promise<any>} Returns a Promise that resolves when the actionsheet is closed
*/
@Cordova()
hide(options?: any): Promise<any> { return; }
hide(options?: any): Promise<any> {
return;
}
}

View File

@ -1,8 +1,9 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface AdMobFreeBannerConfig {
/**
* Ad Unit ID
@ -114,7 +115,6 @@ export interface AdMobFreeRewardVideoConfig {
})
@Injectable()
export class AdMobFree extends IonicNativePlugin {
/**
* Convenience object to get event names
* @type {Object}
@ -167,7 +167,6 @@ export class AdMobFree extends IonicNativePlugin {
* @type {AdMobFreeRewardVideo}
*/
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
}
/**
@ -176,46 +175,54 @@ export class AdMobFree extends IonicNativePlugin {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.banner',
pluginRef: 'admob.banner'
})
export class AdMobFreeBanner {
/**
* Update config.
* @param options
* @return {AdMobFreeBannerConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig { return; }
config(options: AdMobFreeBannerConfig): AdMobFreeBannerConfig {
return;
}
/**
* Hide the banner.
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
hide(): Promise<any> { return; }
hide(): Promise<any> {
return;
}
/**
* Create banner.
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
prepare(): Promise<any> {
return;
}
/**
* Remove the banner.
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
remove(): Promise<any> { return; }
remove(): Promise<any> {
return;
}
/**
* Show the banner.
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
show(): Promise<any> {
return;
}
}
/**
@ -224,39 +231,45 @@ export class AdMobFreeBanner {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.interstitial',
pluginRef: 'admob.interstitial'
})
export class AdMobFreeInterstitial {
/**
* Update config.
* @param options
* @return {AdMobFreeInterstitialConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig { return; }
config(options: AdMobFreeInterstitialConfig): AdMobFreeInterstitialConfig {
return;
}
/**
* Check if interstitial is ready
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
isReady(): Promise<any> { return; }
isReady(): Promise<any> {
return;
}
/**
* Prepare interstitial
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
prepare(): Promise<any> {
return;
}
/**
* Show the interstitial
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
show(): Promise<any> {
return;
}
}
/**
@ -265,37 +278,43 @@ export class AdMobFreeInterstitial {
@Plugin({
pluginName: 'AdMobFree',
plugin: 'cordova-plugin-admob-free',
pluginRef: 'admob.rewardvideo',
pluginRef: 'admob.rewardvideo'
})
export class AdMobFreeRewardVideo {
/**
* Update config.
* @param options
* @return {AdMobFreeRewardVideoConfig}
*/
@Cordova({ sync: true })
config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig { return; }
config(options: AdMobFreeRewardVideoConfig): AdMobFreeRewardVideoConfig {
return;
}
/**
* Check if reward video is ready
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
isReady(): Promise<any> { return; }
isReady(): Promise<any> {
return;
}
/**
* Prepare reward video
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
prepare(): Promise<any> {
return;
}
/**
* Show the reward video
* @return {Promise<any>}
*/
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
show(): Promise<any> {
return;
}
}

View File

@ -1,11 +1,17 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export type AdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
export type AdSize =
| 'SMART_BANNER'
| 'BANNER'
| 'MEDIUM_RECTANGLE'
| 'FULL_BANNER'
| 'LEADERBOARD'
| 'SKYSCRAPER'
| 'CUSTOM';
export interface AdMobOptions {
/**
* Banner ad ID
*/
@ -70,11 +76,9 @@ export interface AdMobOptions {
* License key for the plugin
*/
license?: any;
}
export interface AdExtras {
color_bg: string;
color_bg_top: string;
@ -86,7 +90,6 @@ export interface AdExtras {
color_text: string;
color_url: string;
}
/**
@ -134,7 +137,6 @@ export interface AdExtras {
})
@Injectable()
export class AdMobPro extends IonicNativePlugin {
AD_POSITION: {
NO_CHANGE: number;
TOP_LEFT: number;
@ -167,7 +169,9 @@ export class AdMobPro extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves when the banner is created
*/
@Cordova()
createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
createBanner(adIdOrOptions: string | AdMobOptions): Promise<any> {
return;
}
/**
* Destroy the banner, remove it from screen.
@ -175,7 +179,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
removeBanner(): void { }
removeBanner(): void {}
/**
* Show banner at position
@ -184,7 +188,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
showBanner(position: number): void { }
showBanner(position: number): void {}
/**
* Show banner at custom position
@ -194,7 +198,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
showBannerAtXY(x: number, y: number): void { }
showBannerAtXY(x: number, y: number): void {}
/**
* Hide the banner, remove it from screen, but can show it later
@ -202,7 +206,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
hideBanner(): void { }
hideBanner(): void {}
/**
* Prepare interstitial banner
@ -210,7 +214,9 @@ export class AdMobPro extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves when interstitial is prepared
*/
@Cordova()
prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
prepareInterstitial(adIdOrOptions: string | AdMobOptions): Promise<any> {
return;
}
/**
* Show interstitial ad when it's ready
@ -218,7 +224,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
showInterstitial(): void { }
showInterstitial(): void {}
/**
* Prepare a reward video ad
@ -226,7 +232,9 @@ export class AdMobPro extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves when the ad is prepared
*/
@Cordova()
prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> { return; }
prepareRewardVideoAd(adIdOrOptions: string | AdMobOptions): Promise<any> {
return;
}
/**
* Show a reward video ad
@ -234,7 +242,7 @@ export class AdMobPro extends IonicNativePlugin {
@Cordova({
sync: true
})
showRewardVideoAd(): void { }
showRewardVideoAd(): void {}
/**
* Sets the values for configuration and targeting
@ -242,14 +250,18 @@ export class AdMobPro extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves when the options have been set
*/
@Cordova()
setOptions(options: AdMobOptions): Promise<any> { return; }
setOptions(options: AdMobOptions): Promise<any> {
return;
}
/**
* Get user ad settings
* @returns {Promise<any>} Returns a promise that resolves with the ad settings
*/
@Cordova()
getAdSettings(): Promise<any> { return; }
getAdSettings(): Promise<any> {
return;
}
/**
* Triggered when failed to receive Ad
@ -260,7 +272,9 @@ export class AdMobPro extends IonicNativePlugin {
event: 'onAdFailLoad',
element: document
})
onAdFailLoad(): Observable<any> { return; }
onAdFailLoad(): Observable<any> {
return;
}
/**
* Triggered when Ad received
@ -271,7 +285,9 @@ export class AdMobPro extends IonicNativePlugin {
event: 'onAdLoaded',
element: document
})
onAdLoaded(): Observable<any> { return; }
onAdLoaded(): Observable<any> {
return;
}
/**
* Triggered when Ad will be showed on screen
@ -282,7 +298,9 @@ export class AdMobPro extends IonicNativePlugin {
event: 'onAdPresent',
element: document
})
onAdPresent(): Observable<any> { return; }
onAdPresent(): Observable<any> {
return;
}
/**
* Triggered when user click the Ad, and will jump out of your App
@ -293,7 +311,9 @@ export class AdMobPro extends IonicNativePlugin {
event: 'onAdLeaveApp',
element: document
})
onAdLeaveApp(): Observable<any> { return; }
onAdLeaveApp(): Observable<any> {
return;
}
/**
* Triggered when dismiss the Ad and back to your App
@ -304,6 +324,7 @@ export class AdMobPro extends IonicNativePlugin {
event: 'onAdDismiss',
element: document
})
onAdDismiss(): Observable<any> { return; }
onAdDismiss(): Observable<any> {
return;
}
}

View File

@ -1,7 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AlipayOrder {
/**
@ -101,7 +99,8 @@ export interface AlipayOrder {
plugin: 'cordova-alipay-base',
pluginRef: 'Alipay.Base',
repo: 'https://github.com/xueron/cordova-alipay-base',
install: 'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id',
install:
'ionic cordova plugin add cordova-alipay-base --variable ALI_PID=your_app_id',
installVariables: ['ALI_PID'],
platforms: ['Android', 'iOS']
})
@ -113,5 +112,7 @@ export class Alipay extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
*/
@Cordova()
pay(order: AlipayOrder | string): Promise<any> { return; }
pay(order: AlipayOrder | string): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export type AndroidExoPlayerAspectRatio = 'FILL_SCREEN' | 'FIT_SCREEN';
@ -187,14 +187,16 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @param parameters {AndroidExoPlayerParams} Parameters
* @return {Observable<AndroidExoplayerState>}
*/
@Cordova({
observable: true,
clearFunction: 'close',
clearWithArgs: false,
successIndex: 1,
errorIndex: 2
})
show(parameters: AndroidExoPlayerParams): Observable<AndroidExoplayerState> { return; }
@Cordova({
observable: true,
clearFunction: 'close',
clearWithArgs: false,
successIndex: 1,
errorIndex: 2
})
show(parameters: AndroidExoPlayerParams): Observable<AndroidExoplayerState> {
return;
}
/**
* Switch stream without disposing of the player.
@ -203,21 +205,30 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
setStream(url: string, controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
setStream(
url: string,
controller: AndroidExoPlayerControllerConfig
): Promise<void> {
return;
}
/**
* Will pause if playing and play if paused
* @return {Promise<void>}
*/
@Cordova()
playPause(): Promise<void> { return; }
playPause(): Promise<void> {
return;
}
/**
* Stop playing.
* @return {Promise<void>}
*/
@Cordova()
stop(): Promise<void> { return; }
stop(): Promise<void> {
return;
}
/**
* Jump to a particular position.
@ -225,7 +236,9 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
seekTo(milliseconds: number): Promise<void> { return; }
seekTo(milliseconds: number): Promise<void> {
return;
}
/**
* Jump to a particular time relative to the current position.
@ -233,28 +246,36 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
seekBy(milliseconds: number): Promise<void> { return; }
seekBy(milliseconds: number): Promise<void> {
return;
}
/**
* Get the current player state.
* @return {Promise<AndroidExoplayerState>}
*/
@Cordova()
getState(): Promise<AndroidExoplayerState> { return; }
getState(): Promise<AndroidExoplayerState> {
return;
}
/**
* Show the controller.
* @return {Promise<void>}
*/
@Cordova()
showController(): Promise<void> { return; }
showController(): Promise<void> {
return;
}
/**
* Hide the controller.
* @return {Promise<void>}
*/
@Cordova()
hideController(): Promise<void> { return; }
hideController(): Promise<void> {
return;
}
/**
* Update the controller configuration.
@ -262,12 +283,16 @@ export class AndroidExoplayer extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
setController(controller: AndroidExoPlayerControllerConfig): Promise<void> { return; }
setController(controller: AndroidExoPlayerControllerConfig): Promise<void> {
return;
}
/**
* Close and dispose of player, call before destroy.
* @return {Promise<void>}
*/
@Cordova()
close(): Promise<void> { return; }
close(): Promise<void> {
return;
}
}

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AFAAuthOptions {
/**
* Required
* Used as the alias for your key in the Android Key Store.
@ -62,7 +60,6 @@ export interface AFAAuthOptions {
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
*/
dialogHint?: string;
}
export interface AFADecryptOptions {
@ -149,26 +146,25 @@ export interface AFAEncryptResponse {
})
@Injectable()
export class AndroidFingerprintAuth extends IonicNativePlugin {
ERRORS: {
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION',
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION',
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED',
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED',
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR',
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE',
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED',
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST',
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION',
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED',
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION',
IO_EXCEPTION: 'IO_EXCEPTION',
JSON_EXCEPTION: 'JSON_EXCEPTION',
MINIMUM_SDK: 'MINIMUM_SDK',
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS',
MISSING_PARAMETERS: 'MISSING_PARAMETERS',
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION',
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION'
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION';
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION';
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED';
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED';
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR';
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE';
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED';
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST';
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION';
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED';
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION';
IO_EXCEPTION: 'IO_EXCEPTION';
JSON_EXCEPTION: 'JSON_EXCEPTION';
MINIMUM_SDK: 'MINIMUM_SDK';
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS';
MISSING_PARAMETERS: 'MISSING_PARAMETERS';
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION';
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION';
};
/**
@ -177,7 +173,9 @@ export class AndroidFingerprintAuth extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
encrypt(options: AFAAuthOptions): Promise<AFAEncryptResponse> { return; }
encrypt(options: AFAAuthOptions): Promise<AFAEncryptResponse> {
return;
}
/**
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
@ -185,19 +183,32 @@ export class AndroidFingerprintAuth extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
decrypt(options: AFAAuthOptions): Promise<AFADecryptOptions> { return; }
decrypt(options: AFAAuthOptions): Promise<AFADecryptOptions> {
return;
}
/**
* Check if service is available
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
*/
@Cordova()
isAvailable(): Promise<{ isAvailable: boolean, isHardwareDetected: boolean, hasEnrolledFingerprints: boolean }> { return; }
isAvailable(): Promise<{
isAvailable: boolean;
isHardwareDetected: boolean;
hasEnrolledFingerprints: boolean;
}> {
return;
}
/**
* Delete the cipher used for encryption and decryption by username
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted
*/
@Cordova()
delete(options: { clientId: string; username: string; }): Promise<{ deleted: boolean }> { return; }
delete(options: {
clientId: string;
username: string;
}): Promise<{ deleted: boolean }> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* Bit flag values for setSystemUiVisibility()
@ -62,63 +62,81 @@ export class AndroidFullScreen extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
isSupported(): Promise<void> { return; }
isSupported(): Promise<void> {
return;
}
/**
* Is immersive mode supported?
* @return {Promise<void>}
*/
@Cordova()
isImmersiveModeSupported(): Promise<void> { return; }
isImmersiveModeSupported(): Promise<void> {
return;
}
/**
* The width of the screen in immersive mode.
* @return {Promise<number>}
*/
@Cordova()
immersiveWidth(): Promise<number> { return; }
immersiveWidth(): Promise<number> {
return;
}
/**
* The height of the screen in immersive mode.
* @return {Promise<number>}
*/
@Cordova()
immersiveHeight(): Promise<number> { return; }
immersiveHeight(): Promise<number> {
return;
}
/**
* Hide system UI until user interacts.
* @return {Promise<void>}
*/
@Cordova()
leanMode(): Promise<void> { return; }
leanMode(): Promise<void> {
return;
}
/**
* Show system UI.
* @return {Promise<void>}
*/
@Cordova()
showSystemUI(): Promise<void> { return; }
showSystemUI(): Promise<void> {
return;
}
/**
* Extend your app underneath the status bar (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
showUnderStatusBar(): Promise<void> { return; }
showUnderStatusBar(): Promise<void> {
return;
}
/**
* Extend your app underneath the system UI (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
showUnderSystemUI(): Promise<void> { return; }
showUnderSystemUI(): Promise<void> {
return;
}
/**
* Hide system UI and keep it hidden (Android 4.4+ only).
* @return {Promise<void>}
*/
@Cordova()
immersiveMode(): Promise<void> { return; }
immersiveMode(): Promise<void> {
return;
}
/**
* Manually set the the system UI to a custom mode. This mirrors the Android method of the same name. (Android 4.4+ only).
@ -127,5 +145,7 @@ export class AndroidFullScreen extends IonicNativePlugin {
* @return {Promise<void>}
*/
@Cordova()
setSystemUiVisibility(visibility: AndroidSystemUiFlags): Promise<void> { return; }
setSystemUiVisibility(visibility: AndroidSystemUiFlags): Promise<void> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Android Permissions
@ -37,12 +37,12 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class AndroidPermissions extends IonicNativePlugin {
PERMISSION: any = {
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',
ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',
ACCESS_LOCATION_EXTRA_COMMANDS: 'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS',
ACCESS_LOCATION_EXTRA_COMMANDS:
'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS',
ACCESS_MOCK_LOCATION: 'android.permission.ACCESS_MOCK_LOCATION',
ACCESS_NETWORK_STATE: 'android.permission.ACCESS_NETWORK_STATE',
ACCESS_SURFACE_FLINGER: 'android.permission.ACCESS_SURFACE_FLINGER',
@ -53,12 +53,14 @@ export class AndroidPermissions extends IonicNativePlugin {
BATTERY_STATS: 'android.permission.BATTERY_STATS',
BIND_ACCESSIBILITY_SERVICE: 'android.permission.BIND_ACCESSIBILITY_SERVICE',
BIND_APPWIDGET: 'android.permission.BIND_APPWIDGET',
BIND_CARRIER_MESSAGING_SERVICE: 'android.permission.BIND_CARRIER_MESSAGING_SERVICE',
BIND_CARRIER_MESSAGING_SERVICE:
'android.permission.BIND_CARRIER_MESSAGING_SERVICE',
BIND_DEVICE_ADMIN: 'android.permission.BIND_DEVICE_ADMIN',
BIND_DREAM_SERVICE: 'android.permission.BIND_DREAM_SERVICE',
BIND_INPUT_METHOD: 'android.permission.BIND_INPUT_METHOD',
BIND_NFC_SERVICE: 'android.permission.BIND_NFC_SERVICE',
BIND_NOTIFICATION_LISTENER_SERVICE: 'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE',
BIND_NOTIFICATION_LISTENER_SERVICE:
'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE',
BIND_PRINT_SERVICE: 'android.permission.BIND_PRINT_SERVICE',
BIND_REMOTEVIEWS: 'android.permission.BIND_REMOTEVIEWS',
BIND_TEXT_SERVICE: 'android.permission.BIND_TEXT_SERVICE',
@ -79,12 +81,15 @@ export class AndroidPermissions extends IonicNativePlugin {
CALL_PRIVILEGED: 'android.permission.CALL_PRIVILEGED',
CAMERA: 'android.permission.CAMERA',
CAPTURE_AUDIO_OUTPUT: 'android.permission.CAPTURE_AUDIO_OUTPUT',
CAPTURE_SECURE_VIDEO_OUTPUT: 'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT',
CAPTURE_SECURE_VIDEO_OUTPUT:
'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT',
CAPTURE_VIDEO_OUTPUT: 'android.permission.CAPTURE_VIDEO_OUTPUT',
CHANGE_COMPONENT_ENABLED_STATE: 'android.permission.CHANGE_COMPONENT_ENABLED_STATE',
CHANGE_COMPONENT_ENABLED_STATE:
'android.permission.CHANGE_COMPONENT_ENABLED_STATE',
CHANGE_CONFIGURATION: 'android.permission.CHANGE_CONFIGURATION',
CHANGE_NETWORK_STATE: 'android.permission.CHANGE_NETWORK_STATE',
CHANGE_WIFI_MULTICAST_STATE: 'android.permission.CHANGE_WIFI_MULTICAST_STATE',
CHANGE_WIFI_MULTICAST_STATE:
'android.permission.CHANGE_WIFI_MULTICAST_STATE',
CHANGE_WIFI_STATE: 'android.permission.CHANGE_WIFI_STATE',
CLEAR_APP_CACHE: 'android.permission.CLEAR_APP_CACHE',
CLEAR_APP_USER_DATA: 'android.permission.CLEAR_APP_USER_DATA',
@ -130,7 +135,8 @@ export class AndroidPermissions extends IonicNativePlugin {
READ_CONTACTS: 'android.permission.READ_CONTACTS',
READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE',
READ_FRAME_BUFFER: 'android.permission.READ_FRAME_BUFFER',
READ_HISTORY_BOOKMARKS: 'com.android.browser.permission.READ_HISTORY_BOOKMARKS',
READ_HISTORY_BOOKMARKS:
'com.android.browser.permission.READ_HISTORY_BOOKMARKS',
READ_INPUT_STATE: 'android.permission.READ_INPUT_STATE',
READ_LOGS: 'android.permission.READ_LOGS',
READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE',
@ -164,7 +170,8 @@ export class AndroidPermissions extends IonicNativePlugin {
SET_TIME_ZONE: 'android.permission.SET_TIME_ZONE',
SET_WALLPAPER: 'android.permission.SET_WALLPAPER',
SET_WALLPAPER_HINTS: 'android.permission.SET_WALLPAPER_HINTS',
SIGNAL_PERSISTENT_PROCESSES: 'android.permission.SIGNAL_PERSISTENT_PROCESSES',
SIGNAL_PERSISTENT_PROCESSES:
'android.permission.SIGNAL_PERSISTENT_PROCESSES',
STATUS_BAR: 'android.permission.STATUS_BAR',
SUBSCRIBED_FEEDS_READ: 'android.permission.SUBSCRIBED_FEEDS_READ',
SUBSCRIBED_FEEDS_WRITE: 'android.permission.SUBSCRIBED_FEEDS_WRITE',
@ -182,7 +189,8 @@ export class AndroidPermissions extends IonicNativePlugin {
WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS',
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
WRITE_GSERVICES: 'android.permission.WRITE_GSERVICES',
WRITE_HISTORY_BOOKMARKS: 'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS',
WRITE_HISTORY_BOOKMARKS:
'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS',
WRITE_PROFILE: 'android.permission.WRITE_PROFILE',
WRITE_SECURE_SETTINGS: 'android.permission.WRITE_SECURE_SETTINGS',
WRITE_SETTINGS: 'android.permission.WRITE_SETTINGS',
@ -190,7 +198,7 @@ export class AndroidPermissions extends IonicNativePlugin {
WRITE_SOCIAL_STREAM: 'android.permission.WRITE_SOCIAL_STREAM',
WRITE_SYNC_SETTINGS: 'android.permission.WRITE_SYNC_SETTINGS',
WRITE_USER_DICTIONARY: 'android.permission.WRITE_USER_DICTIONARY',
WRITE_VOICEMAIL: 'com.android.voicemail.permission.WRITE_VOICEMAIL',
WRITE_VOICEMAIL: 'com.android.voicemail.permission.WRITE_VOICEMAIL'
};
/**
@ -199,7 +207,9 @@ export class AndroidPermissions extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
checkPermission(permission: string): Promise<any> { return; }
checkPermission(permission: string): Promise<any> {
return;
}
/**
* Request permission
@ -207,7 +217,9 @@ export class AndroidPermissions extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
requestPermission(permission: string): Promise<any> { return; }
requestPermission(permission: string): Promise<any> {
return;
}
/**
* Request permissions
@ -215,7 +227,9 @@ export class AndroidPermissions extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
requestPermissions(permissions: string[]): Promise<any> { return; }
requestPermissions(permissions: string[]): Promise<any> {
return;
}
/**
* This function still works now, will not support in the future.
@ -223,6 +237,7 @@ export class AndroidPermissions extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
hasPermission(permission: string): Promise<any> { return; }
hasPermission(permission: string): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name App Availability
@ -41,13 +41,13 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class AppAvailability extends IonicNativePlugin {
/**
* Checks if an app is available on device
* @param {string} app Package name on android, or URI scheme on iOS
* @returns {Promise<boolean>}
*/
@Cordova()
check(app: string): Promise<boolean> { return; }
check(app: string): Promise<boolean> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name App Minimize
@ -31,12 +31,12 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class AppMinimize extends IonicNativePlugin {
/**
* Minimizes the application
* @return {Promise<any>}
*/
@Cordova()
minimize(): Promise<any> { return; }
minimize(): Promise<any> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* @name App Preferences
@ -25,11 +25,18 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-app-preferences',
pluginRef: 'plugins.appPreferences',
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'macOS', 'Windows 8', 'Windows Phone']
platforms: [
'Android',
'BlackBerry 10',
'Browser',
'iOS',
'macOS',
'Windows 8',
'Windows Phone'
]
})
@Injectable()
export class AppPreferences extends IonicNativePlugin {
/**
* Get a preference value
*
@ -40,7 +47,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
fetch(dict: string, key?: string): Promise<any> { return; }
fetch(dict: string, key?: string): Promise<any> {
return;
}
/**
* Set a preference value
@ -67,7 +76,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
remove(dict: string, key?: string): Promise<any> { return; }
remove(dict: string, key?: string): Promise<any> {
return;
}
/**
* Clear preferences
@ -77,7 +88,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
clearAll(): Promise<any> { return; }
clearAll(): Promise<any> {
return;
}
/**
* Show native preferences interface
@ -87,7 +100,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
show(): Promise<any> { return; }
show(): Promise<any> {
return;
}
/**
* Show native preferences interface
@ -98,7 +113,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
observable: true
})
watch(subscribe: boolean): Observable<any> { return; }
watch(subscribe: boolean): Observable<any> {
return;
}
/**
* Return named configuration context
@ -111,13 +128,17 @@ export class AppPreferences extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
suite(suiteName: string): any { return; }
suite(suiteName: string): any {
return;
}
@Cordova({
platforms: ['iOS'],
sync: true
})
iosSuite(suiteName: string): any { return; }
iosSuite(suiteName: string): any {
return;
}
/**
* Return cloud synchronized configuration context
@ -127,7 +148,9 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
platforms: ['iOS', 'Windows', 'Windows Phone 8']
})
cloudSync(): Object { return; }
cloudSync(): Object {
return;
}
/**
* Return default configuration context
@ -137,6 +160,7 @@ export class AppPreferences extends IonicNativePlugin {
@Cordova({
platforms: ['iOS', 'Windows', 'Windows Phone 8']
})
defaults(): Object { return; }
defaults(): Object {
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';
export interface AppRatePreferences {
/**

View File

@ -1,7 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name App Version
@ -35,33 +33,39 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class AppVersion extends IonicNativePlugin {
/**
* Returns the name of the app
* @returns {Promise<string>}
*/
@Cordova()
getAppName(): Promise<string> { return; }
getAppName(): Promise<string> {
return;
}
/**
* Returns the package name of the app
* @returns {Promise<string>}
*/
@Cordova()
getPackageName(): Promise<string> { return; }
getPackageName(): Promise<string> {
return;
}
/**
* Returns the build identifier of the app
* @returns {Promise<string>}
*/
@Cordova()
getVersionCode(): Promise<string> { return; }
getVersionCode(): Promise<string> {
return;
}
/**
* Returns the version of the app
* @returns {Promise<string>}
*/
@Cordova()
getVersionNumber(): Promise<string> { return; }
getVersionNumber(): Promise<string> {
return;
}
}

View File

@ -1,17 +1,32 @@
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {
Plugin,
Cordova,
IonicNativePlugin
} from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export type IMakePayments = 'This device can make payments and has a supported card' | 'This device cannot make payments.' | 'This device can make payments but has no supported cards';
export type IMakePayments =
| 'This device can make payments and has a supported card'
| 'This device cannot make payments.'
| 'This device can make payments but has no supported cards';
export type IShippingType = 'shipping' | 'delivery' | 'store' | 'service';
export type IBillingRequirement = 'none' | 'all' | 'postcode' | 'name' | 'email' | 'phone';
export type ITransactionStatus = 'success' | 'failure' | 'invalid-billing-address' | 'invalid-shipping-address' | 'invalid-shipping-contact' | 'require-pin' | 'incorrect-pin' | 'locked-pin';
export type IBillingRequirement =
| 'none'
| 'all'
| 'postcode'
| 'name'
| 'email'
| 'phone';
export type ITransactionStatus =
| 'success'
| 'failure'
| 'invalid-billing-address'
| 'invalid-shipping-address'
| 'invalid-shipping-contact'
| 'require-pin'
| 'incorrect-pin'
| 'locked-pin';
export type ICompleteTransaction = 'Payment status applied.';
export type IUpdateItemsAndShippingStatus = 'Updated List Info' | 'Did you make a payment request?';
export type IUpdateItemsAndShippingStatus =
| 'Updated List Info'
| 'Did you make a payment request?';
export interface IPaymentResponse {
billingNameFirst?: string;
@ -50,7 +65,7 @@ export interface IOrderItem {
label: string;
amount: number;
}
export interface IShippingMethod {
export interface IShippingMethod {
identifier: string;
label: string;
detail: string;
@ -135,11 +150,10 @@ export interface ISelectedShippingContact {
plugin: 'cordova-plugin-applepay',
pluginRef: 'ApplePay',
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
platforms: ['iOS'],
platforms: ['iOS']
})
@Injectable()
export class ApplePay extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Pay and has any capable cards registered.
* @return {Promise<IMakePayments>} Returns a promise
@ -174,7 +188,9 @@ export class ApplePay extends IonicNativePlugin {
observable: true,
clearFunction: 'stopListeningForShippingContactSelection'
})
startListeningForShippingContactSelection(): Observable<ISelectedShippingContact> {
startListeningForShippingContactSelection(): Observable<
ISelectedShippingContact
> {
return;
}
@ -228,7 +244,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
updateItemsAndShippingMethods(list: IOrderItemsAndShippingMethods): Promise<IUpdateItemsAndShippingStatus> {
updateItemsAndShippingMethods(
list: IOrderItemsAndShippingMethods
): Promise<IUpdateItemsAndShippingStatus> {
return;
}
@ -321,7 +339,9 @@ export class ApplePay extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
completeLastTransaction(complete: ITransactionStatus): Promise<ICompleteTransaction> {
completeLastTransaction(
complete: ITransactionStatus
): Promise<ICompleteTransaction> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name Appodeal
@ -46,14 +46,16 @@ export class Appodeal extends IonicNativePlugin {
* @param {number} adType
*/
@Cordova()
initialize(appKey: string, adType: number): void { };
initialize(appKey: string, adType: number): void {}
/**
* check if SDK has been initialized
* @returns {Promise<boolean>}
*/
@Cordova()
isInitialized(): Promise<any> { return; };
isInitialized(): Promise<any> {
return;
}
/**
* show ad of specified type
@ -61,7 +63,9 @@ export class Appodeal extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
show(adType: number): Promise<any> { return; };
show(adType: number): Promise<any> {
return;
}
/**
* show ad of specified type with placement options
@ -70,24 +74,23 @@ export class Appodeal extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
showWithPlacement(
adType: number,
placement: any
): Promise<any> { return; };
showWithPlacement(adType: number, placement: any): Promise<any> {
return;
}
/**
* hide ad of specified type
* @param {number} adType
*/
@Cordova()
hide(adType: number): void { };
hide(adType: number): void {}
/**
* confirm use of ads of specified type
* @param {number} adType
*/
@Cordova()
confirm(adType: number): void { };
confirm(adType: number): void {}
/**
* check if ad of specified type has been loaded
@ -95,7 +98,9 @@ export class Appodeal extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
isLoaded(adType: number): Promise<any> { return; };
isLoaded(adType: number): Promise<any> {
return;
}
/**
* check if ad of specified
@ -103,7 +108,9 @@ export class Appodeal extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
isPrecache(adType: number): Promise<any> { return; };
isPrecache(adType: number): Promise<any> {
return;
}
/**
*
@ -111,75 +118,77 @@ export class Appodeal extends IonicNativePlugin {
* @param autoCache
*/
@Cordova()
setAutoCache(adType: number, autoCache: any): void { };
setAutoCache(adType: number, autoCache: any): void {}
/**
* forcefully cache an ad by type
* @param {number} adType
*/
@Cordova()
cache(adType: number): void { };
cache(adType: number): void {}
/**
*
* @param {boolean} set
*/
@Cordova()
setOnLoadedTriggerBoth(set: boolean): void { };
setOnLoadedTriggerBoth(set: boolean): void {}
/**
* enable or disable Smart Banners
* @param {boolean} enabled
*/
@Cordova()
setSmartBanners(enabled: boolean): void { };
setSmartBanners(enabled: boolean): void {}
/**
* enable or disable banner backgrounds
* @param {boolean} enabled
*/
@Cordova()
setBannerBackground(enabled: boolean): void { };
setBannerBackground(enabled: boolean): void {}
/**
* enable or disable banner animations
* @param {boolean} enabled
*/
@Cordova()
setBannerAnimation(enabled: boolean): void { };
setBannerAnimation(enabled: boolean): void {}
/**
*
* @param value
*/
@Cordova()
set728x90Banners(value: any): void { };
set728x90Banners(value: any): void {}
/**
* enable or disable logging
* @param {boolean} logging
*/
@Cordova()
setLogging(logging: boolean): void { };
setLogging(logging: boolean): void {}
/**
* enable or disable testing mode
* @param {boolean} testing
*/
@Cordova()
setTesting(testing: boolean): void { };
setTesting(testing: boolean): void {}
/**
* reset device ID
*/
@Cordova()
resetUUID(): void { };
resetUUID(): void {}
/**
* get version of Appdeal SDK
*/
@Cordova()
getVersion(): Promise<any> { return; };
getVersion(): Promise<any> {
return;
}
/**
*
@ -187,7 +196,7 @@ export class Appodeal extends IonicNativePlugin {
* @param {number} adType
*/
@Cordova()
disableNetwork(network?: string, adType?: number): void { };
disableNetwork(network?: string, adType?: number): void {}
/**
*
@ -195,54 +204,54 @@ export class Appodeal extends IonicNativePlugin {
* @param {number} adType
*/
@Cordova()
disableNetworkType(network?: string, adType?: number): void { };
disableNetworkType(network?: string, adType?: number): void {}
/**
* disable Location permissions for Appodeal SDK
*/
@Cordova()
disableLocationPermissionCheck(): void { };
disableLocationPermissionCheck(): void {}
/**
* disable Storage permissions for Appodeal SDK
*/
@Cordova()
disableWriteExternalStoragePermissionCheck(): void { };
disableWriteExternalStoragePermissionCheck(): void {}
/**
* enable event listeners
* @param {boolean} enabled
*/
@Cordova()
enableInterstitialCallbacks(enabled: boolean): void { };
enableInterstitialCallbacks(enabled: boolean): void {}
/**
* enable event listeners
* @param {boolean} enabled
*/
@Cordova()
enableSkippableVideoCallbacks(enabled: boolean): void { };
enableSkippableVideoCallbacks(enabled: boolean): void {}
/**
* enable event listeners
* @param {boolean} enabled
*/
@Cordova()
enableNonSkippableVideoCallbacks(enabled: boolean): void { };
enableNonSkippableVideoCallbacks(enabled: boolean): void {}
/**
* enable event listeners
* @param {boolean} enabled
*/
@Cordova()
enableBannerCallbacks(enabled: boolean): void { };
enableBannerCallbacks(enabled: boolean): void {}
/**
* enable event listeners
* @param {boolean} enabled
*/
@Cordova()
enableRewardedVideoCallbacks(enabled: boolean): void { };
enableRewardedVideoCallbacks(enabled: boolean): void {}
/**
*
@ -250,7 +259,7 @@ export class Appodeal extends IonicNativePlugin {
* @param {boolean} value
*/
@Cordova()
setCustomBooleanRule(name: string, value: boolean): void { };
setCustomBooleanRule(name: string, value: boolean): void {}
/**
*
@ -258,7 +267,7 @@ export class Appodeal extends IonicNativePlugin {
* @param {number} value
*/
@Cordova()
setCustomIntegerRule(name: string, value: number): void { };
setCustomIntegerRule(name: string, value: number): void {}
/**
* set rule with float value
@ -266,7 +275,7 @@ export class Appodeal extends IonicNativePlugin {
* @param {number} value
*/
@Cordova()
setCustomDoubleRule(name: string, value: number): void { };
setCustomDoubleRule(name: string, value: number): void {}
/**
* set rule with string value
@ -274,243 +283,291 @@ export class Appodeal extends IonicNativePlugin {
* @param {string} value
*/
@Cordova()
setCustomStringRule(name: string, value: string): void { };
setCustomStringRule(name: string, value: string): void {}
/**
* set ID preference in Appodeal for current user
* @param id
*/
@Cordova()
setUserId(id: any): void { };
setUserId(id: any): void {}
/**
* set Email preference in Appodeal for current user
* @param email
*/
@Cordova()
setEmail(email: any): void { };
setEmail(email: any): void {}
/**
* set Birthday preference in Appodeal for current user
* @param birthday
*/
@Cordova()
setBirthday(birthday: any): void { };
setBirthday(birthday: any): void {}
/**
* et Age preference in Appodeal for current user
* @param age
*/
@Cordova()
setAge(age: any): void { };
setAge(age: any): void {}
/**
* set Gender preference in Appodeal for current user
* @param gender
*/
@Cordova()
setGender(gender: any): void { };
setGender(gender: any): void {}
/**
* set Occupation preference in Appodeal for current user
* @param occupation
*/
@Cordova()
setOccupation(occupation: any): void { };
setOccupation(occupation: any): void {}
/**
* set Relation preference in Appodeal for current user
* @param relation
*/
@Cordova()
setRelation(relation: any): void { };
setRelation(relation: any): void {}
/**
* set Smoking preference in Appodeal for current user
* @param smoking
*/
@Cordova()
setSmoking(smoking: any): void { };
setSmoking(smoking: any): void {}
/**
* set Alcohol preference in Appodeal for current user
* @param alcohol
*/
@Cordova()
setAlcohol(alcohol: any): void { };
setAlcohol(alcohol: any): void {}
/**
* set Interests preference in Appodeal for current user
* @param interests
*/
@Cordova()
setInterests(interests: any): void { };
setInterests(interests: any): void {}
@Cordova({
eventObservable: true,
event: 'onInterstitialLoaded',
element: document
})
onInterstitialLoaded(): Observable<any> { return; }
onInterstitialLoaded(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onInterstitialFailedToLoad',
element: document
})
onInterstitialFailedToLoad(): Observable<any> { return; }
onInterstitialFailedToLoad(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onInterstitialShown',
element: document
})
onInterstitialShown(): Observable<any> { return; }
onInterstitialShown(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onInterstitialClicked',
element: document
})
onInterstitialClicked(): Observable<any> { return; }
onInterstitialClicked(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onInterstitialClosed',
element: document
})
onInterstitialClosed(): Observable<any> { return; }
onInterstitialClosed(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onSkippableVideoLoaded',
element: document
})
onSkippableVideoLoaded(): Observable<any> { return; }
onSkippableVideoLoaded(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onSkippableVideoFailedToLoad',
element: document
})
onSkippableVideoFailedToLoad(): Observable<any> { return; }
onSkippableVideoFailedToLoad(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onSkippableVideoShown',
element: document
})
onSkippableVideoShown(): Observable<any> { return; }
onSkippableVideoShown(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onSkippableVideoFinished',
element: document
})
onSkippableVideoFinished(): Observable<any> { return; }
onSkippableVideoFinished(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onSkippableVideoClosed',
element: document
})
onSkippableVideoClosed(): Observable<any> { return; }
onSkippableVideoClosed(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onRewardedVideoLoaded',
element: document
})
onRewardedVideoLoaded(): Observable<any> { return; }
onRewardedVideoLoaded(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onRewardedVideoFailedToLoad',
element: document
})
onRewardedVideoFailedToLoad(): Observable<any> { return; }
onRewardedVideoFailedToLoad(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onRewardedVideoShown',
element: document
})
onRewardedVideoShown(): Observable<any> { return; }
onRewardedVideoShown(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onRewardedVideoFinished',
element: document
})
onRewardedVideoFinished(): Observable<any> { return; }
onRewardedVideoFinished(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onRewardedVideoClosed',
element: document
})
onRewardedVideoClosed(): Observable<any> { return; }
onRewardedVideoClosed(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onNonSkippableVideoLoaded',
element: document
})
onNonSkippableVideoLoaded(): Observable<any> { return; }
onNonSkippableVideoLoaded(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onNonSkippableVideoFailedToLoad',
element: document
})
onNonSkippableVideoFailedToLoad(): Observable<any> { return; }
onNonSkippableVideoFailedToLoad(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onNonSkippableVideoShown',
element: document
})
onNonSkippableVideoShown(): Observable<any> { return; }
onNonSkippableVideoShown(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onNonSkippableVideoFinished',
element: document
})
onNonSkippableVideoFinished(): Observable<any> { return; }
onNonSkippableVideoFinished(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onNonSkippableVideoClosed',
element: document
})
onNonSkippableVideoClosed(): Observable<any> { return; }
onNonSkippableVideoClosed(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onBannerClicked',
element: document
})
onBannerClicked(): Observable<any> { return; }
onBannerClicked(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onBannerFailedToLoad',
element: document
})
onBannerFailedToLoad(): Observable<any> { return; }
onBannerFailedToLoad(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onBannerLoaded',
element: document
})
onBannerLoaded(): Observable<any> { return; }
onBannerLoaded(): Observable<any> {
return;
}
@Cordova({
eventObservable: true,
event: 'onBannerShown',
element: document
})
onBannerShown(): Observable<any> { return; }
onBannerShown(): Observable<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Autostart
@ -31,17 +31,15 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class Autostart extends IonicNativePlugin {
/**
* Enable the automatic startup after the boot
*/
@Cordova({ sync: true })
enable(): void { }
enable(): void {}
/**
* Disable the automatic startup after the boot
*/
@Cordova({ sync: true })
disable(): void { }
disable(): void {}
}

View File

@ -1,15 +1,13 @@
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface BackgroundFetchConfig {
/**
* Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
*/
stopOnTerminate?: boolean;
}
/**
* @name Background Fetch
* @description
@ -61,8 +59,6 @@ export interface BackgroundFetchConfig {
})
@Injectable()
export class BackgroundFetch extends IonicNativePlugin {
/**
* Configures the plugin's fetch callbackFn
*
@ -72,7 +68,9 @@ export class BackgroundFetch extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
configure(config: BackgroundFetchConfig): Promise<any> { return; }
configure(config: BackgroundFetchConfig): Promise<any> {
return;
}
/**
* Start the background-fetch API.
@ -80,14 +78,18 @@ export class BackgroundFetch extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
start(): Promise<any> { return; }
start(): Promise<any> {
return;
}
/**
* Stop the background-fetch API from firing fetch events. Your callbackFn provided to #configure will no longer be executed.
* @returns {Promise<any>}
*/
@Cordova()
stop(): Promise<any> { return; }
stop(): Promise<any> {
return;
}
/**
* You MUST call this method in your fetch callbackFn provided to #configure in order to signal to iOS that your fetch action is complete. iOS provides only 30s of background-time for a fetch-event -- if you exceed this 30s, iOS will kill your app.
@ -95,13 +97,14 @@ export class BackgroundFetch extends IonicNativePlugin {
@Cordova({
sync: true
})
finish(): void { }
finish(): void {}
/**
* Return the status of the background-fetch
* @returns {Promise<any>}
*/
@Cordova()
status(): Promise<any> { return; }
status(): Promise<any> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } 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.
@ -464,7 +481,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
watchLocationMode(): Promise<boolean> { return; }
watchLocationMode(): Promise<boolean> {
return;
}
/**
* Stop watching for location mode changes.
@ -473,7 +492,9 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
stopWatchingLocationMode(): Promise<any> { return; }
stopWatchingLocationMode(): Promise<any> {
return;
}
/**
* Method will return all stored locations.
@ -487,14 +508,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.
@ -504,7 +529,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.
@ -513,17 +540,19 @@ 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>}
@ -531,16 +560,19 @@ export class BackgroundGeolocation extends IonicNativePlugin {
@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

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @beta
@ -33,19 +32,21 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Backlight extends IonicNativePlugin {
/**
* This function turns backlight on
* @return {Promise<any>} Returns a promise that resolves when the backlight is on
*/
@Cordova()
on(): Promise<any> { return; }
on(): Promise<any> {
return;
}
/**
* This function turns backlight off
* @return {Promise<any>} Returns a promise that resolves when the backlight is off
*/
@Cordova()
off(): Promise<any> { return; }
off(): Promise<any> {
return;
}
}

View File

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

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @beta
@ -33,13 +33,13 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Base64 extends IonicNativePlugin {
/**
* This function encodes base64 of any file
* @param {string} filePath Absolute file path
* @return {Promise<string>} Returns a promise that resolves when the file is successfully encoded
*/
@Cordova()
encodeFile(filePath: string): Promise<string> { return; }
encodeFile(filePath: string): Promise<string> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@ -39,7 +39,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class BluetoothSerial extends IonicNativePlugin {
/**
* Connect to a Bluetooth device
* @param {string} macAddress_or_uuid Identifier of the remote device
@ -50,7 +49,9 @@ export class BluetoothSerial extends IonicNativePlugin {
observable: true,
clearFunction: 'disconnect'
})
connect(macAddress_or_uuid: string): Observable<any> { return; }
connect(macAddress_or_uuid: string): Observable<any> {
return;
}
/**
* Connect insecurely to a Bluetooth device
@ -62,14 +63,18 @@ export class BluetoothSerial extends IonicNativePlugin {
observable: true,
clearFunction: 'disconnect'
})
connectInsecure(macAddress: string): Observable<any> { return; }
connectInsecure(macAddress: string): Observable<any> {
return;
}
/**
* Disconnect from the connected device
* @returns {Promise<any>}
*/
@Cordova()
disconnect(): Promise<any> { return; }
disconnect(): Promise<any> {
return;
}
/**
* Writes data to the serial port
@ -79,7 +84,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
write(data: any): Promise<any> { return; }
write(data: any): Promise<any> {
return;
}
/**
* Gets the number of bytes of data available
@ -87,7 +94,10 @@ export class BluetoothSerial extends IonicNativePlugin {
*/
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
}) available(): Promise<any> { return; }
})
available(): Promise<any> {
return;
}
/**
* Reads data from the buffer
@ -96,7 +106,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
read(): Promise<any> { return; }
read(): Promise<any> {
return;
}
/**
* Reads data from the buffer until it reaches a delimiter
@ -106,7 +118,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
readUntil(delimiter: string): Promise<any> { return; }
readUntil(delimiter: string): Promise<any> {
return;
}
/**
* Subscribe to be notified when data is received
@ -118,7 +132,9 @@ export class BluetoothSerial extends IonicNativePlugin {
observable: true,
clearFunction: 'unsubscribe'
})
subscribe(delimiter: string): Observable<any> { return; }
subscribe(delimiter: string): Observable<any> {
return;
}
/**
* Subscribe to be notified when data is received
@ -129,7 +145,9 @@ export class BluetoothSerial extends IonicNativePlugin {
observable: true,
clearFunction: 'unsubscribeRawData'
})
subscribeRawData(): Observable<any> { return; }
subscribeRawData(): Observable<any> {
return;
}
/**
* Clears data in buffer
@ -138,7 +156,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
clear(): Promise<any> { return; }
clear(): Promise<any> {
return;
}
/**
* Lists bonded devices
@ -147,7 +167,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
list(): Promise<any> { return; }
list(): Promise<any> {
return;
}
/**
* Reports if bluetooth is enabled
@ -156,7 +178,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
isEnabled(): Promise<any> { return; }
isEnabled(): Promise<any> {
return;
}
/**
* Reports the connection status
@ -165,7 +189,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
isConnected(): Promise<any> { return; }
isConnected(): Promise<any> {
return;
}
/**
* Reads the RSSI from the connected peripheral
@ -174,7 +200,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
readRSSI(): Promise<any> { return; }
readRSSI(): Promise<any> {
return;
}
/**
* Show the Bluetooth settings on the device
@ -183,7 +211,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
showBluetoothSettings(): Promise<any> { return; }
showBluetoothSettings(): Promise<any> {
return;
}
/**
* Enable Bluetooth on the device
@ -192,7 +222,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
enable(): Promise<any> { return; }
enable(): Promise<any> {
return;
}
/**
* Discover unpaired devices
@ -201,7 +233,9 @@ export class BluetoothSerial extends IonicNativePlugin {
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
})
discoverUnpaired(): Promise<any> { return; }
discoverUnpaired(): Promise<any> {
return;
}
/**
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
@ -212,7 +246,9 @@ export class BluetoothSerial extends IonicNativePlugin {
observable: true,
clearFunction: 'clearDeviceDiscoveredListener'
})
setDeviceDiscoveredListener(): Observable<any> { return; }
setDeviceDiscoveredListener(): Observable<any> {
return;
}
/**
* Sets the human readable device name that is broadcasted to other devices
@ -222,7 +258,7 @@ export class BluetoothSerial extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
setName(newName: string): void { }
setName(newName: string): void {}
/**
* Makes the device discoverable by other devices
@ -232,6 +268,5 @@ export class BluetoothSerial extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
setDiscoverable(discoverableDuration: number): void { }
setDiscoverable(discoverableDuration: number): void {}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* Options for the setupApplePay method.
@ -116,8 +116,7 @@ export interface PaymentUIResult {
/**
* Information about the Apple Pay card used to complete a payment (if Apple Pay was used).
*/
applePaycard: {
};
applePaycard: {};
/**
* Information about 3D Secure card used to complete a payment (if 3D Secure was used).
@ -201,12 +200,12 @@ export interface PaymentUIResult {
pluginRef: 'BraintreePlugin',
repo: 'https://github.com/taracque/cordova-plugin-braintree',
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add https://github.com/taracque/cordova-plugin-braintree',
installVariables: [],
install:
'ionic cordova plugin add https://github.com/taracque/cordova-plugin-braintree',
installVariables: []
})
@Injectable()
export class Braintree extends IonicNativePlugin {
/**
* Used to initialize the Braintree client. This function must be called before other methods can be used.
* As the initialize code is async, be sure you call all Braintree related methods after the initialize promise has resolved.
@ -215,9 +214,11 @@ export class Braintree extends IonicNativePlugin {
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
*/
@Cordova({
platforms: ['Android', 'iOS'],
platforms: ['Android', 'iOS']
})
initialize(token: string): Promise<undefined | string> { return; }
initialize(token: string): Promise<undefined | string> {
return;
}
/**
* Used to configure Apple Pay on iOS.
@ -232,9 +233,11 @@ export class Braintree extends IonicNativePlugin {
* @return {Promise<undefined | string>} Returns a promise that resolves with undefined on successful initialization, or rejects with a string message describing the failure.
*/
@Cordova({
platforms: ['iOS'],
platforms: ['iOS']
})
setupApplePay(options: ApplePayOptions): Promise<undefined | string> { return; }
setupApplePay(options: ApplePayOptions): Promise<undefined | string> {
return;
}
/**
* Shows Braintree's Drop-In Payments UI.
@ -244,7 +247,11 @@ export class Braintree extends IonicNativePlugin {
* @return {Promise<PaymentUIResult | string>} Returns a promise that resolves with a PaymentUIResult object on successful payment (or the user cancels), or rejects with a string message describing the failure.
*/
@Cordova({
platforms: ['Android', 'iOS'],
platforms: ['Android', 'iOS']
})
presentDropInPaymentUI(options?: PaymentUIOptions): Promise<PaymentUIResult | string> { return; }
presentDropInPaymentUI(
options?: PaymentUIOptions
): Promise<PaymentUIResult | string> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@ -32,7 +32,6 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class Broadcaster extends IonicNativePlugin {
/**
* This function listen to an event sent from the native code
* @param eventName {string}
@ -43,7 +42,9 @@ export class Broadcaster extends IonicNativePlugin {
clearFunction: 'removeEventListener',
clearWithArgs: true
})
addEventListener(eventName: string): Observable<any> { return; }
addEventListener(eventName: string): Observable<any> {
return;
}
/**
* This function sends data to the native code
@ -52,6 +53,7 @@ export class Broadcaster extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when an event is successfully fired
*/
@Cordova()
fireNativeEvent(eventName: string, eventData: any): Promise<any> { return; }
fireNativeEvent(eventName: string, eventData: any): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Browser Tab
@ -41,13 +41,14 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class BrowserTab extends IonicNativePlugin {
/**
* Check if BrowserTab option is available
* @return {Promise<any>} Returns a promise that resolves when check is successful and returns true or false
*/
@Cordova()
isAvailable(): Promise<any> { return; }
isAvailable(): Promise<any> {
return;
}
/**
* Opens the provided URL using a browser tab
@ -55,12 +56,16 @@ export class BrowserTab extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when check open was successful
*/
@Cordova()
openUrl(url: string): Promise<any> { return; }
openUrl(url: string): Promise<any> {
return;
}
/**
* Closes browser tab
* @return {Promise<any>} Returns a promise that resolves when close was finished
*/
@Cordova()
close(): Promise<any> { return; }
close(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CameraPreviewDimensions {
/** The width of the camera preview, default to window.screen.width */
@ -131,12 +131,12 @@ export interface CameraPreviewPictureOptions {
pluginName: 'CameraPreview',
plugin: 'cordova-plugin-camera-preview',
pluginRef: 'CameraPreview',
repo: 'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
repo:
'https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview',
platforms: ['Android', 'iOS']
})
@Injectable()
export class CameraPreview extends IonicNativePlugin {
FOCUS_MODE = {
FIXED: 'fixed',
AUTO: 'auto',
@ -189,35 +189,45 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
startCamera(options: CameraPreviewOptions): Promise<any> { return; }
startCamera(options: CameraPreviewOptions): Promise<any> {
return;
}
/**
* Stops the camera preview instance. (iOS & Android)
* @return {Promise<any>}
*/
@Cordova()
stopCamera(): Promise<any> { return; }
stopCamera(): Promise<any> {
return;
}
/**
* Switch from the rear camera and front camera, if available.
* @return {Promise<any>}
*/
@Cordova()
switchCamera(): Promise<any> { return; }
switchCamera(): Promise<any> {
return;
}
/**
* Hide the camera preview box.
* @return {Promise<any>}
*/
@Cordova()
hide(): Promise<any> { return; }
hide(): Promise<any> {
return;
}
/**
* Show the camera preview box.
* @return {Promise<any>}
*/
@Cordova()
show(): Promise<any> { return; }
show(): Promise<any> {
return;
}
/**
* Take the picture (base64)
@ -228,7 +238,9 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
takePicture(options?: CameraPreviewPictureOptions): Promise<any> { return; }
takePicture(options?: CameraPreviewPictureOptions): Promise<any> {
return;
}
/**
*
@ -241,7 +253,9 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setColorEffect(effect: string): Promise<any> { return; }
setColorEffect(effect: string): Promise<any> {
return;
}
/**
* Set the zoom (Android)
@ -252,21 +266,27 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setZoom(zoom?: number): Promise<any> { return; }
setZoom(zoom?: number): Promise<any> {
return;
}
/**
* Get the maximum zoom (Android)
* @return {Promise<any>}
*/
* Get the maximum zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getMaxZoom(): Promise<any> { return; }
getMaxZoom(): Promise<any> {
return;
}
/**
* Get current zoom (Android)
* @return {Promise<any>}
*/
@Cordova()
getZoom(): Promise<any> { return; }
getZoom(): Promise<any> {
return;
}
/**
* Set the preview Size
@ -277,14 +297,18 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> {
return;
}
/**
* Get focus mode
* @return {Promise<any>}
*/
@Cordova()
getFocusMode(): Promise<any> { return; }
getFocusMode(): Promise<any> {
return;
}
/**
* Set the focus mode
@ -295,21 +319,27 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setFocusMode(focusMode?: string): Promise<any> { return; }
setFocusMode(focusMode?: string): Promise<any> {
return;
}
/**
* Get supported focus modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFocusModes(): Promise<any> { return; }
getSupportedFocusModes(): Promise<any> {
return;
}
/**
* Get the current flash mode
* @return {Promise<any>}
*/
@Cordova()
getFlashMode(): Promise<any> { return; }
getFlashMode(): Promise<any> {
return;
}
/**
* Set the flashmode
@ -320,35 +350,45 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setFlashMode(flashMode?: string): Promise<any> { return; }
setFlashMode(flashMode?: string): Promise<any> {
return;
}
/**
* Get supported flash modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFlashModes(): Promise<any> { return; }
getSupportedFlashModes(): Promise<any> {
return;
}
/**
* Get supported picture sizes
* @return {Promise<any>}
*/
@Cordova()
getSupportedPictureSizes(): Promise<any> { return; }
getSupportedPictureSizes(): Promise<any> {
return;
}
/**
* Get exposure mode
* @return {Promise<any>}
*/
@Cordova()
getExposureMode(): Promise<any> { return; }
getExposureMode(): Promise<any> {
return;
}
/**
* Get exposure modes
* @return {Promise<any>}
*/
@Cordova()
getExposureModes(): Promise<any> { return; }
getExposureModes(): Promise<any> {
return;
}
/**
* Set exposure mode
@ -359,14 +399,18 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setExposureMode(lock?: string): Promise<any> { return; }
setExposureMode(lock?: string): Promise<any> {
return;
}
/**
* Get exposure compensation (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensation(): Promise<any> { return; }
getExposureCompensation(): Promise<any> {
return;
}
/**
* Set exposure compensation (Android)
@ -377,14 +421,18 @@ export class CameraPreview extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
setExposureCompensation(exposureCompensation?: number): Promise<any> {
return;
}
/**
* Get exposure compensation range (Android)
* @return {Promise<any>}
*/
@Cordova()
getExposureCompensationRange(): Promise<any> { return; }
getExposureCompensationRange(): Promise<any> {
return;
}
/**
* Set specific focus point. Note, this assumes the camera is full-screen.
@ -393,6 +441,7 @@ export class CameraPreview extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
tapToFocus(xPoint: number, yPoint: number): Promise<any> { return; }
tapToFocus(xPoint: number, yPoint: number): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CameraOptions {
/** Picture quality in range 0-100. Default is 50 */
@ -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

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CardIOOptions {
/**
* Set to true to require expiry date
*/
@ -82,11 +81,9 @@ export interface CardIOOptions {
* Once a card image has been captured but before it has been processed, this value will determine whether to continue processing as usual.
*/
supressScan?: boolean;
}
export interface CardIOResponse {
/**
* Card type
*/
@ -126,7 +123,6 @@ export interface CardIOResponse {
* Cardholder name
*/
cardholderName: string;
}
/**
@ -173,7 +169,6 @@ export interface CardIOResponse {
})
@Injectable()
export class CardIO extends IonicNativePlugin {
/**
* Check whether card scanning is currently available. (May vary by
* device, OS version, network connectivity, etc.)
@ -181,7 +176,9 @@ export class CardIO extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova()
canScan(): Promise<boolean> { return; }
canScan(): Promise<boolean> {
return;
}
/**
* Scan a credit card with card.io.
@ -189,13 +186,16 @@ export class CardIO extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
scan(options?: CardIOOptions): Promise<CardIOResponse> { return; }
scan(options?: CardIOOptions): Promise<CardIOResponse> {
return;
}
/**
* Retrieve the version of the card.io library. Useful when contacting support.
* @returns {Promise<string>}
*/
@Cordova()
version(): Promise<string> { return; }
version(): Promise<string> {
return;
}
}

View File

@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Clipboard
* @description
@ -36,20 +37,22 @@ 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;
}
}

View File

@ -1,9 +1,18 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
namespace Http {
export const enum Verb {
GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
GET,
HEAD,
POST,
PUT,
DELETE,
TRACE,
OPTIONS,
CONNECT,
PATCH
}
export interface Response {
@ -13,7 +22,12 @@ namespace Http {
export interface Requester {
request(verb: Verb, url: string, callback: Callback<Response>): void;
request(verb: Verb, url: string, requestBody: string, callback: Callback<Response>): void;
request(
verb: Verb,
url: string,
requestBody: string,
callback: Callback<Response>
): void;
}
}
@ -50,7 +64,11 @@ export interface IRemotePackage extends IPackage {
* @param downloadError Optional callback invoked in case of an error.
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
*/
download(downloadSuccess: SuccessCallback<ILocalPackage>, downloadError?: ErrorCallback, downloadProgress?: SuccessCallback<DownloadProgress>): void;
download(
downloadSuccess: SuccessCallback<ILocalPackage>,
downloadError?: ErrorCallback,
downloadProgress?: SuccessCallback<DownloadProgress>
): void;
/**
* Aborts the current download session, previously started with download().
@ -58,7 +76,10 @@ export interface IRemotePackage extends IPackage {
* @param abortSuccess Optional callback invoked if the abort operation succeeded.
* @param abortError Optional callback invoked in case of an error.
*/
abortDownload(abortSuccess?: SuccessCallback<void>, abortError?: ErrorCallback): void;
abortDownload(
abortSuccess?: SuccessCallback<void>,
abortError?: ErrorCallback
): void;
}
/**
@ -86,7 +107,11 @@ export interface ILocalPackage extends IPackage {
* @param installError Optional callback inovoked in case of an error.
* @param installOptions Optional parameter used for customizing the installation behavior.
*/
install(installSuccess: SuccessCallback<InstallMode>, errorCallback?: ErrorCallback, installOptions?: InstallOptions): void;
install(
installSuccess: SuccessCallback<InstallMode>,
errorCallback?: ErrorCallback,
installOptions?: InstallOptions
): void;
}
/**
@ -123,13 +148,19 @@ interface IPackageInfoMetadata extends ILocalPackage {
}
interface NativeUpdateNotification {
updateAppVersion: boolean; // Always true
updateAppVersion: boolean; // Always true
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 interface Callback<T> {
(error: Error, parameter: T): void;
}
export interface SuccessCallback<T> {
(result?: T): void;
}
export interface ErrorCallback {
(error?: Error): void;
}
interface Configuration {
appVersion: string;
@ -146,26 +177,40 @@ declare class AcquisitionStatus {
declare class AcquisitionManager {
constructor(httpRequester: Http.Requester, configuration: Configuration);
public queryUpdateWithCurrentPackage(currentPackage: IPackage, callback?: Callback<IRemotePackage | NativeUpdateNotification>): void;
public reportStatusDeploy(pkg?: IPackage, status?: string, previousLabelOrAppVersion?: string, previousDeploymentKey?: string, callback?: Callback<void>): void;
public queryUpdateWithCurrentPackage(
currentPackage: IPackage,
callback?: Callback<IRemotePackage | NativeUpdateNotification>
): void;
public reportStatusDeploy(
pkg?: IPackage,
status?: string,
previousLabelOrAppVersion?: string,
previousDeploymentKey?: string,
callback?: Callback<void>
): void;
public reportStatusDownload(pkg: IPackage, callback?: Callback<void>): void;
}
interface CodePushCordovaPlugin {
/**
* Get the current package information.
*
* @param packageSuccess Callback invoked with the currently deployed package information.
* @param packageError Optional callback invoked in case of an error.
*/
getCurrentPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
getCurrentPackage(
packageSuccess: SuccessCallback<ILocalPackage>,
packageError?: ErrorCallback
): void;
/**
* Gets the pending package information, if any. A pending package is one that has been installed but the application still runs the old code.
* This happends only after a package has been installed using ON_NEXT_RESTART or ON_NEXT_RESUME mode, but the application was not restarted/resumed yet.
*/
getPendingPackage(packageSuccess: SuccessCallback<ILocalPackage>, packageError?: ErrorCallback): void;
getPendingPackage(
packageSuccess: SuccessCallback<ILocalPackage>,
packageError?: ErrorCallback
): void;
/**
* Checks with the CodePush server if an update package is available for download.
@ -176,7 +221,11 @@ interface CodePushCordovaPlugin {
* @param queryError Optional callback invoked in case of an error.
* @param deploymentKey Optional deployment key that overrides the config.xml setting.
*/
checkForUpdate(querySuccess: SuccessCallback<IRemotePackage>, queryError?: ErrorCallback, deploymentKey?: string): void;
checkForUpdate(
querySuccess: SuccessCallback<IRemotePackage>,
queryError?: ErrorCallback,
deploymentKey?: string
): void;
/**
* Notifies the plugin that the update operation succeeded and that the application is ready.
@ -186,13 +235,19 @@ interface CodePushCordovaPlugin {
* @param notifySucceeded Optional callback invoked if the plugin was successfully notified.
* @param notifyFailed Optional callback invoked in case of an error during notifying the plugin.
*/
notifyApplicationReady(notifySucceeded?: SuccessCallback<void>, notifyFailed?: ErrorCallback): void;
notifyApplicationReady(
notifySucceeded?: SuccessCallback<void>,
notifyFailed?: ErrorCallback
): void;
/**
* Reloads the application. If there is a pending update package installed using ON_NEXT_RESTART or ON_NEXT_RESUME modes, the update
* will be immediately visible to the user. Otherwise, calling this function will simply reload the current version of the application.
*/
restartApplication(installSuccess: SuccessCallback<void>, errorCallback?: ErrorCallback): void;
restartApplication(
installSuccess: SuccessCallback<void>,
errorCallback?: ErrorCallback
): void;
/**
* Convenience method for installing updates in one method call.
@ -215,7 +270,11 @@ interface CodePushCordovaPlugin {
* @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
*
*/
sync(syncCallback?: SuccessCallback<SyncStatus>, syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): void;
sync(
syncCallback?: SuccessCallback<SyncStatus>,
syncOptions?: SyncOptions,
downloadProgress?: SuccessCallback<DownloadProgress>
): void;
}
/**
@ -428,7 +487,6 @@ export interface DownloadProgress {
})
@Injectable()
export class CodePush extends IonicNativePlugin {
/**
* Get the current package information.
*
@ -518,8 +576,10 @@ export class CodePush extends IonicNativePlugin {
successIndex: 0,
errorIndex: 3 // we don't need this, so we set it to a value higher than # of args
})
sync(syncOptions?: SyncOptions, downloadProgress?: SuccessCallback<DownloadProgress>): Observable<SyncStatus> {
sync(
syncOptions?: SyncOptions,
downloadProgress?: SuccessCallback<DownloadProgress>
): Observable<SyncStatus> {
return;
}
}

View File

@ -1,12 +1,47 @@
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import {
checkAvailability,
CordovaCheck,
CordovaInstance,
getPromise,
InstanceCheck,
InstanceProperty,
IonicNativePlugin,
Plugin,
} from '@ionic-native/core';
declare const window: any,
navigator: any;
declare const window: any, navigator: any;
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'name.familyName' | 'name.formatted' | 'name.givenName' | 'name.honorificPrefix' | 'name.honorificSuffix' | 'id' | 'ims' | 'locality' | 'name.middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
export type ContactFieldType =
| '*'
| 'addresses'
| 'birthday'
| 'categories'
| 'country'
| 'department'
| 'displayName'
| 'emails'
| 'name.familyName'
| 'name.formatted'
| 'name.givenName'
| 'name.honorificPrefix'
| 'name.honorificSuffix'
| 'id'
| 'ims'
| 'locality'
| 'name.middleName'
| 'name'
| 'nickname'
| 'note'
| 'organizations'
| 'phoneNumbers'
| 'photos'
| 'postalCode'
| 'region'
| 'streetAddress'
| 'title'
| 'urls';
export interface IContactProperties {
/** A globally unique identifier. */
id?: string;
@ -48,7 +83,6 @@ export interface IContactProperties {
/** An array of web pages associated with the contact. */
urls?: IContactField[];
}
/**
@ -74,7 +108,9 @@ export class Contact implements IContactProperties {
[key: string]: any;
constructor() {
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
if (
checkAvailability('navigator.contacts', 'create', 'Contacts') === true
) {
this._objectInstance = navigator.contacts.create();
}
}
@ -90,7 +126,9 @@ export class Contact implements IContactProperties {
}
@CordovaInstance()
remove(): Promise<any> { return; }
remove(): Promise<any> {
return;
}
@InstanceCheck()
save(): Promise<any> {
@ -124,7 +162,7 @@ export declare const ContactError: {
PENDING_OPERATION_ERROR: number;
IO_ERROR: number;
NOT_SUPPORTED_ERROR: number;
PERMISSION_DENIED_ERROR: number
PERMISSION_DENIED_ERROR: number;
};
export interface IContactName {
@ -146,12 +184,14 @@ export interface IContactName {
* @hidden
*/
export class ContactName implements IContactName {
constructor(public formatted?: string,
constructor(
public formatted?: string,
public familyName?: string,
public givenName?: string,
public middleName?: string,
public honorificPrefix?: string,
public honorificSuffix?: string) { }
public honorificSuffix?: string
) {}
}
export interface IContactField {
@ -167,9 +207,11 @@ export interface IContactField {
* @hidden
*/
export class ContactField implements IContactField {
constructor(public type?: string,
constructor(
public type?: string,
public value?: string,
public pref?: boolean) { }
public pref?: boolean
) {}
}
export interface IContactAddress {
@ -195,14 +237,16 @@ export interface IContactAddress {
* @hidden
*/
export class ContactAddress implements IContactAddress {
constructor(public pref?: boolean,
constructor(
public pref?: boolean,
public type?: string,
public formatted?: string,
public streetAddress?: string,
public locality?: string,
public region?: string,
public postalCode?: string,
public country?: string) { }
public country?: string
) {}
}
export interface IContactOrganization {
@ -228,7 +272,7 @@ export class ContactOrganization implements IContactOrganization {
public department?: string,
public title?: string,
public pref?: boolean
) { }
) {}
}
/** Search options to filter navigator.contacts. */
@ -249,10 +293,12 @@ export interface IContactFindOptions {
* @hidden
*/
export class ContactFindOptions implements IContactFindOptions {
constructor(public filter?: string,
constructor(
public filter?: string,
public multiple?: boolean,
public desiredFields?: string[],
public hasPhoneNumber?: boolean) { }
public hasPhoneNumber?: boolean
) {}
}
/**
@ -293,10 +339,19 @@ export class ContactFindOptions implements IContactFindOptions {
plugin: 'cordova-plugin-contacts',
pluginRef: 'navigator.contacts',
repo: 'https://github.com/apache/cordova-plugin-contacts',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
platforms: [
'Android',
'BlackBerry 10',
'Browser',
'Firefox OS',
'iOS',
'Ubuntu',
'Windows',
'Windows 8',
'Windows Phone'
]
})
export class Contacts extends IonicNativePlugin {
/**
* Create a single contact.
* @returns {Contact} Returns a Contact object
@ -312,11 +367,19 @@ export class Contacts extends IonicNativePlugin {
* @returns {Promise<Contact[]>} Returns a Promise that resolves with the search results (an array of Contact objects)
*/
@CordovaCheck()
find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
find(
fields: ContactFieldType[],
options?: IContactFindOptions
): Promise<Contact[]> {
return getPromise((resolve: Function, reject: Function) => {
navigator.contacts.find(fields, (contacts: any[]) => {
resolve(contacts.map(processContact));
}, reject, options);
navigator.contacts.find(
fields,
(contacts: any[]) => {
resolve(contacts.map(processContact));
},
reject,
options
);
});
}
@ -327,10 +390,12 @@ export class Contacts extends IonicNativePlugin {
@CordovaCheck()
pickContact(): Promise<Contact> {
return getPromise((resolve: Function, reject: Function) => {
navigator.contacts.pickContact((contact: any) => resolve(processContact(contact)), reject);
navigator.contacts.pickContact(
(contact: any) => resolve(processContact(contact)),
reject
);
});
}
}
/**

View File

@ -1,6 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Couchbase Lite
@ -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

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface CropOptions {
quality?: number;

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeeplinkMatch {
/**
* The route info for the matched route
*/
@ -20,7 +19,6 @@ export interface DeeplinkMatch {
* the route was matched (for example, Facebook sometimes adds extra data)
*/
$link: any;
}
export interface DeeplinkOptions {
@ -85,13 +83,18 @@ export interface DeeplinkOptions {
plugin: 'ionic-plugin-deeplinks',
pluginRef: 'IonicDeeplink',
repo: 'https://github.com/ionic-team/ionic-plugin-deeplinks',
install: 'ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX'],
install:
'ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: [
'URL_SCHEME',
'DEEPLINK_SCHEME',
'DEEPLINK_HOST',
'ANDROID_PATH_PREFIX'
],
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()
export class Deeplinks extends IonicNativePlugin {
/**
* Define a set of paths to match against incoming deeplinks.
*
@ -105,7 +108,9 @@ export class Deeplinks extends IonicNativePlugin {
@Cordova({
observable: true
})
route(paths: any): Observable<DeeplinkMatch> { return; }
route(paths: any): Observable<DeeplinkMatch> {
return;
}
/**
*
@ -123,7 +128,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
@ -132,6 +137,11 @@ export class Deeplinks extends IonicNativePlugin {
@Cordova({
observable: true
})
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> { return; }
routeWithNavController(
navController: any,
paths: any,
options?: DeeplinkOptions
): Observable<DeeplinkMatch> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeviceMotionAccelerationData {
/**
* Amount of acceleration on the x-axis. (in m/s^2)
*/
@ -23,16 +22,13 @@ export interface DeviceMotionAccelerationData {
* Creation timestamp in milliseconds.
*/
timestamp: any;
}
export interface DeviceMotionAccelerometerOptions {
/**
* Requested period of calls to accelerometerSuccess with acceleration data in Milliseconds. Default: 10000
*/
frequency?: number;
}
/**
@ -72,17 +68,28 @@ export interface DeviceMotionAccelerometerOptions {
plugin: 'cordova-plugin-device-motion',
pluginRef: 'navigator.accelerometer',
repo: 'https://github.com/apache/cordova-plugin-device-motion',
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone 8']
platforms: [
'Android',
'BlackBerry 10',
'Browser',
'Firefox OS',
'iOS',
'Tizen',
'Ubuntu',
'Windows',
'Windows Phone 8'
]
})
@Injectable()
export class DeviceMotion extends IonicNativePlugin {
/**
* Get the current acceleration along the x, y, and z axes.
* @returns {Promise<DeviceMotionAccelerationData>} Returns object with x, y, z, and timestamp properties
*/
@Cordova()
getCurrentAcceleration(): Promise<DeviceMotionAccelerationData> { return; }
getCurrentAcceleration(): Promise<DeviceMotionAccelerationData> {
return;
}
/**
* Watch the device acceleration. Clear the watch by unsubscribing from the observable.
@ -94,6 +101,9 @@ export class DeviceMotion extends IonicNativePlugin {
observable: true,
clearFunction: 'clearWatch'
})
watchAcceleration(options?: DeviceMotionAccelerometerOptions): Observable<DeviceMotionAccelerationData> { return; }
watchAcceleration(
options?: DeviceMotionAccelerometerOptions
): Observable<DeviceMotionAccelerationData> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface DeviceOrientationCompassHeading {
/**
* The heading in degrees from 0-359.99 at a single moment in time. (Number)
*/
@ -23,11 +22,9 @@ export interface DeviceOrientationCompassHeading {
* The time at which this heading was determined. (DOMTimeStamp)
*/
timestamp: number;
}
export interface DeviceOrientationCompassOptions {
/**
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
*/
@ -37,7 +34,6 @@ export interface DeviceOrientationCompassOptions {
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
*/
filter?: number;
}
/**
@ -77,17 +73,29 @@ export interface DeviceOrientationCompassOptions {
plugin: 'cordova-plugin-device-orientation',
pluginRef: 'navigator.compass',
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
platforms: [
'Amazon Fire OS',
'Android',
'BlackBerry 10',
'Browser',
'Firefox OS',
'iOS',
'Tizen',
'Ubuntu',
'Windows',
'Windows Phone'
]
})
@Injectable()
export class DeviceOrientation extends IonicNativePlugin {
/**
* Get the current compass heading.
* @returns {Promise<DeviceOrientationCompassHeading>}
*/
@Cordova()
getCurrentHeading(): Promise<DeviceOrientationCompassHeading> { return; }
getCurrentHeading(): Promise<DeviceOrientationCompassHeading> {
return;
}
/**
* Get the device current heading at a regular interval
@ -101,6 +109,9 @@ export class DeviceOrientation extends IonicNativePlugin {
observable: true,
clearFunction: 'clearWatch'
})
watchHeading(options?: DeviceOrientationCompassOptions): Observable<DeviceOrientationCompassHeading> { return; }
watchHeading(
options?: DeviceOrientationCompassOptions
): Observable<DeviceOrientationCompassHeading> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
declare const window: any;
@ -28,40 +28,30 @@ declare const window: any;
})
@Injectable()
export class Device extends IonicNativePlugin {
/** Get the version of Cordova running on the device. */
@CordovaProperty
cordova: string;
@CordovaProperty cordova: string;
/**
* The device.model returns the name of the device's model or product. The value is set
* by the device manufacturer and may be different across versions of the same product.
*/
@CordovaProperty
model: string;
@CordovaProperty model: string;
/** Get the device's operating system name. */
@CordovaProperty
platform: string;
@CordovaProperty platform: string;
/** Get the device's Universally Unique Identifier (UUID). */
@CordovaProperty
uuid: string;
@CordovaProperty uuid: string;
/** Get the operating system version. */
@CordovaProperty
version: string;
@CordovaProperty version: string;
/** Get the device's manufacturer. */
@CordovaProperty
manufacturer: string;
@CordovaProperty manufacturer: string;
/** Whether the device is running on a simulator. */
@CordovaProperty
isVirtual: boolean;
@CordovaProperty isVirtual: boolean;
/** Get the device hardware serial number. */
@CordovaProperty
serial: string;
@CordovaProperty serial: string;
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
/**
* @name Diagnostic
@ -43,7 +48,6 @@ import { Cordova, Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-nati
})
@Injectable()
export class Diagnostic extends IonicNativePlugin {
permission = {
READ_CALENDAR: 'READ_CALENDAR',
WRITE_CALENDAR: 'WRITE_CALENDAR',
@ -92,9 +96,23 @@ export class Diagnostic extends IonicNativePlugin {
CONTACTS: ['READ_CONTACTS', 'WRITE_CONTACTS', 'GET_ACCOUNTS'],
LOCATION: ['ACCESS_FINE_LOCATION', 'ACCESS_COARSE_LOCATION'],
MICROPHONE: ['RECORD_AUDIO'],
PHONE: ['READ_PHONE_STATE', 'CALL_PHONE', 'ADD_VOICEMAIL', 'USE_SIP', 'PROCESS_OUTGOING_CALLS', 'READ_CALL_LOG', 'WRITE_CALL_LOG'],
PHONE: [
'READ_PHONE_STATE',
'CALL_PHONE',
'ADD_VOICEMAIL',
'USE_SIP',
'PROCESS_OUTGOING_CALLS',
'READ_CALL_LOG',
'WRITE_CALL_LOG'
],
SENSORS: ['BODY_SENSORS'],
SMS: ['SEND_SMS', 'RECEIVE_SMS', 'READ_SMS', 'RECEIVE_WAP_PUSH', 'RECEIVE_MMS'],
SMS: [
'SEND_SMS',
'RECEIVE_SMS',
'READ_SMS',
'RECEIVE_WAP_PUSH',
'RECEIVE_MMS'
],
STORAGE: ['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE']
};
@ -141,7 +159,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isLocationAvailable(): Promise<any> { return; }
isLocationAvailable(): Promise<any> {
return;
}
/**
* Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
@ -149,17 +169,21 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isWifiAvailable(): Promise<any> { return; }
isWifiAvailable(): Promise<any> {
return;
}
/**
* Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
* application is authorized to use it.
* @param {boolean} [externalStorage] Android only: If true, checks permission for READ_EXTERNAL_STORAGE in addition to CAMERA run-time permission.
* cordova-plugin-camera@2.2+ requires both of these permissions. Defaults to true.
* cordova-plugin-camera@2.2+ requires both of these permissions. Defaults to true.
* @returns {Promise<any>}
*/
@Cordova({ callbackOrder: 'reverse' })
isCameraAvailable( externalStorage?: boolean ): Promise<any> { return; }
isCameraAvailable(externalStorage?: boolean): Promise<any> {
return;
}
/**
* Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
@ -167,38 +191,42 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isBluetoothAvailable(): Promise<any> { return; }
isBluetoothAvailable(): Promise<any> {
return;
}
/**
* Displays the device location settings to allow user to enable location services/change location mode.
*/
@Cordova({ sync: true, platforms: ['Android', 'Windows 10', 'iOS'] })
switchToLocationSettings(): void { }
switchToLocationSettings(): void {}
/**
* Displays mobile settings to allow user to enable mobile data.
*/
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
switchToMobileDataSettings(): void { }
switchToMobileDataSettings(): void {}
/**
* Displays Bluetooth settings to allow user to enable Bluetooth.
*/
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
switchToBluetoothSettings(): void { }
switchToBluetoothSettings(): void {}
/**
* Displays WiFi settings to allow user to enable WiFi.
*/
@Cordova({ sync: true, platforms: ['Android', 'Windows 10'] })
switchToWifiSettings(): void { }
switchToWifiSettings(): void {}
/**
* Returns true if the WiFi setting is set to enabled, and is the same as `isWifiAvailable()`
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'Windows 10'] })
isWifiEnabled(): Promise<boolean> { return; }
isWifiEnabled(): Promise<boolean> {
return;
}
/**
* Enables/disables WiFi on the device.
@ -207,7 +235,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
setWifiState(state: boolean): Promise<any> { return; }
setWifiState(state: boolean): Promise<any> {
return;
}
/**
* Enables/disables Bluetooth on the device.
@ -216,8 +246,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ callbackOrder: 'reverse', platforms: ['Android', 'Windows 10'] })
setBluetoothState(state: boolean): Promise<any> { return; }
setBluetoothState(state: boolean): Promise<any> {
return;
}
// ANDROID AND IOS ONLY
@ -226,7 +257,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isLocationEnabled(): Promise<boolean> { return; }
isLocationEnabled(): Promise<boolean> {
return;
}
/**
* Checks if the application is authorized to use location.
@ -234,14 +267,18 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isLocationAuthorized(): Promise<any> { return; }
isLocationAuthorized(): Promise<any> {
return;
}
/**
* Returns the location authorization status for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
getLocationAuthorizationStatus(): Promise<any> { return; }
getLocationAuthorizationStatus(): Promise<any> {
return;
}
/**
* Returns the location authorization status for the application.
@ -251,14 +288,18 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
requestLocationAuthorization(mode?: string): Promise<any> { return; }
requestLocationAuthorization(mode?: string): Promise<any> {
return;
}
/**
* Checks if camera hardware is present on device.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isCameraPresent(): Promise<any> { return; }
isCameraPresent(): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use the camera.
@ -268,7 +309,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
isCameraAuthorized( externalStorage?: boolean ): Promise<any> { return; }
isCameraAuthorized(externalStorage?: boolean): Promise<any> {
return;
}
/**
* Returns the camera authorization status for the application.
@ -277,7 +320,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
getCameraAuthorizationStatus( externalStorage?: boolean ): Promise<any> { return; }
getCameraAuthorizationStatus(externalStorage?: boolean): Promise<any> {
return;
}
/**
* Requests camera authorization for the application.
@ -286,49 +331,63 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })
requestCameraAuthorization( externalStorage?: boolean ): Promise<any> { return; }
requestCameraAuthorization(externalStorage?: boolean): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use the microphone.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isMicrophoneAuthorized(): Promise<boolean> { return; }
isMicrophoneAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the microphone authorization status for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
getMicrophoneAuthorizationStatus(): Promise<any> { return; }
getMicrophoneAuthorizationStatus(): Promise<any> {
return;
}
/**
* Requests microphone authorization for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
requestMicrophoneAuthorization(): Promise<any> { return; }
requestMicrophoneAuthorization(): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use contacts (address book).
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isContactsAuthorized(): Promise<boolean> { return; }
isContactsAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the contacts authorization status for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
getContactsAuthorizationStatus(): Promise<any> { return; }
getContactsAuthorizationStatus(): Promise<any> {
return;
}
/**
* Requests contacts authorization for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
requestContactsAuthorization(): Promise<any> { return; }
requestContactsAuthorization(): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use the calendar.
@ -341,7 +400,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
isCalendarAuthorized(): Promise<boolean> { return; }
isCalendarAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the calendar authorization status for the application.
@ -355,7 +416,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
getCalendarAuthorizationStatus(): Promise<any> { return; }
getCalendarAuthorizationStatus(): Promise<any> {
return;
}
/**
* Requests calendar authorization for the application.
@ -372,7 +435,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
requestCalendarAuthorization(): Promise<any> { return; }
requestCalendarAuthorization(): Promise<any> {
return;
}
/**
* Opens settings page for this app.
@ -381,29 +446,32 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
switchToSettings(): Promise<any> { return; }
switchToSettings(): Promise<any> {
return;
}
/**
* Returns the state of Bluetooth on the device.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'] })
getBluetoothState(): Promise<any> { return; }
getBluetoothState(): Promise<any> {
return;
}
/**
* Registers a function to be called when a change in Bluetooth state occurs.
* @param handler
*/
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
registerBluetoothStateChangeHandler(handler: Function): void { }
registerBluetoothStateChangeHandler(handler: Function): void {}
/**
* Registers a function to be called when a change in Location state occurs.
* @param handler
*/
@Cordova({ platforms: ['Android', 'iOS'], sync: true })
registerLocationStateChangeHandler(handler: Function): void { }
registerLocationStateChangeHandler(handler: Function): void {}
// ANDROID ONLY
@ -413,7 +481,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isGpsLocationAvailable(): Promise<boolean> { return; }
isGpsLocationAvailable(): Promise<boolean> {
return;
}
/**
* Checks if location mode is set to return high-accuracy locations from GPS hardware.
@ -423,7 +493,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
isGpsLocationEnabled(): Promise<any> { return; }
isGpsLocationEnabled(): Promise<any> {
return;
}
/**
* Checks if low-accuracy locations are available to the app from network triangulation/WiFi access points.
@ -431,7 +503,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
isNetworkLocationAvailable(): Promise<any> { return; }
isNetworkLocationAvailable(): Promise<any> {
return;
}
/**
* Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points.
@ -441,14 +515,18 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
isNetworkLocationEnabled(): Promise<any> { return; }
isNetworkLocationEnabled(): Promise<any> {
return;
}
/**
* Returns the current location mode setting for the device.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
getLocationMode(): Promise<any> { return; }
getLocationMode(): Promise<any> {
return;
}
/**
* Returns the current authorisation status for a given permission.
@ -457,7 +535,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
getPermissionAuthorizationStatus(permission: any): Promise<any> { return; }
getPermissionAuthorizationStatus(permission: any): Promise<any> {
return;
}
/**
* Returns the current authorisation status for multiple permissions.
@ -466,7 +546,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
getPermissionsAuthorizationStatus(permissions: any[]): Promise<any> { return; }
getPermissionsAuthorizationStatus(permissions: any[]): Promise<any> {
return;
}
/**
* Requests app to be granted authorisation for a runtime permission.
@ -475,7 +557,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
requestRuntimePermission(permission: any): Promise<any> { return; }
requestRuntimePermission(permission: any): Promise<any> {
return;
}
/**
* Requests app to be granted authorisation for multiple runtime permissions.
@ -484,7 +568,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'], callbackOrder: 'reverse' })
requestRuntimePermissions(permissions: any[]): Promise<any> { return; }
requestRuntimePermissions(permissions: any[]): Promise<any> {
return;
}
/**
* Indicates if the plugin is currently requesting a runtime permission via the native API.
@ -494,7 +580,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {boolean}
*/
@Cordova({ sync: true })
isRequestingPermission(): boolean { return; }
isRequestingPermission(): boolean {
return;
}
/**
* Registers a function to be called when a runtime permission request has completed.
@ -502,7 +590,9 @@ export class Diagnostic extends IonicNativePlugin {
* @param handler {Function}
*/
@Cordova({ sync: true })
registerPermissionRequestCompleteHandler(handler: Function): void { return; }
registerPermissionRequestCompleteHandler(handler: Function): void {
return;
}
/**
* Checks if the device setting for Bluetooth is switched on.
@ -510,49 +600,63 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isBluetoothEnabled(): Promise<boolean> { return; }
isBluetoothEnabled(): Promise<boolean> {
return;
}
/**
* Checks if the device has Bluetooth capabilities.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
hasBluetoothSupport(): Promise<boolean> { return; }
hasBluetoothSupport(): Promise<boolean> {
return;
}
/**
* Checks if the device has Bluetooth Low Energy (LE) capabilities.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
hasBluetoothLESupport(): Promise<boolean> { return; }
hasBluetoothLESupport(): Promise<boolean> {
return;
}
/**
* Checks if the device supports Bluetooth Low Energy (LE) Peripheral mode.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
hasBluetoothLEPeripheralSupport(): Promise<boolean> { return; }
hasBluetoothLEPeripheralSupport(): Promise<boolean> {
return;
}
/**
* Checks if the application is authorized to use external storage.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isExternalStorageAuthorized(): Promise<boolean> { return; }
isExternalStorageAuthorized(): Promise<boolean> {
return;
}
/**
* CReturns the external storage authorization status for the application.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
getExternalStorageAuthorizationStatus(): Promise<any> { return; }
getExternalStorageAuthorizationStatus(): Promise<any> {
return;
}
/**
* Requests external storage authorization for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
requestExternalStorageAuthorization(): Promise<any> { return; }
requestExternalStorageAuthorization(): Promise<any> {
return;
}
/**
* Returns details of external SD card(s): absolute path, is writable, free space.
@ -565,7 +669,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
getExternalSdCardDetails(): Promise<any> { return; }
getExternalSdCardDetails(): Promise<any> {
return;
}
/**
* Switches to the wireless settings page in the Settings app. Allows configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.
@ -574,7 +680,7 @@ export class Diagnostic extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
switchToWirelessSettings(): void { }
switchToWirelessSettings(): void {}
/**
* Displays NFC settings to allow user to enable NFC.
@ -583,14 +689,16 @@ export class Diagnostic extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
switchToNFCSettings(): void { }
switchToNFCSettings(): void {}
/**
* Checks if NFC hardware is present on device.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isNFCPresent(): Promise<boolean> { return; }
isNFCPresent(): Promise<boolean> {
return;
}
/**
* Checks if the device setting for NFC is switched on.
@ -598,7 +706,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isNFCEnabled(): Promise<boolean> { return; }
isNFCEnabled(): Promise<boolean> {
return;
}
/**
* Checks if NFC is available to the app. Returns true if the device has NFC capabilities AND if NFC setting is switched on.
@ -606,7 +716,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android'] })
isNFCAvailable(): Promise<boolean> { return; }
isNFCAvailable(): Promise<boolean> {
return;
}
/**
* Registers a function to be called when a change in NFC state occurs. Pass in a falsey value to de-register the currently registered function.
@ -617,28 +729,34 @@ export class Diagnostic extends IonicNativePlugin {
platforms: ['Android'],
sync: true
})
registerNFCStateChangeHandler(handler: Function): void { }
registerNFCStateChangeHandler(handler: Function): void {}
/**
* Checks if the device data roaming setting is enabled.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isDataRoamingEnabled(): Promise<boolean> { return; }
isDataRoamingEnabled(): Promise<boolean> {
return;
}
/**
* Checks if the device setting for ADB(debug) is switched on.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isADBModeEnabled(): Promise<boolean> { return; }
isADBModeEnabled(): Promise<boolean> {
return;
}
/**
* Checks if the device is rooted.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['Android'] })
isDeviceRooted(): Promise<boolean> { return; }
isDeviceRooted(): Promise<boolean> {
return;
}
// IOS ONLY
@ -647,14 +765,18 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isCameraRollAuthorized(): Promise<boolean> { return; }
isCameraRollAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the authorization status for the application to use the Camera Roll in Photos app.
* @returns {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
getCameraRollAuthorizationStatus(): Promise<string> { return; }
getCameraRollAuthorizationStatus(): Promise<string> {
return;
}
/**
* Requests camera roll authorization for the application.
@ -663,21 +785,27 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
requestCameraRollAuthorization(): Promise<any> { return; }
requestCameraRollAuthorization(): Promise<any> {
return;
}
/**
* Checks if remote (push) notifications are enabled.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS', 'Android'] })
isRemoteNotificationsEnabled(): Promise<boolean> { return; }
isRemoteNotificationsEnabled(): Promise<boolean> {
return;
}
/**
* Indicates if the app is registered for remote (push) notifications on the device.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isRegisteredForRemoteNotifications(): Promise<boolean> { return; }
isRegisteredForRemoteNotifications(): Promise<boolean> {
return;
}
/**
* Returns the authorization status for the application to use Remote Notifications.
@ -685,7 +813,9 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
getRemoteNotificationsAuthorizationStatus(): Promise<string> { return; }
getRemoteNotificationsAuthorizationStatus(): Promise<string> {
return;
}
/**
* Indicates the current setting of notification types for the app in the Settings app.
@ -693,42 +823,54 @@ export class Diagnostic extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
getRemoteNotificationTypes(): Promise<any> { return; }
getRemoteNotificationTypes(): Promise<any> {
return;
}
/**
* Checks if the application is authorized to use reminders.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isRemindersAuthorized(): Promise<boolean> { return; }
isRemindersAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the reminders authorization status for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
getRemindersAuthorizationStatus(): Promise<any> { return; }
getRemindersAuthorizationStatus(): Promise<any> {
return;
}
/**
* Requests reminders authorization for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
requestRemindersAuthorization(): Promise<any> { return; }
requestRemindersAuthorization(): Promise<any> {
return;
}
/**
* Checks if the application is authorized for background refresh.
* @returns {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isBackgroundRefreshAuthorized(): Promise<boolean> { return; }
isBackgroundRefreshAuthorized(): Promise<boolean> {
return;
}
/**
* Returns the background refresh authorization status for the application.
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
getBackgroundRefreshStatus(): Promise<any> { return; }
getBackgroundRefreshStatus(): Promise<any> {
return;
}
/**
* Requests Bluetooth authorization for the application.
@ -737,14 +879,18 @@ export class Diagnostic extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova({ platforms: ['iOS'] })
requestBluetoothAuthorization(): Promise<any> { return; }
requestBluetoothAuthorization(): Promise<any> {
return;
}
/**
* Checks if motion tracking is available on the current device.
* @return {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isMotionAvailable(): Promise<boolean> { return; }
isMotionAvailable(): Promise<boolean> {
return;
}
/**
* Checks if it's possible to determine the outcome of a motion authorization request on the current device.
@ -754,7 +900,9 @@ export class Diagnostic extends IonicNativePlugin {
* @return {Promise<boolean>}
*/
@Cordova({ platforms: ['iOS'] })
isMotionRequestOutcomeAvailable(): Promise<boolean> { return; }
isMotionRequestOutcomeAvailable(): Promise<boolean> {
return;
}
/**
* Requests motion tracking authorization for the application.
@ -764,7 +912,9 @@ export class Diagnostic extends IonicNativePlugin {
* @return {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
requestMotionAuthorization(): Promise<string> { return; }
requestMotionAuthorization(): Promise<string> {
return;
}
/**
* Checks motion authorization status for the application.
@ -774,6 +924,7 @@ export class Diagnostic extends IonicNativePlugin {
* @return {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
getMotionAuthorizationStatus(): Promise<string> { return; }
getMotionAuthorizationStatus(): Promise<string> {
return;
}
}

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface DialogsPromptCallback {
/**
* The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
*/
@ -13,10 +11,8 @@ export interface DialogsPromptCallback {
* The text entered in the prompt dialog box. (String)
*/
input1: string;
}
/**
* @name Dialogs
* @description
@ -50,7 +46,6 @@ export interface DialogsPromptCallback {
})
@Injectable()
export class Dialogs extends IonicNativePlugin {
/**
* Shows a custom alert or dialog box.
* @param {string} message Dialog message.
@ -62,7 +57,9 @@ export class Dialogs extends IonicNativePlugin {
successIndex: 1,
errorIndex: 4
})
alert(message: string, title?: string, buttonName?: string): Promise<any> { return; }
alert(message: string, title?: string, buttonName?: string): Promise<any> {
return;
}
/**
* Displays a customizable confirmation dialog box.
@ -75,7 +72,13 @@ export class Dialogs extends IonicNativePlugin {
successIndex: 1,
errorIndex: 4
})
confirm(message: string, title?: string, buttonLabels?: string[]): Promise<number> { return; }
confirm(
message: string,
title?: string,
buttonLabels?: string[]
): Promise<number> {
return;
}
/**
* Displays a native dialog box that is more customizable than the browser's prompt function.
@ -89,8 +92,14 @@ export class Dialogs extends IonicNativePlugin {
successIndex: 1,
errorIndex: 5
})
prompt(message?: string, title?: string, buttonLabels?: string[], defaultText?: string): Promise<DialogsPromptCallback> { return; }
prompt(
message?: string,
title?: string,
buttonLabels?: string[],
defaultText?: string
): Promise<DialogsPromptCallback> {
return;
}
/**
* The device plays a beep sound.
@ -99,6 +108,5 @@ export class Dialogs extends IonicNativePlugin {
@Cordova({
sync: true
})
beep(times: number): void { }
beep(times: number): void {}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name DNS
@ -36,5 +36,7 @@ export class DNS extends IonicNativePlugin {
* @returns {Promise<string>} Returns a promise that resolves with the resolution.
*/
@Cordova()
resolve(hostname: string): Promise<string> { return; }
resolve(hostname: string): Promise<string> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface DocumentViewerOptions {
title?: string;
@ -62,14 +62,15 @@ export interface DocumentViewerOptions {
})
@Injectable()
export class DocumentViewer extends IonicNativePlugin {
/**
* Displays the email composer pre-filled with data.
*
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@Cordova()
getSupportInfo(): Promise<any> { return; }
getSupportInfo(): Promise<any> {
return;
}
/**
* Check if the document can be shown
@ -83,7 +84,15 @@ export class DocumentViewer extends IonicNativePlugin {
* @param [onError] {Function}
*/
@Cordova({ sync: true })
canViewDocument(url: string, contentType: string, options: DocumentViewerOptions, onPossible?: Function, onMissingApp?: Function, onImpossible?: Function, onError?: Function): void { }
canViewDocument(
url: string,
contentType: string,
options: DocumentViewerOptions,
onPossible?: Function,
onMissingApp?: Function,
onImpossible?: Function,
onError?: Function
): void {}
/**
* Opens the file
@ -97,6 +106,13 @@ export class DocumentViewer extends IonicNativePlugin {
* @param [onError] {Function}
*/
@Cordova({ sync: true })
viewDocument(url: string, contentType: string, options: DocumentViewerOptions, onShow?: Function, onClose?: Function, onMissingApp?: Function, onError?: Function): void { }
viewDocument(
url: string,
contentType: string,
options: DocumentViewerOptions,
onShow?: Function,
onClose?: Function,
onMissingApp?: Function,
onError?: Function
): void {}
}

View File

@ -1,8 +1,12 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
export interface EmailComposerOptions {
/**
* App to send the email with
*/
@ -42,10 +46,8 @@ export interface EmailComposerOptions {
* Indicates if the body is HTML or plain text
*/
isHtml?: boolean;
}
/**
* @name Email Composer
* @description
@ -110,7 +112,6 @@ export interface EmailComposerOptions {
})
@Injectable()
export class EmailComposer extends IonicNativePlugin {
/**
* Verifies if sending emails is supported on the device.
*
@ -148,7 +149,9 @@ export class EmailComposer extends IonicNativePlugin {
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> { return; }
requestPermission(): Promise<boolean> {
return;
}
/**
* Checks if the app has a permission to access email accounts information
@ -158,7 +161,9 @@ export class EmailComposer extends IonicNativePlugin {
successIndex: 0,
errorIndex: 2
})
hasPermission(): Promise<boolean> { return; }
hasPermission(): Promise<boolean> {
return;
}
/**
* Adds a new mail app alias.
@ -167,7 +172,7 @@ export class EmailComposer extends IonicNativePlugin {
* @param packageName {string} The package name
*/
@Cordova()
addAlias(alias: string, packageName: string): void { }
addAlias(alias: string, packageName: string): void {}
/**
* Displays the email composer pre-filled with data.
@ -180,6 +185,7 @@ export class EmailComposer extends IonicNativePlugin {
successIndex: 1,
errorIndex: 3
})
open(options: EmailComposerOptions, scope?: any): Promise<any> { return; }
open(options: EmailComposerOptions, scope?: any): Promise<any> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface EstimoteBeaconRegion {
state?: string;
major: number;
@ -13,7 +12,6 @@ export interface EstimoteBeaconRegion {
identifier?: string;
uuid: string;
}
/**
@ -48,7 +46,6 @@ export interface EstimoteBeaconRegion {
})
@Injectable()
export class EstimoteBeacons extends IonicNativePlugin {
/** Proximity value */
ProximityUnknown = 0;
@ -124,7 +121,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
requestWhenInUseAuthorization(): Promise<any> { return; }
requestWhenInUseAuthorization(): Promise<any> {
return;
}
/**
* Ask the user for permission to use location services
@ -145,7 +144,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
requestAlwaysAuthorization(): Promise<any> { return; }
requestAlwaysAuthorization(): Promise<any> {
return;
}
/**
* Get the current location authorization status.
@ -164,7 +165,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
authorizationStatus(): Promise<any> { return; }
authorizationStatus(): Promise<any> {
return;
}
/**
* Start advertising as a beacon.
@ -186,7 +189,14 @@ export class EstimoteBeacons extends IonicNativePlugin {
@Cordova({
clearFunction: 'stopAdvertisingAsBeacon'
})
startAdvertisingAsBeacon(uuid: string, major: number, minor: number, regionId: string): Promise<any> { return; }
startAdvertisingAsBeacon(
uuid: string,
major: number,
minor: number,
regionId: string
): Promise<any> {
return;
}
/**
* Stop advertising as a beacon.
@ -202,7 +212,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopAdvertisingAsBeacon(): Promise<any> { return; }
stopAdvertisingAsBeacon(): Promise<any> {
return;
}
/**
* Enable analytics.
@ -217,12 +229,14 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
enableAnalytics(enable: boolean): Promise<any> { return; }
enableAnalytics(enable: boolean): Promise<any> {
return;
}
/**
* Test if analytics is enabled.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
* Test if analytics is enabled.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
*
* @usage
* ```
@ -231,12 +245,14 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isAnalyticsEnabled(): Promise<any> { return; }
isAnalyticsEnabled(): Promise<any> {
return;
}
/**
* Test if App ID and App Token is set.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
* Test if App ID and App Token is set.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
*
* @usage
* ```
@ -245,12 +261,14 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
isAuthorized(): Promise<any> { return; }
isAuthorized(): Promise<any> {
return;
}
/**
* Set App ID and App Token.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
* Set App ID and App Token.
*
* @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details}
*
* @usage
* ```
@ -261,7 +279,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
setupAppIDAndAppToken(appID: string, appToken: string): Promise<any> { return; }
setupAppIDAndAppToken(appID: string, appToken: string): Promise<any> {
return;
}
/**
* Start scanning for all nearby beacons using CoreBluetooth (no region object is used).
@ -282,7 +302,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
observable: true,
clearFunction: 'stopEstimoteBeaconDiscovery'
})
startEstimoteBeaconDiscovery(): Observable<any> { return; }
startEstimoteBeaconDiscovery(): Observable<any> {
return;
}
/**
* Stop CoreBluetooth scan. Available on iOS.
@ -299,7 +321,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopEstimoteBeaconDiscovery(): Promise<any> { return; }
stopEstimoteBeaconDiscovery(): Promise<any> {
return;
}
/**
* Start ranging beacons. Available on iOS and Android.
@ -322,7 +346,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
clearFunction: 'stopRangingBeaconsInRegion',
clearWithArgs: true
})
startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { return; }
startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> {
return;
}
/**
* Stop ranging beacons. Available on iOS and Android.
@ -341,7 +367,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> {
return;
}
/**
* Start ranging secure beacons. Available on iOS.
@ -356,7 +384,11 @@ export class EstimoteBeacons extends IonicNativePlugin {
clearFunction: 'stopRangingSecureBeaconsInRegion',
clearWithArgs: true
})
startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { return; }
startRangingSecureBeaconsInRegion(
region: EstimoteBeaconRegion
): Observable<any> {
return;
}
/**
* Stop ranging secure beacons. Available on iOS.
@ -365,7 +397,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> {
return;
}
/**
* Start monitoring beacons. Available on iOS and Android.
@ -391,7 +425,12 @@ export class EstimoteBeacons extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
startMonitoringForRegion(
region: EstimoteBeaconRegion,
notifyEntryStateOnDisplay: boolean
): Observable<any> {
return;
}
/**
* Stop monitoring beacons. Available on iOS and Android.
@ -405,7 +444,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> {
return;
}
/**
* Start monitoring secure beacons. Available on iOS.
@ -425,17 +466,24 @@ export class EstimoteBeacons extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { return; }
startSecureMonitoringForRegion(
region: EstimoteBeaconRegion,
notifyEntryStateOnDisplay: boolean
): Observable<any> {
return;
}
/**
* Stop monitoring secure beacons. Available on iOS.
* This function has the same parameters/behaviour as
* {@link EstimoteBeacons.stopMonitoringForRegion}.
* @param region {EstimoteBeaconRegion} Region
* @returns {Promise<any>}
*/
* Stop monitoring secure beacons. Available on iOS.
* This function has the same parameters/behaviour as
* {@link EstimoteBeacons.stopMonitoringForRegion}.
* @param region {EstimoteBeaconRegion} Region
* @returns {Promise<any>}
*/
@Cordova()
stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> {
return;
}
/**
* Connect to Estimote Beacon. Available on Android.
@ -455,7 +503,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
connectToBeacon(beacon: any): Promise<any> { return; }
connectToBeacon(beacon: any): Promise<any> {
return;
}
/**
* Disconnect from connected Estimote Beacon. Available on Android.
@ -467,7 +517,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
disconnectConnectedBeacon(): Promise<any> { return; }
disconnectConnectedBeacon(): Promise<any> {
return;
}
/**
* Write proximity UUID to connected Estimote Beacon. Available on Android.
@ -481,7 +533,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
writeConnectedProximityUUID(uuid: any): Promise<any> { return; }
writeConnectedProximityUUID(uuid: any): Promise<any> {
return;
}
/**
* Write major to connected Estimote Beacon. Available on Android.
@ -495,7 +549,9 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
writeConnectedMajor(major: number): Promise<any> { return; }
writeConnectedMajor(major: number): Promise<any> {
return;
}
/**
* Write minor to connected Estimote Beacon. Available on Android.
@ -509,6 +565,7 @@ export class EstimoteBeacons extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
writeConnectedMinor(minor: number): Promise<any> { return; }
writeConnectedMinor(minor: number): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Extended Device Information
@ -22,28 +22,24 @@ import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
pluginName: 'ExtendedDeviceInformation',
plugin: 'cordova-plugin-extended-device-information',
pluginRef: 'extended-device-information',
repo: 'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
repo:
'https://github.com/danielehrhardt/cordova-plugin-extended-device-information',
platforms: ['Android']
})
@Injectable()
export class ExtendedDeviceInformation extends IonicNativePlugin {
/**
* Get the device's memory size
*/
@CordovaProperty
memory: number;
@CordovaProperty memory: number;
/**
* Get the device's CPU mhz
*/
@CordovaProperty
cpumhz: string;
@CordovaProperty cpumhz: string;
/**
* Get the total storage
*/
@CordovaProperty
totalstorage: string;
@CordovaProperty totalstorage: string;
}

View File

@ -2,11 +2,9 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface FacebookLoginResponse {
status: string;
authResponse: {
session_key: boolean;
accessToken: string;
@ -18,9 +16,7 @@ export interface FacebookLoginResponse {
secret: string;
userID: string;
};
}
/**
@ -114,46 +110,46 @@ export interface FacebookLoginResponse {
plugin: 'cordova-plugin-facebook4',
pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
install: 'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
install:
'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
installVariables: ['APP_ID', 'APP_NAME'],
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class Facebook extends IonicNativePlugin {
EVENTS: {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app',
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app',
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions',
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions',
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration',
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view',
EVENT_NAME_SEARCHED: 'fb_mobile_search',
EVENT_NAME_RATED: 'fb_mobile_rate',
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion',
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token',
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart',
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist',
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout',
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info',
EVENT_NAME_PURCHASED: 'fb_mobile_purchase',
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved',
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked',
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits',
EVENT_PARAM_CURRENCY: 'fb_currency',
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method',
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type',
EVENT_PARAM_CONTENT_ID: 'fb_content_id',
EVENT_PARAM_SEARCH_STRING: 'fb_search_string',
EVENT_PARAM_SUCCESS: 'fb_success',
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value',
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available',
EVENT_PARAM_NUM_ITEMS: 'fb_num_items',
EVENT_PARAM_LEVEL: 'fb_level',
EVENT_PARAM_DESCRIPTION: 'fb_description',
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source',
EVENT_PARAM_VALUE_YES: '1',
EVENT_PARAM_VALUE_NO: '0'
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app';
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app';
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions';
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions';
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration';
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view';
EVENT_NAME_SEARCHED: 'fb_mobile_search';
EVENT_NAME_RATED: 'fb_mobile_rate';
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion';
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token';
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart';
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist';
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout';
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info';
EVENT_NAME_PURCHASED: 'fb_mobile_purchase';
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved';
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked';
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits';
EVENT_PARAM_CURRENCY: 'fb_currency';
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method';
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type';
EVENT_PARAM_CONTENT_ID: 'fb_content_id';
EVENT_PARAM_SEARCH_STRING: 'fb_search_string';
EVENT_PARAM_SUCCESS: 'fb_success';
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value';
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available';
EVENT_PARAM_NUM_ITEMS: 'fb_num_items';
EVENT_PARAM_LEVEL: 'fb_level';
EVENT_PARAM_DESCRIPTION: 'fb_description';
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source';
EVENT_PARAM_VALUE_YES: '1';
EVENT_PARAM_VALUE_NO: '0';
};
/**
@ -189,7 +185,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
*/
@Cordova()
login(permissions: string[]): Promise<FacebookLoginResponse> { return; }
login(permissions: string[]): Promise<FacebookLoginResponse> {
return;
}
/**
* Logout of Facebook.
@ -198,7 +196,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves on a successful logout, and rejects if logout fails.
*/
@Cordova()
logout(): Promise<any> { return; }
logout(): Promise<any> {
return;
}
/**
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
@ -227,7 +227,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with a status, or rejects with an error
*/
@Cordova()
getLoginStatus(): Promise<any> { return; }
getLoginStatus(): Promise<any> {
return;
}
/**
* Get a Facebook access token for using Facebook services.
@ -235,7 +237,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<string>} Returns a Promise that resolves with an access token, or rejects with an error
*/
@Cordova()
getAccessToken(): Promise<string> { return; }
getAccessToken(): Promise<string> {
return;
}
/**
* Show one of various Facebook dialogs. Example of options for a Share dialog:
@ -255,7 +259,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with success data, or rejects with an error
*/
@Cordova()
showDialog(options: any): Promise<any> { return; }
showDialog(options: any): Promise<any> {
return;
}
/**
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
@ -271,7 +277,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the result of the request, or rejects with an error
*/
@Cordova()
api(requestPath: string, permissions: string[]): Promise<any> { return; }
api(requestPath: string, permissions: string[]): Promise<any> {
return;
}
/**
* Log an event. For more information see the Events section above.
@ -285,7 +293,9 @@ export class Facebook extends IonicNativePlugin {
successIndex: 3,
errorIndex: 4
})
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> { return; }
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
return;
}
/**
* Log a purchase. For more information see the Events section above.
@ -295,7 +305,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
logPurchase(value: number, currency: string): Promise<any> { return; }
logPurchase(value: number, currency: string): Promise<any> {
return;
}
/**
* Open App Invite dialog. Does not require login.
@ -312,9 +324,7 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the result data, or rejects with an error
*/
@Cordova()
appInvite(options: {
url: string,
picture: string
}): Promise<any> { return; }
appInvite(options: { url: string; picture: string }): Promise<any> {
return;
}
}

View File

@ -1,9 +1,8 @@
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface NotificationData {
/**
* Determines whether the notification was pressed or not
*/
@ -15,7 +14,6 @@ export interface NotificationData {
*/
[name: string]: any;
}
/**
@ -64,14 +62,15 @@ export interface NotificationData {
})
@Injectable()
export class FCM extends IonicNativePlugin {
/**
* Get's device's current registration id
*
* @returns {Promise<string>} Returns a Promise that resolves with the registration id token
*/
@Cordova()
getToken(): Promise<string> { return; }
getToken(): Promise<string> {
return;
}
/**
* Event firing on the token refresh
@ -81,7 +80,9 @@ export class FCM extends IonicNativePlugin {
@Cordova({
observable: true
})
onTokenRefresh(): Observable<string> { return; }
onTokenRefresh(): Observable<string> {
return;
}
/**
* Subscribes you to a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
@ -91,7 +92,9 @@ export class FCM extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise resolving in result of subscribing to a topic
*/
@Cordova()
subscribeToTopic(topic: string): Promise<any> { return; }
subscribeToTopic(topic: string): Promise<any> {
return;
}
/**
* Unubscribes you from a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
@ -101,7 +104,9 @@ export class FCM extends IonicNativePlugin {
* @returns {Promise<any>} Returns a promise resolving in result of unsubscribing from a topic
*/
@Cordova()
unsubscribeFromTopic(topic: string): Promise<any> { return; }
unsubscribeFromTopic(topic: string): Promise<any> {
return;
}
/**
* Watch for incoming notifications
@ -113,6 +118,7 @@ export class FCM extends IonicNativePlugin {
successIndex: 0,
errorIndex: 2
})
onNotification(): Observable<NotificationData> { return; }
onNotification(): Observable<NotificationData> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name File Chooser
@ -30,12 +30,12 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class FileChooser extends IonicNativePlugin {
/**
* Open a file
* @returns {Promise<string>}
*/
@Cordova()
open(): Promise<string> { return; }
open(): Promise<string> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name File Encryption
@ -30,7 +30,6 @@ import { Injectable } from '@angular/core';
})
@Injectable()
export class FileEncryption extends IonicNativePlugin {
/**
* Enrcypt a file
* @param file {string} A string representing a local URI
@ -38,7 +37,9 @@ export class FileEncryption extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
encrypt(file: string, key: string): Promise<any> { return; }
encrypt(file: string, key: string): Promise<any> {
return;
}
/**
* Decrypt a file
@ -47,6 +48,7 @@ export class FileEncryption extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova()
decrypt(file: string, key: string): Promise<any> { return; }
decrypt(file: string, key: string): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name File Opener
@ -29,7 +29,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class FileOpener extends IonicNativePlugin {
/**
* Open an file
* @param filePath {string} File Path
@ -41,7 +40,9 @@ export class FileOpener extends IonicNativePlugin {
successName: 'success',
errorName: 'error'
})
open(filePath: string, fileMIMEType: string): Promise<any> { return; }
open(filePath: string, fileMIMEType: string): Promise<any> {
return;
}
/**
* Uninstalls a package
@ -53,7 +54,9 @@ export class FileOpener extends IonicNativePlugin {
successName: 'success',
errorName: 'error'
})
uninstall(packageId: string): Promise<any> { return; }
uninstall(packageId: string): Promise<any> {
return;
}
/**
* Check if an app is already installed
@ -65,6 +68,7 @@ export class FileOpener extends IonicNativePlugin {
successName: 'success',
errorName: 'error'
})
appIsInstalled(packageId: string): Promise<any> { return; }
appIsInstalled(packageId: string): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
declare const window: any;
@ -32,13 +32,13 @@ declare const window: any;
})
@Injectable()
export class FilePath extends IonicNativePlugin {
/**
* Resolve native path for given content URL/path.
* @param {String} path Content URL/path.
* @returns {Promise<string>}
*/
@Cordova()
resolveNativePath(path: string): Promise<string> { return; }
resolveNativePath(path: string): Promise<string> {
return;
}
}

View File

@ -1,8 +1,13 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import {
checkAvailability,
CordovaInstance,
InstanceCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
export interface FileUploadOptions {
/**
* The name of the form element.
* Defaults to 'file'.
@ -30,7 +35,7 @@ export interface FileUploadOptions {
/**
* A set of optional key/value pairs to pass in the HTTP request.
*/
params?: { [s: string]: any; };
params?: { [s: string]: any };
/**
* Whether to upload the data in chunked streaming mode.
@ -43,12 +48,10 @@ export interface FileUploadOptions {
* than one value. On iOS, FireOS, and Android, if a header named
* Content-Type is present, multipart form data will NOT be used.
*/
headers?: { [s: string]: any; };
headers?: { [s: string]: any };
}
export interface FileUploadResult {
/**
* The number of bytes sent to the server as part of the upload.
*/
@ -67,12 +70,10 @@ export interface FileUploadResult {
/**
* The HTTP response headers by the server.
*/
headers: { [s: string]: any; };
headers: { [s: string]: any };
}
export interface FileTransferError {
/**
* One of the predefined error codes listed below.
*/
@ -103,7 +104,6 @@ export interface FileTransferError {
* Either e.getMessage or e.toString.
*/
exception: string;
}
/**
@ -179,11 +179,18 @@ export interface FileTransferError {
plugin: 'cordova-plugin-file-transfer',
pluginRef: 'FileTransfer',
repo: 'https://github.com/apache/cordova-plugin-file-transfer',
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
platforms: [
'Amazon Fire OS',
'Android',
'Browser',
'iOS',
'Ubuntu',
'Windows',
'Windows Phone'
]
})
@Injectable()
export class FileTransfer extends IonicNativePlugin {
/**
* Error code rejected from upload with FileTransferError
* Defined in FileTransferError.
@ -209,7 +216,6 @@ export class FileTransfer extends IonicNativePlugin {
create(): FileTransferObject {
return new FileTransferObject();
}
}
/**
@ -223,7 +229,13 @@ export class FileTransferObject {
private _objectInstance: any;
constructor() {
if (checkAvailability(FileTransfer.getPluginRef(), null, FileTransfer.getPluginName()) === true) {
if (
checkAvailability(
FileTransfer.getPluginRef(),
null,
FileTransfer.getPluginName()
) === true
) {
this._objectInstance = new (FileTransfer.getPlugin())();
}
}
@ -241,7 +253,14 @@ export class FileTransferObject {
successIndex: 2,
errorIndex: 3
})
upload(fileUrl: string, url: string, options?: FileUploadOptions, trustAllHosts?: boolean): Promise<FileUploadResult> { return; }
upload(
fileUrl: string,
url: string,
options?: FileUploadOptions,
trustAllHosts?: boolean
): Promise<FileUploadResult> {
return;
}
/**
* Downloads a file from server.
@ -256,7 +275,14 @@ export class FileTransferObject {
successIndex: 2,
errorIndex: 3
})
download(source: string, target: string, trustAllHosts?: boolean, options?: { [s: string]: any; }): Promise<any> { return; }
download(
source: string,
target: string,
trustAllHosts?: boolean,
options?: { [s: string]: any }
): Promise<any> {
return;
}
/**
* Registers a listener that gets called whenever a new chunk of data is transferred.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface FingerprintOptions {
/**
@ -66,13 +65,14 @@ export interface FingerprintOptions {
})
@Injectable()
export class FingerprintAIO extends IonicNativePlugin {
/**
* Check if fingerprint authentication is available
* @return {Promise<any>} Returns a promise with result
*/
@Cordova()
isAvailable(): Promise<any> { return; }
isAvailable(): Promise<any> {
return;
}
/**
* Show authentication dialogue
@ -80,6 +80,7 @@ export class FingerprintAIO extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when authentication was successfull
*/
@Cordova()
show(options: FingerprintOptions): Promise<any> { return; }
show(options: FingerprintOptions): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @beta
@ -35,7 +35,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class FirebaseAnalytics extends IonicNativePlugin {
/**
* Logs an app event.
* Be aware of automatically collected events.
@ -44,7 +43,9 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova({ sync: true })
logEvent(name: string, params: any): Promise<any> { return; }
logEvent(name: string, params: any): Promise<any> {
return;
}
/**
* Sets the user ID property.
@ -53,7 +54,9 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova({ sync: true })
setUserId(id: string): Promise<any> { return; }
setUserId(id: string): Promise<any> {
return;
}
/**
* This feature must be used in accordance with Google's Privacy Policy.
@ -63,7 +66,9 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova({ sync: true })
setUserProperty(name: string, value: string): Promise<any> { return; }
setUserProperty(name: string, value: string): Promise<any> {
return;
}
/**
* Sets whether analytics collection is enabled for this app on this device.
@ -71,7 +76,9 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova({ sync: true })
setEnabled(enabled: boolean): Promise<any> { return; }
setEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Sets the current screen name, which specifies the current visual context in your app.
@ -80,6 +87,7 @@ export class FirebaseAnalytics extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova({ sync: true })
setCurrentScreen(name: string): Promise<any> { return; }
setCurrentScreen(name: string): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface DynamicLinksOptions {
title: string;
@ -66,19 +66,21 @@ export interface DynamicLinksOptions {
plugin: ' cordova-plugin-firebase-dynamiclinks',
pluginRef: 'cordova.plugins.firebase.dynamiclinks',
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks',
install: 'ionic cordova plugin add cordova-plugin-firebase-dynamiclinks --save --variable APP_DOMAIN="example.com" --variable APP_PATH="/"',
install:
'ionic cordova plugin add cordova-plugin-firebase-dynamiclinks --save --variable APP_DOMAIN="example.com" --variable APP_PATH="/"',
installVariables: ['APP_DOMAIN', 'APP_PATH'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseDynamicLinks extends IonicNativePlugin {
/**
* Registers callback that is triggered on each dynamic link click.
* @return {Promise<any>} Returns a promise
*/
@Cordova()
onDynamicLink(): Promise<any> { return; }
onDynamicLink(): Promise<any> {
return;
}
/**
* Display invitation dialog.
@ -86,6 +88,7 @@ export class FirebaseDynamicLinks extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
sendInvitation(options: DynamicLinksOptions): Promise<any> { return; }
sendInvitation(options: DynamicLinksOptions): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@ -30,7 +30,7 @@ import { Observable } from 'rxjs/Observable';
plugin: 'cordova-plugin-firebase',
pluginRef: 'FirebasePlugin',
repo: 'https://github.com/arnesson/cordova-plugin-firebase',
platforms: ['Android', 'iOS'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Firebase extends IonicNativePlugin {
@ -297,7 +297,10 @@ export class Firebase extends IonicNativePlugin {
successIndex: 2,
errorIndex: 3
})
verifyPhoneNumber(phoneNumber: string, timeoutDuration: number): Promise<any> {
verifyPhoneNumber(
phoneNumber: string,
timeoutDuration: number
): Promise<any> {
return;
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Flashlight
@ -28,35 +28,41 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Flashlight extends IonicNativePlugin {
/**
* Checks if the flashlight is available
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available.
*/
@Cordova()
available(): Promise<boolean> { return; }
available(): Promise<boolean> {
return;
}
/**
* Switches the flashlight on
* @returns {Promise<boolean>}
*/
@Cordova()
switchOn(): Promise<boolean> { return; }
switchOn(): Promise<boolean> {
return;
}
/**
* Switches the flashlight off
* @returns {Promise<boolean>}
*/
@Cordova()
switchOff(): Promise<boolean> { return; }
switchOff(): Promise<boolean> {
return;
}
/**
* Toggles the flashlight
* @returns {Promise<any>}
*/
@Cordova()
toggle(): Promise<any> { return; }
toggle(): Promise<any> {
return;
}
/**
* Checks if the flashlight is turned on.
@ -65,6 +71,7 @@ export class Flashlight extends IonicNativePlugin {
@Cordova({
sync: true
})
isSwitchedOn(): boolean { return; }
isSwitchedOn(): boolean {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Plugin, CordovaInstance, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import {
checkAvailability,
CordovaInstance,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
export interface FlurryAnalyticsOptions {
/** Flurry API key is required */
@ -73,11 +78,10 @@ export interface FlurryAnalyticsLocation {
}
/**
* @hidden
*/
* @hidden
*/
export class FlurryAnalyticsObject {
constructor(private _objectInstance: any) { }
constructor(private _objectInstance: any) {}
/**
* This function set the Event
@ -149,7 +153,10 @@ export class FlurryAnalyticsObject {
* @return {Promise<any>}
*/
@CordovaInstance()
setLocation(location: FlurryAnalyticsLocation, message: string): Promise<any> {
setLocation(
location: FlurryAnalyticsLocation,
message: string
): Promise<any> {
return;
}
@ -172,7 +179,6 @@ export class FlurryAnalyticsObject {
endSession(): Promise<any> {
return;
}
}
/**
@ -216,22 +222,24 @@ export class FlurryAnalyticsObject {
})
@Injectable()
export class FlurryAnalytics extends IonicNativePlugin {
/**
* Creates a new instance of FlurryAnalyticsObject
* @param options {FlurryAnalyticsOptions} options
* @return {FlurryAnalyticsObject}
*/
create(options: FlurryAnalyticsOptions): FlurryAnalyticsObject {
let instance: any;
if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) {
if (
checkAvailability(
FlurryAnalytics.pluginRef,
null,
FlurryAnalytics.pluginName
) === true
) {
instance = new (window as any).FlurryAnalytics(options);
}
return new FlurryAnalyticsObject(instance);
}
}

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* @name FTP
@ -32,18 +32,19 @@ import { Observable } from 'rxjs';
})
@Injectable()
export class FTP extends IonicNativePlugin {
/**
* Connect to one ftp server.
*
* Just need to init the connection once. If success, you can do any ftp actions later.
* @param hostname {string} The ftp server url. Like ip without protocol prefix, e.g. "192.168.1.1".
* @param username {string} The ftp login username. If it and `password` are all blank/undefined, the default username "anonymous" is used.
* @param password {string} The ftp login password. If it and `username` are all blank/undefined, the default password "anonymous@" is used.
* @return {Promise<any>} The success callback. Notice: For iOS, if triggered, means `init` success, but NOT means the later action, e.g. `ls`... `download` will success!
*/
* Connect to one ftp server.
*
* Just need to init the connection once. If success, you can do any ftp actions later.
* @param hostname {string} The ftp server url. Like ip without protocol prefix, e.g. "192.168.1.1".
* @param username {string} The ftp login username. If it and `password` are all blank/undefined, the default username "anonymous" is used.
* @param password {string} The ftp login password. If it and `username` are all blank/undefined, the default password "anonymous@" is used.
* @return {Promise<any>} The success callback. Notice: For iOS, if triggered, means `init` success, but NOT means the later action, e.g. `ls`... `download` will success!
*/
@Cordova()
connect(hostname: string, username: string, password: string): Promise<any> { return; }
connect(hostname: string, username: string, password: string): Promise<any> {
return;
}
/**
* List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server.
@ -60,7 +61,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
ls(path: string): Promise<any> { return; }
ls(path: string): Promise<any> {
return;
}
/**
* Create one directory on the ftp server.
@ -69,7 +72,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
mkdir(path: string): Promise<any> { return; }
mkdir(path: string): Promise<any> {
return;
}
/**
* Delete one directory on the ftp server.
@ -80,7 +85,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
rmdir(path: string): Promise<any> { return; }
rmdir(path: string): Promise<any> {
return;
}
/**
* Delete one file on the ftp server.
@ -89,7 +96,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
rm(file: string): Promise<any> { return; }
rm(file: string): Promise<any> {
return;
}
/**
* Upload one local file to the ftp server.
@ -103,7 +112,9 @@ export class FTP extends IonicNativePlugin {
@Cordova({
observable: true
})
upload(localFile: string, remoteFile: string): Observable<any> { return; }
upload(localFile: string, remoteFile: string): Observable<any> {
return;
}
/**
* Download one remote file on the ftp server to local path.
@ -117,7 +128,9 @@ export class FTP extends IonicNativePlugin {
@Cordova({
observable: true
})
download(localFile: string, remoteFile: string): Observable<any> { return; }
download(localFile: string, remoteFile: string): Observable<any> {
return;
}
/**
* Cancel all requests. Always success.
@ -125,7 +138,9 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
cancel(): Promise<any> { return; }
cancel(): Promise<any> {
return;
}
/**
* Disconnect from ftp server.
@ -133,6 +148,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
disconnect(): Promise<any> { return; }
disconnect(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaFunctionOverride,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const window: any;
@ -84,7 +89,6 @@ declare const window: any;
})
@Injectable()
export class Geofence extends IonicNativePlugin {
TransitionType = {
ENTER: 1,
EXIT: 2,
@ -96,7 +100,9 @@ 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 +110,9 @@ 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 +120,9 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
addOrUpdate(geofences: Object | Array<Object>): Promise<void> {
return;
}
/**
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
@ -121,7 +131,9 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>}
*/
@Cordova()
remove(geofenceId: string | Array<string>): Promise<void> { return; };
remove(geofenceId: string | Array<string>): Promise<void> {
return;
}
/**
* Removes all geofences.
@ -129,7 +141,9 @@ 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 +151,9 @@ 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.
@ -145,12 +161,11 @@ export class Geofence extends IonicNativePlugin {
* @returns {Observable<any>}
*/
onNotificationClicked(): Observable<any> {
return new Observable<any>((observer) => {
window && window.geofence && (window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => window.geofence.onNotificationClicked = () => { };
return new Observable<any>(observer => {
window &&
window.geofence &&
(window.geofence.onNotificationClicked = observer.next.bind(observer));
return () => (window.geofence.onNotificationClicked = () => {});
});
}
}

View File

@ -1,11 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
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;
}
/**
@ -153,13 +147,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.
*
@ -169,7 +163,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
@ -190,12 +186,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) => {
let watchId = navigator.geolocation.watchPosition(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.geolocation.clearWatch(watchId);
});
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Globalization
@ -36,20 +36,23 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Globalization extends IonicNativePlugin {
/**
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
* @returns {Promise<{value: string}>}
*/
@Cordova()
getPreferredLanguage(): Promise<{ value: string }> { return; }
getPreferredLanguage(): Promise<{ value: string }> {
return;
}
/**
* Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.
* @returns {Promise<{value: string}>}
*/
@Cordova()
getLocaleName(): Promise<{ value: string }> { return; }
getLocaleName(): Promise<{ value: string }> {
return;
}
/**
* Converts date to string
@ -61,7 +64,12 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
dateToString(date: Date, options: { formatLength: string, selector: string }): Promise<{ value: string }> { return; }
dateToString(
date: Date,
options: { formatLength: string; selector: string }
): Promise<{ value: string }> {
return;
}
/**
* Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object.
@ -73,7 +81,20 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
stringToDate(dateString: string, options: { formatLength: string, selector: string }): Promise<{ year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number }> { return; }
stringToDate(
dateString: string,
options: { formatLength: string; selector: string }
): Promise<{
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
millisecond: number;
}> {
return;
}
/**
* Returns a pattern string to format and parse dates according to the client's user preferences.
@ -83,7 +104,17 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getDatePattern(options: { formatLength: string, selector: string }): Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }> { return; }
getDatePattern(options: {
formatLength: string;
selector: string;
}): Promise<{
pattern: string;
timezone: string;
utf_offset: number;
dst_offset: number;
}> {
return;
}
/**
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
@ -93,7 +124,12 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getDateNames(options: { type: string, item: string }): Promise<{ value: Array<string> }> { return; }
getDateNames(options: {
type: string;
item: string;
}): Promise<{ value: Array<string> }> {
return;
}
/**
* Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
@ -101,14 +137,18 @@ export class Globalization extends IonicNativePlugin {
* @returns {Promise<{dst: string}>} reutrns a promise with the value
*/
@Cordova()
isDayLightSavingsTime(date: Date): Promise<{ dst: string }> { return; }
isDayLightSavingsTime(date: Date): Promise<{ dst: string }> {
return;
}
/**
* Returns the first day of the week according to the client's user preferences and calendar.
* @returns {Promise<{value: string}>} returns a promise with the value
*/
@Cordova()
getFirstDayOfWeek(): Promise<{ value: string }> { return; }
getFirstDayOfWeek(): Promise<{ value: string }> {
return;
}
/**
* Returns a number formatted as a string according to the client's user preferences.
@ -119,7 +159,12 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
numberToString(numberToConvert: number, options: { type: string }): Promise<{ value: string }> { return; }
numberToString(
numberToConvert: number,
options: { type: string }
): Promise<{ value: string }> {
return;
}
/**
*
@ -131,7 +176,12 @@ export class Globalization extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
stringToNumber(stringToConvert: string, options: { type: string }): Promise<{ value: number | string }> { return; }
stringToNumber(
stringToConvert: string,
options: { type: string }
): Promise<{ value: number | string }> {
return;
}
/**
* Returns a pattern string to format and parse numbers according to the client's user preferences.
@ -141,7 +191,20 @@ export class Globalization extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getNumberPattern(options: { type: string }): Promise<{ pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string }> { return; }
getNumberPattern(options: {
type: string;
}): Promise<{
pattern: string;
symbol: string;
fraction: number;
rounding: number;
positive: string;
negative: string;
decimal: string;
grouping: string;
}> {
return;
}
/**
* Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
@ -149,6 +212,16 @@ export class Globalization extends IonicNativePlugin {
* @returns {Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }>}
*/
@Cordova()
getCurrencyPattern(currencyCode: string): Promise<{ pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string }> { return; }
getCurrencyPattern(
currencyCode: string
): Promise<{
pattern: string;
code: string;
fraction: number;
rounding: number;
decimal: number;
grouping: string;
}> {
return;
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ScoreData {
/**
* The score to submit.
*/
@ -12,47 +11,37 @@ export interface ScoreData {
* The leaderboard ID from Google Play Developer console.
*/
leaderboardId: string;
}
export interface LeaderboardData {
/**
* The leaderboard ID from Goole Play Developer console.
*/
leaderboardId: string;
}
export interface AchievementData {
/**
* The achievement ID from Google Play Developer console.
*/
achievementId: string;
}
export interface IncrementableAchievementData extends AchievementData {
/**
* The amount to increment the achievement by.
*/
numSteps: number;
}
export interface SignedInResponse {
/**
* True or false is the use is signed in.
*/
isSignedIn: boolean;
}
export interface Player {
/**
* The players display name.
*/
@ -67,10 +56,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;
@ -80,7 +69,6 @@ export interface Player {
* null if the player has no profile image.
*/
hiResIconImageUrl: string;
}
/**
@ -101,12 +89,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 +102,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.'));
@ -158,107 +146,126 @@ export interface Player {
pluginRef: 'plugins.playGamesServices',
repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
platforms: ['Android'],
install: 'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID',
install:
'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID'
})
@Injectable()
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.
*/
@Cordova()
auth(): Promise<any> { return; }
auth(): Promise<any> {
return;
}
/**
* Sign out of Google Play Games Services.
*
*
* @return {Promise<any>} Returns a promise that resolve when the player
* successfully signs out.
*/
@Cordova()
signOut(): Promise<any> { return; }
signOut(): Promise<any> {
return;
}
/**
* Check if the user is signed in.
*
*
* @return {Promise<SignedInResponse>} Returns a promise that resolves with
* the signed in response.
*/
@Cordova()
isSignedIn(): Promise<SignedInResponse> { return; }
isSignedIn(): Promise<SignedInResponse> {
return;
}
/**
* 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()
showPlayer(): Promise<Player> { return; }
showPlayer(): Promise<Player> {
return;
}
/**
* 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.
*/
@Cordova()
submitScore(data: ScoreData): Promise<string> { return; }
submitScore(data: ScoreData): Promise<string> {
return;
}
/**
* 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.
*/
@Cordova()
showAllLeaderboards(): Promise<any> { return; }
showAllLeaderboards(): Promise<any> {
return;
}
/**
* 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.
*/
@Cordova()
showLeaderboard(data: LeaderboardData): Promise<any> { return; }
showLeaderboard(data: LeaderboardData): Promise<any> {
return;
}
/**
* Unlock an achievement.
*
*
* @param data {AchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is unlocked.
*/
@Cordova()
unlockAchievement(data: AchievementData): Promise<string> { return; }
unlockAchievement(data: AchievementData): Promise<string> {
return;
}
/**
* Increment an achievement.
*
*
* @param data {IncrementableAchievementData}
* @return {Promise<any>} Returns a promise that resolves when the
* achievement is incremented.
*/
@Cordova()
incrementAchievement(data: IncrementableAchievementData): Promise<string> { return; }
incrementAchievement(data: IncrementableAchievementData): Promise<string> {
return;
}
/**
* Lauches the native Play Games achievements view controller to show
* achievements.
*
*
* @return {Promise<any>} Returns a promise that resolves when the
* achievement window opens.
*/
@Cordova()
showAchievements(): Promise<any> { return; }
showAchievements(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Google Plus
@ -23,13 +23,13 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
plugin: 'cordova-plugin-googleplus',
pluginRef: 'window.plugins.googleplus',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
install: 'ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
install:
'ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
installVariables: ['REVERSED_CLIENT_ID'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class GooglePlus extends IonicNativePlugin {
/**
* The login function walks the user through the Google Auth process.
* @param options
@ -39,7 +39,9 @@ export class GooglePlus extends IonicNativePlugin {
successIndex: 1,
errorIndex: 2
})
login(options?: any): Promise<any> { return; }
login(options?: any): Promise<any> {
return;
}
/**
* You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
@ -47,27 +49,34 @@ export class GooglePlus extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
trySilentLogin(options?: any): Promise<any> { return; }
trySilentLogin(options?: any): Promise<any> {
return;
}
/**
* This will clear the OAuth2 token.
* @returns {Promise<any>}
*/
@Cordova()
logout(): Promise<any> { return; }
logout(): Promise<any> {
return;
}
/**
* This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
* @returns {Promise<any>}
*/
@Cordova()
disconnect(): Promise<any> { return; }
disconnect(): Promise<any> {
return;
}
/**
* This will retrieve the Android signing certificate fingerprint which is required in the Google Developer Console.
* @returns {Promise<any>}
*/
@Cordova()
getSigningCertificateFingerprint(): Promise<any> { return; }
getSigningCertificateFingerprint(): Promise<any> {
return;
}
}

View File

@ -1,6 +1,6 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const navigator: any;
@ -82,19 +82,20 @@ export interface GyroscopeOptions {
})
@Injectable()
export class Gyroscope extends IonicNativePlugin {
/**
* Watching for gyroscope sensor changes
* @param {GyroscopeOptions} [options]
* @return {Observable<GyroscopeOrientation>} Returns an Observable that resolves GyroscopeOrientation
*/
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);
return () => navigator.gyroscope.clearWatch(watchId);
}
);
return new Observable<GyroscopeOrientation>((observer: any) => {
let watchId = navigator.gyroscope.watch(
observer.next.bind(observer),
observer.next.bind(observer),
options
);
return () => navigator.gyroscope.clearWatch(watchId);
});
}
/**
@ -105,5 +106,7 @@ export class Gyroscope extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getCurrent(options?: GyroscopeOptions): Promise<GyroscopeOrientation> { return; }
getCurrent(options?: GyroscopeOptions): Promise<GyroscopeOrientation> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Header Color
@ -26,7 +26,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class HeaderColor extends IonicNativePlugin {
/**
* Set a color to the task header
* @param color {string} The hex value of the color
@ -37,6 +36,7 @@ export class HeaderColor extends IonicNativePlugin {
successName: 'success',
errorName: 'failure'
})
tint(color: string): Promise<any> { return; }
tint(color: string): Promise<any> {
return;
}
}

View File

@ -1,116 +1,116 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface HealthKitOptions {
/**
* HKWorkoutActivityType constant
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
*/
* HKWorkoutActivityType constant
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
*/
activityType?: string; //
/**
* 'hour', 'week', 'year' or 'day', default 'day'
*/
* 'hour', 'week', 'year' or 'day', default 'day'
*/
aggregation?: string;
/**
*
*/
*
*/
amount?: number;
/**
*
*/
*
*/
correlationType?: string;
/**
*
*/
*
*/
date?: any;
/**
*
*/
*
*/
distance?: number;
/**
* probably useful with the former param
*/
* probably useful with the former param
*/
distanceUnit?: string;
/**
* in seconds, optional, use either this or endDate
*/
* in seconds, optional, use either this or endDate
*/
duration?: number;
/**
*
*/
*
*/
endDate?: any;
/**
*
*/
*
*/
energy?: number;
/**
* J|cal|kcal
*/
* J|cal|kcal
*/
energyUnit?: string;
/**
*
*/
*
*/
extraData?: any;
/**
*
*/
*
*/
metadata?: any;
/**
*
*/
*
*/
quantityType?: string;
/**
*
*/
*
*/
readTypes?: any;
/**
*
*/
*
*/
requestWritePermission?: boolean;
/**
*
*/
*
*/
samples?: any;
/**
*
*/
*
*/
sampleType?: string;
/**
*
*/
*
*/
startDate?: any;
/**
* m|cm|mm|in|ft
*/
* m|cm|mm|in|ft
*/
unit?: string;
/**
*
*/
*
*/
requestReadPermission?: boolean;
/**
*
*/
*
*/
writeTypes?: any;
}
@ -142,168 +142,207 @@ export interface HealthKitOptions {
})
@Injectable()
export class HealthKit extends IonicNativePlugin {
/**
* Check if HealthKit is supported (iOS8+, not on iPad)
* @returns {Promise<any>}
*/
@Cordova()
available(): Promise<any> {
return;
}
/**
* Check if HealthKit is supported (iOS8+, not on iPad)
* @returns {Promise<any>}
*/
* Pass in a type and get back on of undetermined | denied | authorized
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
available(): Promise<any> { return; }
checkAuthStatus(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Pass in a type and get back on of undetermined | denied | authorized
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* Ask some or all permissions up front
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
checkAuthStatus(options: HealthKitOptions): Promise<any> { return; }
requestAuthorization(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Ask some or all permissions up front
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* Formatted as yyyy-MM-dd
* @returns {Promise<any>}
*/
@Cordova()
requestAuthorization(options: HealthKitOptions): Promise<any> { return; }
readDateOfBirth(): Promise<any> {
return;
}
/**
* Formatted as yyyy-MM-dd
* @returns {Promise<any>}
*/
* Output = male|female|other|unknown
* @returns {Promise<any>}
*/
@Cordova()
readDateOfBirth(): Promise<any> { return; }
readGender(): Promise<any> {
return;
}
/**
* Output = male|female|other|unknown
* @returns {Promise<any>}
*/
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
* @returns {Promise<any>}
*/
@Cordova()
readGender(): Promise<any> { return; }
readBloodType(): Promise<any> {
return;
}
/**
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
* @returns {Promise<any>}
*/
* Output = I|II|III|IV|V|VI|unknown
* @returns {Promise<any>}
*/
@Cordova()
readBloodType(): Promise<any> { return; }
readFitzpatrickSkinType(): Promise<any> {
return;
}
/**
* Output = I|II|III|IV|V|VI|unknown
* @returns {Promise<any>}
*/
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
readFitzpatrickSkinType(): Promise<any> { return; }
saveWeight(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
saveWeight(options: HealthKitOptions): Promise<any> { return; }
readWeight(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
readWeight(options: HealthKitOptions): Promise<any> { return; }
saveHeight(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
saveHeight(options: HealthKitOptions): Promise<any> { return; }
readHeight(options: HealthKitOptions): Promise<any> {
return;
}
/**
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
* no params yet, so this will return all workouts ever of any type
* @returns {Promise<any>}
*/
@Cordova()
readHeight(options: HealthKitOptions): Promise<any> { return; }
findWorkouts(): Promise<any> {
return;
}
/**
* no params yet, so this will return all workouts ever of any type
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
findWorkouts(): Promise<any> { return; }
saveWorkout(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
saveWorkout(options: HealthKitOptions): Promise<any> { return; }
querySampleType(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
querySampleType(options: HealthKitOptions): Promise<any> { return; }
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { return; }
deleteSamples(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
deleteSamples(options: HealthKitOptions): Promise<any> { return; }
monitorSampleType(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
monitorSampleType(options: HealthKitOptions): Promise<any> { return; }
sumQuantityType(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
sumQuantityType(options: HealthKitOptions): Promise<any> { return; }
saveQuantitySample(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
saveQuantitySample(options: HealthKitOptions): Promise<any> { return; }
saveCorrelation(options: HealthKitOptions): Promise<any> {
return;
}
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
saveCorrelation(options: HealthKitOptions): Promise<any> { return; }
/**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
queryCorrelationType(options: HealthKitOptions): Promise<any> { return; }
queryCorrelationType(options: HealthKitOptions): Promise<any> {
return;
}
}

View File

@ -1,18 +1,18 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @hidden
*/
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[];
}
@ -201,7 +201,6 @@ export interface HealthData {
})
@Injectable()
export class Health extends IonicNativePlugin {
/**
* Tells if either Google Fit or HealthKit are available.
*
@ -210,7 +209,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,
@ -226,7 +227,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
@ -248,7 +251,11 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
requestAuthorization(
datatypes: Array<string | HealthDataType>
): Promise<any> {
return;
}
/**
* Check if the app has authorization to read/write a set of datatypes.
@ -262,7 +269,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: Array<string | HealthDataType>): Promise<boolean> {
return;
}
/**
* Gets all the data points of a certain data type within a certain time window.
@ -296,7 +305,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.
@ -320,7 +331,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.
@ -337,6 +352,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>}
*/
@Cordova()
store(storeOptions: HealthStoreOptions): Promise<any> { return; }
store(storeOptions: HealthStoreOptions): Promise<any> {
return;
}
}

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface HotspotConnectionInfo {
/**
* The service set identifier (SSID) of the current 802.11 network.
*/
@ -27,11 +26,9 @@ export interface HotspotConnectionInfo {
* Each configured network has a unique small integer ID, used to identify the network when performing operations on the supplicant.
*/
networkID: string;
}
export interface HotspotNetwork {
/**
* Human readable network name
*/
@ -61,10 +58,8 @@ export interface HotspotNetwork {
* Describes the authentication, key management, and encryption schemes supported by the access point.
*/
capabilities: string;
}
export interface HotspotNetworkConfig {
/**
* Device IP Address
*/
@ -84,11 +79,9 @@ export interface HotspotNetworkConfig {
* Gateway MAC Address
*/
gatewayMacAddress: string;
}
export interface HotspotDevice {
/**
* Hotspot IP Address
*/
@ -98,7 +91,6 @@ export interface HotspotDevice {
* Hotspot MAC Address
*/
mac: string;
}
/**
@ -134,18 +126,21 @@ export interface HotspotDevice {
})
@Injectable()
export class Hotspot extends IonicNativePlugin {
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isAvailable(): Promise<boolean> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isAvailable(): Promise<boolean> { return; }
/**
* @returns {Promise<boolean>}
*/
@Cordova()
toggleWifi(): Promise<boolean> { return; }
toggleWifi(): Promise<boolean> {
return;
}
/**
* Configures and starts hotspot with SSID and Password
@ -157,7 +152,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<void>} - Promise to call once hotspot is started, or reject upon failure
*/
@Cordova()
createHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
createHotspot(ssid: string, mode: string, password: string): Promise<void> {
return;
}
/**
* Turns on Access Point
@ -165,7 +162,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<boolean>} - true if AP is started
*/
@Cordova()
startHotspot(): Promise<boolean> { return; }
startHotspot(): Promise<boolean> {
return;
}
/**
* Configures hotspot with SSID and Password
@ -177,7 +176,13 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<void>} - Promise to call when hotspot is configured, or reject upon failure
*/
@Cordova()
configureHotspot(ssid: string, mode: string, password: string): Promise<void> { return; }
configureHotspot(
ssid: string,
mode: string,
password: string
): Promise<void> {
return;
}
/**
* Turns off Access Point
@ -185,7 +190,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<boolean>} - Promise to turn off the hotspot, true on success, false on failure
*/
@Cordova()
stopHotspot(): Promise<boolean> { return; }
stopHotspot(): Promise<boolean> {
return;
}
/**
* Checks if hotspot is enabled
@ -193,13 +200,17 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<void>} - Promise that hotspot is enabled, rejected if it is not enabled
*/
@Cordova()
isHotspotEnabled(): Promise<void> { return; }
isHotspotEnabled(): Promise<void> {
return;
}
/**
* @returns {Promise<Array<HotspotDevice>>}
*/
@Cordova()
getAllHotspotDevices(): Promise<Array<HotspotDevice>> { return; }
getAllHotspotDevices(): Promise<Array<HotspotDevice>> {
return;
}
/**
* Connect to a WiFi network
@ -213,7 +224,9 @@ export class Hotspot extends IonicNativePlugin {
* Promise that connection to the WiFi network was successfull, rejected if unsuccessful
*/
@Cordova()
connectToWifi(ssid: string, password: string): Promise<void> { return; }
connectToWifi(ssid: string, password: string): Promise<void> {
return;
}
/**
* Connect to a WiFi network
@ -231,7 +244,14 @@ 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: Array<string>
): Promise<void> {
return;
}
/**
* Add a WiFi network
@ -247,7 +267,9 @@ export class Hotspot extends IonicNativePlugin {
* Promise that adding the WiFi network was successfull, rejected if unsuccessful
*/
@Cordova()
addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> { return; }
addWifiNetwork(ssid: string, mode: string, password: string): Promise<void> {
return;
}
/**
* Remove a WiFi network
@ -259,79 +281,105 @@ export class Hotspot extends IonicNativePlugin {
* Promise that removing the WiFi network was successfull, rejected if unsuccessful
*/
@Cordova()
removeWifiNetwork(ssid: string): Promise<void> { return; }
removeWifiNetwork(ssid: string): Promise<void> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isConnectedToInternet(): Promise<boolean> { return; }
isConnectedToInternet(): Promise<boolean> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isConnectedToInternetViaWifi(): Promise<boolean> { return; }
isConnectedToInternetViaWifi(): Promise<boolean> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isWifiOn(): Promise<boolean> { return; }
isWifiOn(): Promise<boolean> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isWifiSupported(): Promise<boolean> { return; }
isWifiSupported(): Promise<boolean> {
return;
}
/**
* @returns {Promise<boolean>}
*/
@Cordova()
isWifiDirectSupported(): Promise<boolean> { return; }
isWifiDirectSupported(): Promise<boolean> {
return;
}
/**
* @returns {Promise<Array<HotspotNetwork>>}
*/
@Cordova()
scanWifi(): Promise<Array<HotspotNetwork>> { return; }
scanWifi(): Promise<Array<HotspotNetwork>> {
return;
}
/**
* @returns {Promise<Array<HotspotNetwork>>}
*/
@Cordova()
scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
scanWifiByLevel(): Promise<Array<HotspotNetwork>> {
return;
}
/**
* @returns {Promise<any>}
*/
@Cordova()
startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> {
return;
}
/**
* @returns {Promise<any>}
*/
@Cordova()
stopWifiPeriodicallyScan(): Promise<any> { return; }
stopWifiPeriodicallyScan(): Promise<any> {
return;
}
/**
* @returns {Promise<HotspotNetworkConfig>}
*/
@Cordova()
getNetConfig(): Promise<HotspotNetworkConfig> { return; }
getNetConfig(): Promise<HotspotNetworkConfig> {
return;
}
/**
* @returns {Promise<HotspotConnectionInfo>}
*/
@Cordova()
getConnectionInfo(): Promise<HotspotConnectionInfo> { return; }
getConnectionInfo(): Promise<HotspotConnectionInfo> {
return;
}
/**
* @returns {Promise<string>}
*/
@Cordova()
pingHost(ip: string): Promise<string> { return; }
pingHost(ip: string): Promise<string> {
return;
}
/**
* Gets MAC Address associated with IP Address from ARP File
@ -341,7 +389,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<string>} - A Promise for the MAC Address
*/
@Cordova()
getMacAddressOfHost(ip: string): Promise<string> { return; }
getMacAddressOfHost(ip: string): Promise<string> {
return;
}
/**
* Checks if IP is live using DNS
@ -351,7 +401,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
*/
@Cordova()
isDnsLive(ip: string): Promise<boolean> { return; }
isDnsLive(ip: string): Promise<boolean> {
return;
}
/**
* Checks if IP is live using socket And PORT
@ -361,7 +413,9 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<boolean>} - A Promise for whether the IP Address is reachable
*/
@Cordova()
isPortLive(ip: string): Promise<boolean> { return; }
isPortLive(ip: string): Promise<boolean> {
return;
}
/**
* Checks if device is rooted
@ -369,6 +423,7 @@ export class Hotspot extends IonicNativePlugin {
* @returns {Promise<boolean>} - A Promise for whether the device is rooted
*/
@Cordova()
isRooted(): Promise<boolean> { return; }
isRooted(): Promise<boolean> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface HTTPResponse {
/**
@ -66,7 +66,6 @@ export interface HTTPResponse {
})
@Injectable()
export class HTTP extends IonicNativePlugin {
/**
* This returns an object representing a basic HTTP Authorization header of the form.
* @param username {string} Username
@ -74,7 +73,12 @@ export class HTTP extends IonicNativePlugin {
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
*/
@Cordova({ sync: true })
getBasicAuthHeader(username: string, password: string): { Authorization: string; } { return; }
getBasicAuthHeader(
username: string,
password: string
): { Authorization: string } {
return;
}
/**
* This sets up all future requests to use Basic HTTP authentication with the given username and password.
@ -82,7 +86,7 @@ export class HTTP extends IonicNativePlugin {
* @param password {string} Password
*/
@Cordova({ sync: true })
useBasicAuth(username: string, password: string): void { }
useBasicAuth(username: string, password: string): void {}
/**
* Set a header for all future requests. Takes a header and a value.
@ -90,20 +94,20 @@ export class HTTP extends IonicNativePlugin {
* @param value {string} The value of the header
*/
@Cordova({ sync: true })
setHeader(header: string, value: string): void { }
setHeader(header: string, value: string): void {}
/**
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
* @param serializer {string} The name of the serializer. Can be urlencoded or json
*/
@Cordova({ sync: true })
setDataSerializer(serializer: string): void { }
setDataSerializer(serializer: string): void {}
/**
* Clear all cookies
*/
@Cordova({ sync: true })
clearCookies(): void { }
clearCookies(): void {}
/**
* Remove cookies
@ -111,21 +115,21 @@ export class HTTP extends IonicNativePlugin {
* @param cb
*/
@Cordova({ sync: true })
removeCookies(url: string, cb: () => void): void { }
removeCookies(url: string, cb: () => void): void {}
/**
* Disable following redirects automatically
* @param disable {boolean} Set to true to disable following redirects automatically
*/
@Cordova({ sync: true })
disableRedirect(disable: boolean): void { }
disableRedirect(disable: boolean): void {}
/**
* Set request timeout
* @param timeout {number} The timeout in seconds. Default 60
*/
@Cordova({ sync: true })
setRequestTimeout(timeout: number): void { }
setRequestTimeout(timeout: number): void {}
/**
* Enable or disable SSL Pinning. This defaults to false.
@ -137,7 +141,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
enableSSLPinning(enable: boolean): Promise<void> { return; }
enableSSLPinning(enable: boolean): Promise<void> {
return;
}
/**
* Accept all SSL certificates. Or disabled accepting all certificates. Defaults to false.
@ -145,7 +151,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
acceptAllCerts(accept: boolean): Promise<void> { return; }
acceptAllCerts(accept: boolean): Promise<void> {
return;
}
/**
* Make a POST request
@ -155,7 +163,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
post(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
post(url: string, body: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make a GET request
@ -165,7 +175,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make a PUT request
@ -175,7 +187,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
put(url: string, body: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make a PATCH request
@ -185,7 +199,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
patch(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }
patch(url: string, body: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make a DELETE request
@ -195,7 +211,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
* Make a HEAD request
@ -205,7 +223,9 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> { return; }
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
return;
}
/**
*
@ -217,7 +237,15 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<HTTPResponse> { return; }
uploadFile(
url: string,
body: any,
headers: any,
filePath: string,
name: string
): Promise<HTTPResponse> {
return;
}
/**
*
@ -228,5 +256,12 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<HTTPResponse> { return; }
downloadFile(
url: string,
body: any,
headers: any,
filePath: string
): Promise<HTTPResponse> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface HttpdOptions {
@ -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

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @beta
@ -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({
@ -75,7 +75,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the result text (which is the same as the given text) if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
helloWorld(text: String): Promise<String> { return; }
helloWorld(text: String): Promise<String> {
return;
}
/**
* Create a new user to identify the current device or get a user from a lookup id.
@ -86,7 +88,14 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the User's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
getOrCreateUser(name: String, phone: String, photo: String, lookupId: String): Promise<any> { return; }
getOrCreateUser(
name: String,
phone: String,
photo: String,
lookupId: String
): Promise<any> {
return;
}
/**
* Set UserId for the SDK created using HyperTrack APIs. This is useful if you already have a user previously created.
@ -94,14 +103,18 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred. An "OK" response doesn't necessarily mean that the userId was found. It just means that it was set correctly.
*/
@Cordova()
setUserId(userId: String): Promise<any> { return; }
setUserId(userId: String): Promise<any> {
return;
}
/**
* Enable the SDK and start tracking. This will fail if there is no user set.
* @returns {Promise<any>} Returns a Promise that resolves with the userId (String) of the User being tracked if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
startTracking(): Promise<any> { return; }
startTracking(): Promise<any> {
return;
}
/**
* Create and assign an action to the current user using specified parameters
@ -113,7 +126,15 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Action's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
createAndAssignAction(type: String, lookupId: String, expectedPlaceAddress: String, expectedPlaceLatitude: Number, expectedPlaceLongitude: Number): Promise<any> { return; }
createAndAssignAction(
type: String,
lookupId: String,
expectedPlaceAddress: String,
expectedPlaceLatitude: Number,
expectedPlaceLongitude: Number
): Promise<any> {
return;
}
/**
* Complete an action from the SDK by its ID
@ -121,7 +142,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeAction(actionId: String): Promise<any> { return; }
completeAction(actionId: String): Promise<any> {
return;
}
/**
* Complete an action from the SDK using Action's lookupId as parameter
@ -129,7 +152,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeActionWithLookupId(lookupId: String): Promise<any> { return; }
completeActionWithLookupId(lookupId: String): Promise<any> {
return;
}
/**
* Disable the SDK and stop tracking.
@ -137,14 +162,18 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the an "OK" string if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
stopTracking(): Promise<any> { return; }
stopTracking(): Promise<any> {
return;
}
/**
* Get user's current location from the SDK
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Location's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
getCurrentLocation(): Promise<any> { return; }
getCurrentLocation(): Promise<any> {
return;
}
/**
* Check if Location permission has been granted to the app (for Android).
@ -152,7 +181,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location permission was granted, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationPermission(): Promise<any> { return; }
checkLocationPermission(): Promise<any> {
return;
}
/**
* Request user to grant Location access to the app (for Anrdoid).
@ -160,7 +191,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location access was given to the app, or it gets rejected if an error ocurred.
*/
@Cordova()
requestPermissions(): Promise<any> { return; }
requestPermissions(): Promise<any> {
return;
}
/**
* Check if Location services are enabled on the device (for Android).
@ -168,7 +201,9 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location services are enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationServices(): Promise<any> { return; }
checkLocationServices(): Promise<any> {
return;
}
/**
* Request user to enable Location services on the device.
@ -176,5 +211,7 @@ export class HyperTrack extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location services were enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
requestLocationServices(): Promise<any> { return; }
requestLocationServices(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const cordova: any;
@ -29,7 +34,11 @@ export interface Beacon {
* ProximityFar
* ProximityUnknown
*/
proximity: 'ProximityImmediate' | 'ProximityNear' | 'ProximityFar' | 'ProximityUnknown';
proximity:
| 'ProximityImmediate'
| 'ProximityNear'
| 'ProximityFar'
| 'ProximityUnknown';
/**
* Transmission Power of the beacon. A constant emitted by the beacon which indicates what's the expected RSSI at a distance of 1 meter to the beacon.
@ -46,7 +55,6 @@ export interface Beacon {
* The accuracy of the ranging.
*/
accuracy: number;
}
export interface BeaconRegion {
@ -104,7 +112,6 @@ export interface CircularRegion {
export type Region = BeaconRegion | CircularRegion;
export interface IBeaconPluginResult {
/**
* The name of the delegate function that produced the PluginResult object.
*/
@ -287,7 +294,6 @@ export interface IBeaconDelegate {
})
@Injectable()
export class IBeacon extends IonicNativePlugin {
/**
* Instances of this class are delegates between the {@link LocationManager} and
* the code that consumes the messages generated on in the native layer.
@ -298,85 +304,79 @@ export class IBeacon extends IonicNativePlugin {
Delegate(): IBeaconDelegate {
let delegate = new cordova.plugins.locationManager.Delegate();
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didChangeAuthorizationStatus = cb;
}
);
delegate.didChangeAuthorizationStatus = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didChangeAuthorizationStatus = cb);
});
};
delegate.didDetermineStateForRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didDetermineStateForRegion = cb;
}
);
delegate.didDetermineStateForRegion = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didDetermineStateForRegion = cb);
});
};
delegate.didEnterRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didEnterRegion = cb;
}
);
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didEnterRegion = cb);
});
};
delegate.didExitRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didExitRegion = cb;
}
);
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didExitRegion = cb);
});
};
delegate.didRangeBeaconsInRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didRangeBeaconsInRegion = cb;
}
);
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didRangeBeaconsInRegion = cb);
});
};
delegate.didStartMonitoringForRegion = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.didStartMonitoringForRegion = cb;
}
);
delegate.didStartMonitoringForRegion = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.didStartMonitoringForRegion = cb);
});
};
delegate.monitoringDidFailForRegionWithError = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.monitoringDidFailForRegionWithError = cb;
}
);
delegate.monitoringDidFailForRegionWithError = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.monitoringDidFailForRegionWithError = cb);
});
};
delegate.peripheralManagerDidStartAdvertising = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.peripheralManagerDidStartAdvertising = cb;
}
);
delegate.peripheralManagerDidStartAdvertising = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.peripheralManagerDidStartAdvertising = cb);
});
};
delegate.peripheralManagerDidUpdateState = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>(
(observer: any) => {
let cb = (data: IBeaconPluginResult) => observer.next(data);
return delegate.peripheralManagerDidUpdateState = cb;
}
);
delegate.peripheralManagerDidUpdateState = (
pluginResult?: IBeaconPluginResult
) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
const cb = (data: IBeaconPluginResult) => observer.next(data);
return (delegate.peripheralManagerDidUpdateState = cb);
});
};
cordova.plugins.locationManager.setDelegate(delegate);
@ -396,15 +396,29 @@ export class IBeacon extends IonicNativePlugin {
* @returns {BeaconRegion} Returns the BeaconRegion that was created
*/
@CordovaCheck({ sync: true })
BeaconRegion(identifer: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion {
return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
BeaconRegion(
identifer: string,
uuid: string,
major?: number,
minor?: number,
notifyEntryStateOnDisplay?: boolean
): BeaconRegion {
return new cordova.plugins.locationManager.BeaconRegion(
identifer,
uuid,
major,
minor,
notifyEntryStateOnDisplay
);
}
/**
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
*/
@Cordova()
getDelegate(): IBeaconDelegate { return; }
getDelegate(): IBeaconDelegate {
return;
}
/**
* @param {IBeaconDelegate} delegate An instance of a delegate to register with the native layer.
@ -412,7 +426,9 @@ export class IBeacon extends IonicNativePlugin {
* @returns {IBeaconDelegate} Returns the IBeaconDelegate
*/
@Cordova()
setDelegate(delegate: IBeaconDelegate): IBeaconDelegate { return; }
setDelegate(delegate: IBeaconDelegate): IBeaconDelegate {
return;
}
/**
* Signals the native layer that the client side is ready to consume messages.
@ -435,7 +451,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the request and started to send events.
*/
@Cordova({ otherPromise: true })
onDomDelegateReady(): Promise<void> { return; }
onDomDelegateReady(): Promise<void> {
return;
}
/**
* Determines if bluetooth is switched on, according to the native layer.
@ -443,7 +461,9 @@ export class IBeacon extends IonicNativePlugin {
* indicating whether bluetooth is active.
*/
@Cordova({ otherPromise: true })
isBluetoothEnabled(): Promise<boolean> { return; }
isBluetoothEnabled(): Promise<boolean> {
return;
}
/**
* Enables Bluetooth using the native Layer. (ANDROID ONLY)
@ -452,7 +472,9 @@ export class IBeacon extends IonicNativePlugin {
* could be enabled. If not, the promise will be rejected with an error.
*/
@Cordova({ otherPromise: true })
enableBluetooth(): Promise<void> { return; }
enableBluetooth(): Promise<void> {
return;
}
/**
* Disables Bluetooth using the native Layer. (ANDROID ONLY)
@ -461,7 +483,9 @@ export class IBeacon extends IonicNativePlugin {
* could be enabled. If not, the promise will be rejected with an error.
*/
@Cordova({ otherPromise: true })
disableBluetooth(): Promise<void> { return; }
disableBluetooth(): Promise<void> {
return;
}
/**
* Start monitoring the specified region.
@ -481,7 +505,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the monitoring request.
*/
@Cordova({ otherPromise: true })
startMonitoringForRegion(region: BeaconRegion): Promise<string> { return; }
startMonitoringForRegion(region: BeaconRegion): Promise<string> {
return;
}
/**
* Stop monitoring the specified region. It is valid to call
@ -498,7 +524,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the request to stop monitoring.
*/
@Cordova({ otherPromise: true })
stopMonitoringForRegion(region: BeaconRegion): Promise<void> { return; }
stopMonitoringForRegion(region: BeaconRegion): Promise<void> {
return;
}
/**
* Request state the for specified region. When result is ready
@ -514,8 +542,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the request to stop monitoring.
*/
@Cordova({ otherPromise: true })
requestStateForRegion(region: Region): Promise<void> { return; }
requestStateForRegion(region: Region): Promise<void> {
return;
}
/**
* Start ranging the specified beacon region.
@ -532,7 +561,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the monitoring request.
*/
@Cordova({ otherPromise: true })
startRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
startRangingBeaconsInRegion(region: BeaconRegion): Promise<void> {
return;
}
/**
* Stop ranging the specified region. It is valid to call
@ -549,7 +580,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the request to stop monitoring.
*/
@Cordova({ otherPromise: true })
stopRangingBeaconsInRegion(region: BeaconRegion): Promise<void> { return; }
stopRangingBeaconsInRegion(region: BeaconRegion): Promise<void> {
return;
}
/**
* Queries the native layer to determine the current authorization in effect.
@ -558,7 +591,9 @@ export class IBeacon extends IonicNativePlugin {
* requested authorization status.
*/
@Cordova({ otherPromise: true })
getAuthorizationStatus(): Promise<IBeaconPluginResult> { return; }
getAuthorizationStatus(): Promise<IBeaconPluginResult> {
return;
}
/**
* For iOS 8 and above only. The permission model has changed by Apple in iOS 8, making it necessary for apps to
@ -570,8 +605,9 @@ export class IBeacon extends IonicNativePlugin {
* @returns {Promise<void>} Returns a promise that is resolved when the request dialog is shown.
*/
@Cordova({ otherPromise: true })
requestWhenInUseAuthorization(): Promise<void> { return; }
requestWhenInUseAuthorization(): Promise<void> {
return;
}
/**
* See the documentation of {@code requestWhenInUseAuthorization} for further details.
@ -580,7 +616,9 @@ export class IBeacon extends IonicNativePlugin {
* shows the request dialog.
*/
@Cordova({ otherPromise: true })
requestAlwaysAuthorization(): Promise<void> { return; }
requestAlwaysAuthorization(): Promise<void> {
return;
}
/**
*
@ -588,7 +626,9 @@ export class IBeacon extends IonicNativePlugin {
* of {Region} instances that are being monitored by the native layer.
*/
@Cordova({ otherPromise: true })
getMonitoredRegions(): Promise<Region[]> { return; }
getMonitoredRegions(): Promise<Region[]> {
return;
}
/**
*
@ -596,7 +636,9 @@ export class IBeacon extends IonicNativePlugin {
* of {Region} instances that are being ranged by the native layer.
*/
@Cordova({ otherPromise: true })
getRangedRegions(): Promise<Region[]> { return; }
getRangedRegions(): Promise<Region[]> {
return;
}
/**
* Determines if ranging is available or not, according to the native layer.
@ -604,7 +646,9 @@ export class IBeacon extends IonicNativePlugin {
* indicating whether ranging is available or not.
*/
@Cordova({ otherPromise: true })
isRangingAvailable(): Promise<boolean> { return; }
isRangingAvailable(): Promise<boolean> {
return;
}
/**
* Determines if region type is supported or not, according to the native layer.
@ -616,7 +660,9 @@ export class IBeacon extends IonicNativePlugin {
* indicating whether the region type is supported or not.
*/
@Cordova({ otherPromise: true })
isMonitoringAvailableForClass(region: Region): Promise<boolean> { return; }
isMonitoringAvailableForClass(region: Region): Promise<boolean> {
return;
}
/**
* Start advertising the specified region.
@ -636,7 +682,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the advertising request.
*/
@Cordova({ otherPromise: true })
startAdvertising(region: Region, measuredPower?: number): Promise<void> { return; }
startAdvertising(region: Region, measuredPower?: number): Promise<void> {
return;
}
/**
* Stop advertising as a beacon.
@ -647,7 +695,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer acknowledged the dispatch of the request to stop advertising.
*/
@Cordova({ otherPromise: true })
stopAdvertising(region: Region): Promise<void> { return; }
stopAdvertising(region: Region): Promise<void> {
return;
}
/**
* Determines if advertising is available or not, according to the native layer.
@ -655,7 +705,9 @@ export class IBeacon extends IonicNativePlugin {
* indicating whether advertising is available or not.
*/
@Cordova({ otherPromise: true })
isAdvertisingAvailable(): Promise<boolean> { return; }
isAdvertisingAvailable(): Promise<boolean> {
return;
}
/**
* Determines if advertising is currently active, according to the native layer.
@ -663,7 +715,9 @@ export class IBeacon extends IonicNativePlugin {
* indicating whether advertising is active.
*/
@Cordova({ otherPromise: true })
isAdvertising(): Promise<boolean> { return; }
isAdvertising(): Promise<boolean> {
return;
}
/**
* Disables debug logging in the native layer. Use this method if you want
@ -673,7 +727,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer has set the logging level accordingly.
*/
@Cordova({ otherPromise: true })
disableDebugLogs(): Promise<void> { return; }
disableDebugLogs(): Promise<void> {
return;
}
/**
* Enables the posting of debug notifications in the native layer. Use this method if you want
@ -684,7 +740,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer has set the flag to enabled.
*/
@Cordova({ otherPromise: true })
enableDebugNotifications(): Promise<void> { return; }
enableDebugNotifications(): Promise<void> {
return;
}
/**
* Disables the posting of debug notifications in the native layer. Use this method if you want
@ -694,7 +752,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer has set the flag to disabled.
*/
@Cordova({ otherPromise: true })
disableDebugNotifications(): Promise<void> { return; }
disableDebugNotifications(): Promise<void> {
return;
}
/**
* Enables debug logging in the native layer. Use this method if you want
@ -704,7 +764,9 @@ export class IBeacon extends IonicNativePlugin {
* native layer has set the logging level accordingly.
*/
@Cordova({ otherPromise: true })
enableDebugLogs(): Promise<void> { return; }
enableDebugLogs(): Promise<void> {
return;
}
/**
* Appends the provided [message] to the device logs.
@ -717,6 +779,7 @@ export class IBeacon extends IonicNativePlugin {
* is expected to be equivalent to the one provided in the original call.
*/
@Cordova({ otherPromise: true })
appendToDeviceLog(message: string): Promise<void> { return; }
appendToDeviceLog(message: string): Promise<void> {
return;
}
}

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ImagePickerOptions {
/**
@ -60,7 +59,8 @@ export interface ImagePickerOptions {
plugin: 'cordova-plugin-telerik-imagepicker',
pluginRef: 'window.imagePicker',
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
install: 'ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
install:
'ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
platforms: ['Android', 'iOS']
})
@ -75,7 +75,9 @@ export class ImagePicker extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
getPictures(options: ImagePickerOptions): Promise<any> { return; }
getPictures(options: ImagePickerOptions): Promise<any> {
return;
}
/**
* Check if we have permission to read images
@ -84,7 +86,9 @@ export class ImagePicker extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
hasReadPermission(): Promise<boolean> { return; }
hasReadPermission(): Promise<boolean> {
return;
}
/**
* Request permission to read images
@ -93,6 +97,7 @@ export class ImagePicker extends IonicNativePlugin {
@Cordova({
platforms: ['Android']
})
requestReadPermission(): Promise<any> { return; }
requestReadPermission(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ImageResizerOptions {
/**
@ -80,5 +80,7 @@ export class ImageResizer extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
resize(options: ImageResizerOptions): Promise<any> { return; }
resize(options: ImageResizerOptions): Promise<any> {
return;
}
}

View File

@ -1,15 +1,22 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
import {
CordovaInstance,
InstanceCheck,
IonicNativePlugin,
Plugin
} 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.
* Omit or set to no (default) to have the browser open and load normally. */
/**
* 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';
@ -17,8 +24,10 @@ export interface InAppBrowserOptions {
clearsessioncache?: 'yes';
/** (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';
/** 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. */
/**
* 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';
@ -45,8 +54,10 @@ export interface InAppBrowserOptions {
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
/** (iOS Only) Set to top or bottom (default is bottom). Causes the toolbar to be at the top or bottom of the window. */
toolbarposition?: 'top' | 'bottom';
/** (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. */
/**
* (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';
/**
@ -69,7 +80,6 @@ export interface InAppBrowserEvent extends Event {
* @hidden
*/
export class InAppBrowserObject {
private _objectInstance: any;
/**
@ -83,20 +93,24 @@ 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}=${(<InAppBrowserOptions>options)[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.'
);
}
}
@ -105,20 +119,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.
@ -126,7 +140,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.
@ -134,7 +150,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.
@ -143,10 +161,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)
);
}
);
}
}
@ -185,7 +212,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.
@ -195,8 +221,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

@ -1,5 +1,10 @@
import { Plugin, IonicNativePlugin, Cordova, CordovaProperty } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import {
Cordova,
CordovaProperty,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
/**
* @name In App Purchase 2
@ -81,21 +86,22 @@ export type IAPProducts = Array<IAPProduct> & {
/**
* Get product by ID
*/
byId: { [id: string]: IAPProduct; };
byId: { [id: string]: IAPProduct };
/**
* Get product by alias
*/
byAlias: { [alias: string]: IAPProduct; };
byAlias: { [alias: string]: IAPProduct };
/**
* Remove all products (for testing only).
*/
reset: () => {};
};
export type IAPQueryCallback = ((product: IAPProduct) => void) | ((error: IAPError) => void);
export type IAPQueryCallback =
| ((product: IAPProduct) => void)
| ((error: IAPError) => void);
export interface IAPProduct {
id: string;
alias: string;
@ -145,7 +151,6 @@ export interface IAPProduct {
off(callback: Function): void;
trigger(action: string, args: any): void;
}
export interface IAPProductEvents {
@ -165,7 +170,11 @@ export interface IAPProductEvents {
verified: (callback: IAPQueryCallback) => void;
unverified: (callback: IAPQueryCallback) => void;
expired: (callback: IAPQueryCallback) => void;
downloading: (product: IAPProduct, progress: any, time_remaining: any) => void;
downloading: (
product: IAPProduct,
progress: any,
time_remaining: any
) => void;
downloaded: (callback: IAPQueryCallback) => void;
}
@ -199,163 +208,115 @@ export class IAPError {
pluginRef: 'store',
repo: 'https://github.com/j3k0/cordova-plugin-purchase',
platforms: ['iOS', 'Android', 'Windows'],
install: 'ionic cordova plugin add cc.fovea.cordova.purchase --variable BILLING_KEY="<ANDROID_BILLING_KEY>"'
install:
'ionic cordova plugin add cc.fovea.cordova.purchase --variable BILLING_KEY="<ANDROID_BILLING_KEY>"'
})
@Injectable()
export class InAppPurchase2 extends IonicNativePlugin {
@CordovaProperty QUIET: number;
@CordovaProperty
QUIET: number;
@CordovaProperty ERROR: number;
@CordovaProperty
ERROR: number;
@CordovaProperty WARNING: number;
@CordovaProperty
WARNING: number;
@CordovaProperty INFO: number;
@CordovaProperty
INFO: number;
@CordovaProperty
DEBUG: number;
@CordovaProperty DEBUG: number;
/**
* Debug level. Use QUIET, ERROR, WARNING, INFO or DEBUG constants
*/
@CordovaProperty
verbosity: number;
@CordovaProperty verbosity: number;
/**
* Set to true to invoke the platform purchase sandbox. (Windows only)
*/
@CordovaProperty
sandbox: boolean;
@CordovaProperty sandbox: boolean;
@CordovaProperty FREE_SUBSCRIPTION: string;
@CordovaProperty PAID_SUBSCRIPTION: string;
@CordovaProperty NON_RENEWING_SUBSCRIPTION: string;
@CordovaProperty CONSUMABLE: string;
@CordovaProperty NON_CONSUMABLE: string;
@CordovaProperty ERR_SETUP: number;
@CordovaProperty ERR_LOAD: number;
@CordovaProperty ERR_PURCHASE: number;
@CordovaProperty ERR_LOAD_RECEIPTS: number;
@CordovaProperty ERR_CLIENT_INVALID: number;
@CordovaProperty ERR_PAYMENT_CANCELLED: number;
@CordovaProperty ERR_PAYMENT_INVALID: number;
@CordovaProperty ERR_PAYMENT_NOT_ALLOWED: number;
@CordovaProperty ERR_UNKNOWN: number;
@CordovaProperty ERR_REFRESH_RECEIPTS: number;
@CordovaProperty ERR_INVALID_PRODUCT_ID: number;
@CordovaProperty ERR_FINISH: number;
@CordovaProperty ERR_COMMUNICATION: number;
@CordovaProperty ERR_SUBSCRIPTIONS_NOT_AVAILABLE: number;
@CordovaProperty ERR_MISSING_TOKEN: number;
@CordovaProperty ERR_VERIFICATION_FAILED: number;
@CordovaProperty ERR_BAD_RESPONSE: number;
@CordovaProperty ERR_REFRESH: number;
@CordovaProperty ERR_PAYMENT_EXPIRED: number;
@CordovaProperty ERR_DOWNLOAD: number;
@CordovaProperty ERR_SUBSCRIPTION_UPDATE_NOT_AVAILABLE: number;
@CordovaProperty REGISTERED: string;
@CordovaProperty INVALID: string;
@CordovaProperty VALID: string;
@CordovaProperty REQUESTED: string;
@CordovaProperty INITIATED: string;
@CordovaProperty APPROVED: string;
@CordovaProperty FINISHED: string;
@CordovaProperty OWNED: string;
@CordovaProperty DOWNLOADING: string;
@CordovaProperty DOWNLOADED: string;
@CordovaProperty INVALID_PAYLOAD: number;
@CordovaProperty CONNECTION_FAILED: number;
@CordovaProperty PURCHASE_EXPIRED: number;
@CordovaProperty products: IAPProducts;
@CordovaProperty
FREE_SUBSCRIPTION: string;
@CordovaProperty
PAID_SUBSCRIPTION: string;
@CordovaProperty
NON_RENEWING_SUBSCRIPTION: string;
@CordovaProperty
CONSUMABLE: string;
@CordovaProperty
NON_CONSUMABLE: string;
@CordovaProperty
ERR_SETUP: number;
@CordovaProperty
ERR_LOAD: number;
@CordovaProperty
ERR_PURCHASE: number;
@CordovaProperty
ERR_LOAD_RECEIPTS: number;
@CordovaProperty
ERR_CLIENT_INVALID: number;
@CordovaProperty
ERR_PAYMENT_CANCELLED: number;
@CordovaProperty
ERR_PAYMENT_INVALID: number;
@CordovaProperty
ERR_PAYMENT_NOT_ALLOWED: number;
@CordovaProperty
ERR_UNKNOWN: number;
@CordovaProperty
ERR_REFRESH_RECEIPTS: number;
@CordovaProperty
ERR_INVALID_PRODUCT_ID: number;
@CordovaProperty
ERR_FINISH: number;
@CordovaProperty
ERR_COMMUNICATION: number;
@CordovaProperty
ERR_SUBSCRIPTIONS_NOT_AVAILABLE: number;
@CordovaProperty
ERR_MISSING_TOKEN: number;
@CordovaProperty
ERR_VERIFICATION_FAILED: number;
@CordovaProperty
ERR_BAD_RESPONSE: number;
@CordovaProperty
ERR_REFRESH: number;
@CordovaProperty
ERR_PAYMENT_EXPIRED: number;
@CordovaProperty
ERR_DOWNLOAD: number;
@CordovaProperty
ERR_SUBSCRIPTION_UPDATE_NOT_AVAILABLE: number;
@CordovaProperty
REGISTERED: string;
@CordovaProperty
INVALID: string;
@CordovaProperty
VALID: string;
@CordovaProperty
REQUESTED: string;
@CordovaProperty
INITIATED: string;
@CordovaProperty
APPROVED: string;
@CordovaProperty
FINISHED: string;
@CordovaProperty
OWNED: string;
@CordovaProperty
DOWNLOADING: string;
@CordovaProperty
DOWNLOADED: string;
@CordovaProperty
INVALID_PAYLOAD: number;
@CordovaProperty
CONNECTION_FAILED: number;
@CordovaProperty
PURCHASE_EXPIRED: number;
@CordovaProperty
products: IAPProducts;
@CordovaProperty
validator: string | ((product: string | IAPProduct, callback: Function) => void);
validator:
| string
| ((product: string | IAPProduct, callback: Function) => void);
@CordovaProperty
log: {
@ -370,7 +331,9 @@ export class InAppPurchase2 extends IonicNativePlugin {
* @param idOrAlias
*/
@Cordova({ sync: true })
get(idOrAlias: string): IAPProduct { return; }
get(idOrAlias: string): IAPProduct {
return;
}
/**
* Register error handler
@ -383,7 +346,7 @@ export class InAppPurchase2 extends IonicNativePlugin {
* Add or register a product
* @param product {IAPProductOptions}
*/
@Cordova({ sync: true})
@Cordova({ sync: true })
register(product: IAPProductOptions): void {}
/**
@ -394,7 +357,13 @@ export class InAppPurchase2 extends IonicNativePlugin {
* @return {IAPProductEvents}
*/
@Cordova({ sync: true })
when(query: string | IAPProduct, event?: string, callback?: IAPQueryCallback): IAPProductEvents { return; }
when(
query: string | IAPProduct,
event?: string,
callback?: IAPQueryCallback
): IAPProductEvents {
return;
}
/**
* Identical to `when`, but the callback will be called only once. After being called, the callback will be unregistered.
@ -404,7 +373,13 @@ export class InAppPurchase2 extends IonicNativePlugin {
* @return {IAPProductEvents}
*/
@Cordova({ sync: true })
once(query: string | IAPProduct, event?: string, callback?: IAPQueryCallback): IAPProductEvents { return; }
once(
query: string | IAPProduct,
event?: string,
callback?: IAPQueryCallback
): IAPProductEvents {
return;
}
/**
* Unregister a callback. Works for callbacks registered with ready, when, once and error.
@ -414,16 +389,22 @@ export class InAppPurchase2 extends IonicNativePlugin {
off(callback: Function): void {}
@Cordova({ sync: true })
order(product: string | IAPProduct, additionalData?: any): { then: Function; error: Function; } { return; }
order(
product: string | IAPProduct,
additionalData?: any
): { then: Function; error: Function } {
return;
}
/**
*
* @return {Promise<any>} returns a promise that resolves when the store is ready
*/
@Cordova()
ready(): Promise<void> { return; }
ready(): Promise<void> {
return;
}
@Cordova({ sync: true })
refresh(): void {}
}

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name In App Purchase
@ -62,7 +61,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class InAppPurchase extends IonicNativePlugin {
/**
* Retrieves a list of full product data from Apple/Google. This method must be called before making purchases.
* @param {array<string>} productId an array of product ids.
@ -71,7 +69,9 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
getProducts(productId: string[]): Promise<any> { return; }
getProducts(productId: string[]): Promise<any> {
return;
}
/**
* Buy a product that matches the productId.
@ -81,7 +81,16 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
buy(productId: string): Promise<{ transactionId: string, receipt: string, signature: string, productType: string }> { return; }
buy(
productId: string
): Promise<{
transactionId: string;
receipt: string;
signature: string;
productType: string;
}> {
return;
}
/**
* Same as buy, but for subscription based products.
@ -91,7 +100,16 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
subscribe(productId: string): Promise<{ transactionId: string, receipt: string, signature: string, productType: string }> { return; }
subscribe(
productId: string
): Promise<{
transactionId: string;
receipt: string;
signature: string;
productType: string;
}> {
return;
}
/**
* Call this function after purchasing a "consumable" product to mark it as consumed. On Android, you must consume products that you want to let the user purchase multiple times. If you will not consume the product after a purchase, the next time you will attempt to purchase it you will get the error message:
@ -103,7 +121,13 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
consume(productType: string, receipt: string, signature: string): Promise<any> { return; }
consume(
productType: string,
receipt: string,
signature: string
): Promise<any> {
return;
}
/**
* Restore all purchases from the store
@ -112,7 +136,9 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({
otherPromise: true
})
restorePurchases(): Promise<any> { return; }
restorePurchases(): Promise<any> {
return;
}
/**
* Get the receipt.
@ -122,6 +148,7 @@ export class InAppPurchase extends IonicNativePlugin {
otherPromise: true,
platforms: ['iOS']
})
getReceipt(): Promise<string> { return; }
getReceipt(): Promise<string> {
return;
}
}

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Insomnia
@ -34,23 +33,32 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
plugin: 'cordova-plugin-insomnia',
pluginRef: 'plugins.insomnia',
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
platforms: ['Android', 'Browser', 'Firefox OS', 'iOS', 'Windows', 'Windows Phone 8']
platforms: [
'Android',
'Browser',
'Firefox OS',
'iOS',
'Windows',
'Windows Phone 8'
]
})
@Injectable()
export class Insomnia extends IonicNativePlugin {
/**
* Keeps awake the application
* @returns {Promise<any>}
*/
@Cordova()
keepAwake(): Promise<any> { return; }
keepAwake(): Promise<any> {
return;
}
/**
* Allows the application to sleep again
* @returns {Promise<any>}
*/
@Cordova()
allowSleepAgain(): Promise<any> { return; }
allowSleepAgain(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Instagram
@ -28,7 +28,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class Instagram extends IonicNativePlugin {
/**
* Detect if the Instagram application is installed on the device.
*
@ -37,7 +36,9 @@ export class Instagram extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
isInstalled(): Promise<boolean | string> { return; }
isInstalled(): Promise<boolean | string> {
return;
}
/**
* Share an image on Instagram
@ -50,7 +51,9 @@ export class Instagram extends IonicNativePlugin {
@Cordova({
callbackStyle: 'node'
})
share(canvasIdOrDataUrl: string, caption?: string): Promise<any> { return; }
share(canvasIdOrDataUrl: string, caption?: string): Promise<any> {
return;
}
/**
* Share a library asset or video
@ -60,6 +63,7 @@ export class Instagram extends IonicNativePlugin {
@Cordova({
callbackOrder: 'reverse'
})
shareAsset(assetLocalIdentifier: string): Promise<any> { return; }
shareAsset(assetLocalIdentifier: string): Promise<any> {
return;
}
}

View File

@ -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<Array<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<Array<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,5 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Intercom
@ -27,18 +27,19 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-intercom',
pluginRef: 'intercom',
repo: 'https://github.com/intercom/intercom-cordova',
platforms: ['Android', 'iOS'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Intercom extends IonicNativePlugin {
/**
* Register a identified user
* @param options {any} Options
* @return {Promise<any>} Returns a promise
*/
@Cordova()
registerIdentifiedUser(options: any): Promise<any> { return; }
registerIdentifiedUser(options: any): Promise<any> {
return;
}
/**
* Register a unidentified user
@ -46,14 +47,18 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
registerUnidentifiedUser(options: any): Promise<any> { return; }
registerUnidentifiedUser(options: any): Promise<any> {
return;
}
/**
* This resets the Intercom integration's cache of your user's identity and wipes the slate clean.
* @return {Promise<any>} Returns a promise
*/
@Cordova()
reset(): Promise<any> { return; }
reset(): Promise<any> {
return;
}
/**
*
@ -62,7 +67,9 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setSecureMode(secureHash: string, secureData: any): Promise<any> { return; }
setSecureMode(secureHash: string, secureData: any): Promise<any> {
return;
}
/**
*
@ -70,7 +77,9 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setUserHash(secureHash: string): Promise<any> { return; }
setUserHash(secureHash: string): Promise<any> {
return;
}
/**
*
@ -78,7 +87,9 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
updateUser(attributes: any): Promise<any> { return; }
updateUser(attributes: any): Promise<any> {
return;
}
/**
*
@ -87,21 +98,27 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
logEvent(eventName: string, metaData: any): Promise<any> { return; }
logEvent(eventName: string, metaData: any): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayMessenger(): Promise<any> { return; }
displayMessenger(): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayMessageComposer(): Promise<any> { return; }
displayMessageComposer(): Promise<any> {
return;
}
/**
*
@ -109,21 +126,29 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayMessageComposerWithInitialMessage(initialMessage: string): Promise<any> { return; }
displayMessageComposerWithInitialMessage(
initialMessage: string
): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayConversationsList(): Promise<any> { return; }
displayConversationsList(): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
unreadConversationCount(): Promise<any> { return; }
unreadConversationCount(): Promise<any> {
return;
}
/**
*
@ -131,7 +156,9 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setLauncherVisibility(visibility: string): Promise<any> { return; }
setLauncherVisibility(visibility: string): Promise<any> {
return;
}
/**
*
@ -139,20 +166,25 @@ export class Intercom extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise
*/
@Cordova()
setInAppMessageVisibility(visibility: string): Promise<any> { return; }
setInAppMessageVisibility(visibility: string): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
hideMessenger(): Promise<any> { return; }
hideMessenger(): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
registerForPush(): Promise<any> { return; }
registerForPush(): Promise<any> {
return;
}
}

View File

@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import {
Cordova,
CordovaCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare const cordova: any;
@ -49,7 +54,9 @@ export class JinsMeme extends IonicNativePlugin {
*@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,7 +87,12 @@ 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));
let data = cordova.plugins.JinsMemePlugin.connect(
target,
observer.next.bind(observer),
observer.complete.bind(observer),
observer.error.bind(observer)
);
return () => console.log(data);
});
}
@ -86,19 +102,25 @@ export class JinsMeme extends IonicNativePlugin {
*@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>}
*/
@Cordova()
isConnected(): Promise<any> { return; }
isConnected(): Promise<any> {
return;
}
/**
* Disconnects from JINS MEME.
*@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>}
*/
@Cordova()
getSDKVersion(): Promise<any> { return; }
getSDKVersion(): Promise<any> {
return;
}
/**
* Returns JINS MEME connected with other apps.
*@returns {Promise<any>}
*/
@Cordova()
getConnectedByOthers(): Promise<any> { return; }
getConnectedByOthers(): Promise<any> {
return;
}
/**
* Returns calibration status
*@returns {Promise<any>}
*/
@Cordova()
isCalibrated(): Promise<any> { return; }
isCalibrated(): Promise<any> {
return;
}
/**
* Returns device type.
*@returns {Promise<any>}
*/
@Cordova()
getConnectedDeviceType(): Promise<any> { return; }
getConnectedDeviceType(): Promise<any> {
return;
}
/**
* Returns hardware version.
*@returns {Promise<any>}
*/
@Cordova()
getConnectedDeviceSubType(): Promise<any> { return; }
getConnectedDeviceSubType(): Promise<any> {
return;
}
/**
* Returns FW Version.
*@returns {Promise<any>}
*/
@Cordova()
getFWVersion(): Promise<any> { return; }
getFWVersion(): Promise<any> {
return;
}
/**
* Returns HW Version.
*@returns {Promise<any>}
*/
@Cordova()
getHWVersion(): Promise<any> { return; }
getHWVersion(): Promise<any> {
return;
}
/**
* Returns response about whether data was received or not.
*@returns {Promise<any>}
*/
@Cordova()
isDataReceiving(): Promise<any> { return; }
isDataReceiving(): Promise<any> {
return;
}
}

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
* @name Keyboard
* @description
@ -29,13 +28,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.
@ -44,7 +42,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
})
show(): void { }
show(): void {}
/**
* Close the keyboard if open.
@ -53,7 +51,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.
@ -63,7 +61,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.
@ -74,7 +72,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.
@ -85,6 +85,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

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Keychain Touch Id
@ -32,7 +32,6 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class KeychainTouchId extends IonicNativePlugin {
/**
* Check if Touch ID / Fingerprint is supported by the device
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
@ -50,7 +49,9 @@ export class KeychainTouchId extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when there is a result
*/
@Cordova()
save(key: string, password: string): Promise<any> { return; }
save(key: string, password: string): Promise<any> {
return;
}
/**
* Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve
@ -60,7 +61,9 @@ export class KeychainTouchId extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
*/
@Cordova()
verify(key: string, message: string): Promise<any> { return; }
verify(key: string, message: string): Promise<any> {
return;
}
/**
* Checks if there is a password stored within the keychain for the given key.
@ -68,7 +71,9 @@ export class KeychainTouchId extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
*/
@Cordova()
has(key: string): Promise<any> { return; }
has(key: string): Promise<any> {
return;
}
/**
* Deletes the password stored under given key from the keychain.
@ -76,7 +81,9 @@ export class KeychainTouchId extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
*/
@Cordova()
delete(key: string): Promise<any> { return; }
delete(key: string): Promise<any> {
return;
}
/**
* Sets the language of the fingerprint dialog
@ -84,5 +91,4 @@ export class KeychainTouchId extends IonicNativePlugin {
*/
@Cordova()
setLocale(locale: string): void {}
}

Some files were not shown because too many files have changed in this diff Show More