Revert "chore(package): bump dependencies and lint rules"

This reverts commit 21ad4734fa.
This commit is contained in:
Daniel 2018-03-16 22:04:01 +01:00
parent 21ad4734fa
commit 6c938bfdb7
178 changed files with 4221 additions and 10592 deletions

5162
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

@ -9,17 +9,13 @@ export function checkReady() {
let didFireReady = false; let didFireReady = false;
document.addEventListener('deviceready', () => { document.addEventListener('deviceready', () => {
console.log( console.log(`Ionic Native: deviceready event fired after ${(Date.now() - before)} ms`);
`Ionic Native: deviceready event fired after ${Date.now() - before} ms`
);
didFireReady = true; didFireReady = true;
}); });
setTimeout(() => { setTimeout(() => {
if (!didFireReady && !!window.cordova) { if (!didFireReady && !!window.cordova) {
console.warn( 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.`);
`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); }, DEVICE_READY_TIMEOUT);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,27 +7,25 @@ export const get = (element: Element | Window, path: string): any => {
const paths: string[] = path.split('.'); const paths: string[] = path.split('.');
let obj: any = element; let obj: any = element;
for (let i: number = 0; i < paths.length; i++) { for (let i: number = 0; i < paths.length; i++) {
if (!obj) { if (!obj) { return null; }
return null;
}
obj = obj[paths[i]]; obj = obj[paths[i]];
} }
return obj; return obj;
}; };
/** /**
* @private * @private
*/ */
export const getPromise = (callback: Function): Promise<any> => { export const getPromise = (callback: Function): Promise<any> => {
const tryNativePromise = () => { const tryNativePromise = () => {
if (window.Promise) { if (window.Promise) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
callback(resolve, reject); callback(resolve, reject);
}); });
} else { } else {
console.error( 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.');
'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.'
);
} }
}; };
@ -46,24 +44,14 @@ export const getPlugin = (pluginRef: string): any => {
/** /**
* @private * @private
*/ */
export const pluginWarn = ( export const pluginWarn = (pluginName: string, plugin?: string, method?: string): void => {
pluginName: string,
plugin?: string,
method?: string
): void => {
if (method) { if (method) {
console.warn( console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
`Native: tried calling ${pluginName}.${method}, but the ${pluginName} plugin is not installed.`
);
} else { } else {
console.warn( console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed.');
`Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
} }
if (plugin) { if (plugin) {
console.warn( console.warn('Install the ' + pluginName + ' plugin: \'ionic cordova plugin add ' + plugin + '\'');
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
} }
}; };
@ -74,12 +62,8 @@ export const pluginWarn = (
*/ */
export const cordovaWarn = (pluginName: string, method?: string): void => { export const cordovaWarn = (pluginName: string, method?: string): void => {
if (method) { if (method) {
console.warn( console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
`Native: tried calling ${pluginName}.${method}, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator`
);
} else { } else {
console.warn( 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');
`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,7 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface ActionSheetOptions { export interface ActionSheetOptions {
/** /**
* The labels for the buttons. Uses the index x * The labels for the buttons. Uses the index x
*/ */
@ -97,6 +98,7 @@ export interface ActionSheetOptions {
}) })
@Injectable() @Injectable()
export class ActionSheet extends IonicNativePlugin { export class ActionSheet extends IonicNativePlugin {
/** /**
* Convenience property to select an Android theme value * Convenience property to select an Android theme value
*/ */
@ -121,16 +123,13 @@ export class ActionSheet extends IonicNativePlugin {
* button pressed (1 based, so 1, 2, 3, etc.) * button pressed (1 based, so 1, 2, 3, etc.)
*/ */
@Cordova() @Cordova()
show(options?: ActionSheetOptions): Promise<number> { show(options?: ActionSheetOptions): Promise<number> { return; }
return;
}
/** /**
* Progamtically hide the native ActionSheet * Progamtically hide the native ActionSheet
* @returns {Promise<any>} Returns a Promise that resolves when the actionsheet is closed * @returns {Promise<any>} Returns a Promise that resolves when the actionsheet is closed
*/ */
@Cordova() @Cordova()
hide(options?: any): Promise<any> { hide(options?: any): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,13 +1,15 @@
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface BackgroundFetchConfig { export interface BackgroundFetchConfig {
/** /**
* Set true to cease background-fetch from operating after user "closes" the app. Defaults to true. * Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
*/ */
stopOnTerminate?: boolean; stopOnTerminate?: boolean;
} }
/** /**
* @name Background Fetch * @name Background Fetch
* @description * @description
@ -59,6 +61,8 @@ export interface BackgroundFetchConfig {
}) })
@Injectable() @Injectable()
export class BackgroundFetch extends IonicNativePlugin { export class BackgroundFetch extends IonicNativePlugin {
/** /**
* Configures the plugin's fetch callbackFn * Configures the plugin's fetch callbackFn
* *
@ -68,9 +72,7 @@ export class BackgroundFetch extends IonicNativePlugin {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
configure(config: BackgroundFetchConfig): Promise<any> { configure(config: BackgroundFetchConfig): Promise<any> { return; }
return;
}
/** /**
* Start the background-fetch API. * Start the background-fetch API.
@ -78,18 +80,14 @@ export class BackgroundFetch extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
start(): Promise<any> { start(): Promise<any> { return; }
return;
}
/** /**
* Stop the background-fetch API from firing fetch events. Your callbackFn provided to #configure will no longer be executed. * Stop the background-fetch API from firing fetch events. Your callbackFn provided to #configure will no longer be executed.
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
stop(): Promise<any> { stop(): Promise<any> { return; }
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. * 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.
@ -97,14 +95,13 @@ export class BackgroundFetch extends IonicNativePlugin {
@Cordova({ @Cordova({
sync: true sync: true
}) })
finish(): void {} finish(): void { }
/** /**
* Return the status of the background-fetch * Return the status of the background-fetch
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
status(): Promise<any> { status(): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/** /**
* @name Clipboard * @name Clipboard
* @description * @description
@ -37,22 +36,20 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
}) })
@Injectable() @Injectable()
export class Clipboard extends IonicNativePlugin { export class Clipboard extends IonicNativePlugin {
/** /**
* Copies the given text * Copies the given text
* @param {string} text Text that gets copied on the system clipboard * @param {string} text Text that gets copied on the system clipboard
* @returns {Promise<any>} Returns a promise after the text has been copied * @returns {Promise<any>} Returns a promise after the text has been copied
*/ */
@Cordova() @Cordova()
copy(text: string): Promise<any> { copy(text: string): Promise<any> { return; }
return;
}
/** /**
* Pastes the text stored in clipboard * Pastes the text stored in clipboard
* @returns {Promise<any>} Returns a promise after the text has been pasted * @returns {Promise<any>} Returns a promise after the text has been pasted
*/ */
@Cordova() @Cordova()
paste(): Promise<any> { paste(): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

@ -1,5 +1,6 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/** /**
* @name Couchbase Lite * @name Couchbase Lite
@ -120,6 +121,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
}) })
@Injectable() @Injectable()
export class CouchbaseLite extends IonicNativePlugin { export class CouchbaseLite extends IonicNativePlugin {
/** /**
* Get the database url * Get the database url
* @return {Promise<any>} Returns a promise that resolves with the local database url * @return {Promise<any>} Returns a promise that resolves with the local database url
@ -127,7 +129,6 @@ export class CouchbaseLite extends IonicNativePlugin {
@Cordova({ @Cordova({
callbackStyle: 'node' callbackStyle: 'node'
}) })
getURL(): Promise<any> { getURL(): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare const window: any; declare const window: any;
@ -28,30 +28,40 @@ declare const window: any;
}) })
@Injectable() @Injectable()
export class Device extends IonicNativePlugin { export class Device extends IonicNativePlugin {
/** Get the version of Cordova running on the device. */ /** 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 * 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. * 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. */ /** Get the device's operating system name. */
@CordovaProperty platform: string; @CordovaProperty
platform: string;
/** Get the device's Universally Unique Identifier (UUID). */ /** Get the device's Universally Unique Identifier (UUID). */
@CordovaProperty uuid: string; @CordovaProperty
uuid: string;
/** Get the operating system version. */ /** Get the operating system version. */
@CordovaProperty version: string; @CordovaProperty
version: string;
/** Get the device's manufacturer. */ /** Get the device's manufacturer. */
@CordovaProperty manufacturer: string; @CordovaProperty
manufacturer: string;
/** Whether the device is running on a simulator. */ /** Whether the device is running on a simulator. */
@CordovaProperty isVirtual: boolean; @CordovaProperty
isVirtual: boolean;
/** Get the device hardware serial number. */ /** Get the device hardware serial number. */
@CordovaProperty serial: string; @CordovaProperty
serial: string;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs';
/** /**
* @name FTP * @name FTP
@ -32,19 +32,18 @@ import { Observable } from 'rxjs/Observable';
}) })
@Injectable() @Injectable()
export class FTP extends IonicNativePlugin { export class FTP extends IonicNativePlugin {
/** /**
* Connect to one ftp server. * Connect to one ftp server.
* *
* Just need to init the connection once. If success, you can do any ftp actions later. * 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 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 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. * @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! * @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() @Cordova()
connect(hostname: string, username: string, password: string): Promise<any> { connect(hostname: string, username: string, password: string): Promise<any> { return; }
return;
}
/** /**
* List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server. * List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server.
@ -61,9 +60,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
ls(path: string): Promise<any> { ls(path: string): Promise<any> { return; }
return;
}
/** /**
* Create one directory on the ftp server. * Create one directory on the ftp server.
@ -72,9 +69,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
mkdir(path: string): Promise<any> { mkdir(path: string): Promise<any> { return; }
return;
}
/** /**
* Delete one directory on the ftp server. * Delete one directory on the ftp server.
@ -85,9 +80,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
rmdir(path: string): Promise<any> { rmdir(path: string): Promise<any> { return; }
return;
}
/** /**
* Delete one file on the ftp server. * Delete one file on the ftp server.
@ -96,9 +89,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
rm(file: string): Promise<any> { rm(file: string): Promise<any> { return; }
return;
}
/** /**
* Upload one local file to the ftp server. * Upload one local file to the ftp server.
@ -112,9 +103,7 @@ export class FTP extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
upload(localFile: string, remoteFile: string): Observable<any> { upload(localFile: string, remoteFile: string): Observable<any> { return; }
return;
}
/** /**
* Download one remote file on the ftp server to local path. * Download one remote file on the ftp server to local path.
@ -128,9 +117,7 @@ export class FTP extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
download(localFile: string, remoteFile: string): Observable<any> { download(localFile: string, remoteFile: string): Observable<any> { return; }
return;
}
/** /**
* Cancel all requests. Always success. * Cancel all requests. Always success.
@ -138,9 +125,7 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
cancel(): Promise<any> { cancel(): Promise<any> { return; }
return;
}
/** /**
* Disconnect from ftp server. * Disconnect from ftp server.
@ -148,7 +133,6 @@ export class FTP extends IonicNativePlugin {
* @return {Promise<any>} Returns a promise * @return {Promise<any>} Returns a promise
*/ */
@Cordova() @Cordova()
disconnect(): Promise<any> { disconnect(): Promise<any> { return; }
return;
}
} }

View File

@ -1,10 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
Cordova,
CordovaFunctionOverride,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare const window: any; declare const window: any;
@ -89,6 +84,7 @@ declare const window: any;
}) })
@Injectable() @Injectable()
export class Geofence extends IonicNativePlugin { export class Geofence extends IonicNativePlugin {
TransitionType = { TransitionType = {
ENTER: 1, ENTER: 1,
EXIT: 2, EXIT: 2,
@ -100,9 +96,7 @@ export class Geofence extends IonicNativePlugin {
* @return {Observable<any>} * @return {Observable<any>}
*/ */
@CordovaFunctionOverride() @CordovaFunctionOverride()
onTransitionReceived(): Observable<any> { onTransitionReceived(): Observable<any> { return; };
return;
}
/** /**
* Initializes the plugin. User will be prompted to allow the app to use location and notifications. * Initializes the plugin. User will be prompted to allow the app to use location and notifications.
@ -110,9 +104,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
@Cordova() @Cordova()
initialize(): Promise<void> { initialize(): Promise<void> { return; };
return;
}
/** /**
* Adds a new geofence or array of geofences. For geofence object, see above. * Adds a new geofence or array of geofences. For geofence object, see above.
@ -120,9 +112,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
@Cordova() @Cordova()
addOrUpdate(geofences: Object | Array<Object>): Promise<void> { addOrUpdate(geofences: Object | Array<Object>): Promise<void> { return; };
return;
}
/** /**
* Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the * Removes a geofence or array of geofences. `geofenceID` corresponds to one or more IDs specified when the
@ -131,9 +121,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
@Cordova() @Cordova()
remove(geofenceId: string | Array<string>): Promise<void> { remove(geofenceId: string | Array<string>): Promise<void> { return; };
return;
}
/** /**
* Removes all geofences. * Removes all geofences.
@ -141,9 +129,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
@Cordova() @Cordova()
removeAll(): Promise<void> { removeAll(): Promise<void> { return; };
return;
}
/** /**
* Returns an array of geofences currently being monitored. * Returns an array of geofences currently being monitored.
@ -151,9 +137,7 @@ export class Geofence extends IonicNativePlugin {
* @returns {Promise<Array<string>>} * @returns {Promise<Array<string>>}
*/ */
@Cordova() @Cordova()
getWatched(): Promise<string> { getWatched(): Promise<string> { return; };
return;
}
/** /**
* Called when the user clicks a geofence notification. iOS and Android only. * Called when the user clicks a geofence notification. iOS and Android only.
@ -161,11 +145,12 @@ export class Geofence extends IonicNativePlugin {
* @returns {Observable<any>} * @returns {Observable<any>}
*/ */
onNotificationClicked(): Observable<any> { onNotificationClicked(): Observable<any> {
return new Observable<any>(observer => {
window && return new Observable<any>((observer) => {
window.geofence && window && window.geofence && (window.geofence.onNotificationClicked = observer.next.bind(observer));
(window.geofence.onNotificationClicked = observer.next.bind(observer)); return () => window.geofence.onNotificationClicked = () => { };
return () => (window.geofence.onNotificationClicked = () => {});
}); });
} }
} }

View File

@ -1,10 +1,11 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare const navigator: any; declare const navigator: any;
export interface Coordinates { export interface Coordinates {
/** /**
* a double representing the position's latitude in decimal degrees. * a double representing the position's latitude in decimal degrees.
*/ */
@ -48,6 +49,7 @@ export interface Coordinates {
* This value can be null. * This value can be null.
*/ */
speed: number; speed: number;
} }
export interface Geoposition { export interface Geoposition {
@ -63,6 +65,7 @@ export interface Geoposition {
} }
export interface PositionError { export interface PositionError {
/** /**
* A code that indicates the error that occurred * A code that indicates the error that occurred
*/ */
@ -72,9 +75,11 @@ export interface PositionError {
* A message that can describe the error that occurred * A message that can describe the error that occurred
*/ */
message: string; message: string;
} }
export interface GeolocationOptions { export interface GeolocationOptions {
/** /**
* Is a positive long value indicating the maximum age in milliseconds of a * 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 * possible cached position that is acceptable to return. If set to 0, it
@ -102,6 +107,7 @@ export interface GeolocationOptions {
* @type {boolean} * @type {boolean}
*/ */
enableHighAccuracy?: boolean; enableHighAccuracy?: boolean;
} }
/** /**
@ -147,13 +153,13 @@ export interface GeolocationOptions {
plugin: 'cordova-plugin-geolocation', plugin: 'cordova-plugin-geolocation',
pluginRef: 'navigator.geolocation', pluginRef: 'navigator.geolocation',
repo: 'https://github.com/apache/cordova-plugin-geolocation', repo: 'https://github.com/apache/cordova-plugin-geolocation',
install: install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'], installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows'] platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
}) })
@Injectable() @Injectable()
export class Geolocation extends IonicNativePlugin { export class Geolocation extends IonicNativePlugin {
/** /**
* Get the device's current position. * Get the device's current position.
* *
@ -163,9 +169,7 @@ export class Geolocation extends IonicNativePlugin {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return; }
return;
}
/** /**
* Watch the current device's position. Clear the watch by unsubscribing from * Watch the current device's position. Clear the watch by unsubscribing from
@ -186,13 +190,12 @@ 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. * @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> { watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
return new Observable<Geoposition>((observer: any) => { return new Observable<Geoposition>(
let watchId = navigator.geolocation.watchPosition( (observer: any) => {
observer.next.bind(observer), let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
observer.next.bind(observer), return () => navigator.geolocation.clearWatch(watchId);
options }
); );
return () => navigator.geolocation.clearWatch(watchId);
});
} }
} }

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface ScoreData { export interface ScoreData {
/** /**
* The score to submit. * The score to submit.
*/ */
@ -11,37 +12,47 @@ export interface ScoreData {
* The leaderboard ID from Google Play Developer console. * The leaderboard ID from Google Play Developer console.
*/ */
leaderboardId: string; leaderboardId: string;
} }
export interface LeaderboardData { export interface LeaderboardData {
/** /**
* The leaderboard ID from Goole Play Developer console. * The leaderboard ID from Goole Play Developer console.
*/ */
leaderboardId: string; leaderboardId: string;
} }
export interface AchievementData { export interface AchievementData {
/** /**
* The achievement ID from Google Play Developer console. * The achievement ID from Google Play Developer console.
*/ */
achievementId: string; achievementId: string;
} }
export interface IncrementableAchievementData extends AchievementData { export interface IncrementableAchievementData extends AchievementData {
/** /**
* The amount to increment the achievement by. * The amount to increment the achievement by.
*/ */
numSteps: number; numSteps: number;
} }
export interface SignedInResponse { export interface SignedInResponse {
/** /**
* True or false is the use is signed in. * True or false is the use is signed in.
*/ */
isSignedIn: boolean; isSignedIn: boolean;
} }
export interface Player { export interface Player {
/** /**
* The players display name. * The players display name.
*/ */
@ -56,7 +67,7 @@ export interface Player {
* The title of the player based on their gameplay activity. Not * The title of the player based on their gameplay activity. Not
* all players have this and it may change over time. * 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.
@ -69,6 +80,7 @@ export interface Player {
* null if the player has no profile image. * null if the player has no profile image.
*/ */
hiResIconImageUrl: string; hiResIconImageUrl: string;
} }
/** /**
@ -146,11 +158,11 @@ export interface Player {
pluginRef: 'plugins.playGamesServices', pluginRef: 'plugins.playGamesServices',
repo: 'https://github.com/artberri/cordova-plugin-play-games-services', repo: 'https://github.com/artberri/cordova-plugin-play-games-services',
platforms: ['Android'], platforms: ['Android'],
install: install: 'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID',
'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID'
}) })
@Injectable() @Injectable()
export class GooglePlayGamesServices extends IonicNativePlugin { export class GooglePlayGamesServices extends IonicNativePlugin {
/** /**
* Initialise native Play Games Service login procedure. * Initialise native Play Games Service login procedure.
* *
@ -158,9 +170,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* is authenticated with Play Games Services. * is authenticated with Play Games Services.
*/ */
@Cordova() @Cordova()
auth(): Promise<any> { auth(): Promise<any> { return; }
return;
}
/** /**
* Sign out of Google Play Games Services. * Sign out of Google Play Games Services.
@ -169,9 +179,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* successfully signs out. * successfully signs out.
*/ */
@Cordova() @Cordova()
signOut(): Promise<any> { signOut(): Promise<any> { return; }
return;
}
/** /**
* Check if the user is signed in. * Check if the user is signed in.
@ -180,9 +188,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* the signed in response. * the signed in response.
*/ */
@Cordova() @Cordova()
isSignedIn(): Promise<SignedInResponse> { isSignedIn(): Promise<SignedInResponse> { return; }
return;
}
/** /**
* Show the currently authenticated player. * Show the currently authenticated player.
@ -191,9 +197,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* Games Services returns the authenticated player. * Games Services returns the authenticated player.
*/ */
@Cordova() @Cordova()
showPlayer(): Promise<Player> { showPlayer(): Promise<Player> { return; }
return;
}
/** /**
* Submit a score to a leaderboard. You should ensure that you have a * Submit a score to a leaderboard. You should ensure that you have a
@ -204,9 +208,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* score is submitted. * score is submitted.
*/ */
@Cordova() @Cordova()
submitScore(data: ScoreData): Promise<string> { submitScore(data: ScoreData): Promise<string> { return; }
return;
}
/** /**
* Launches the native Play Games leaderboard view controller to show all the * Launches the native Play Games leaderboard view controller to show all the
@ -216,9 +218,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* leaderboards window opens. * leaderboards window opens.
*/ */
@Cordova() @Cordova()
showAllLeaderboards(): Promise<any> { showAllLeaderboards(): Promise<any> { return; }
return;
}
/** /**
* Launches the native Play Games leaderboard view controll to show the * Launches the native Play Games leaderboard view controll to show the
@ -229,9 +229,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* leaderboard window opens. * leaderboard window opens.
*/ */
@Cordova() @Cordova()
showLeaderboard(data: LeaderboardData): Promise<any> { showLeaderboard(data: LeaderboardData): Promise<any> { return; }
return;
}
/** /**
* Unlock an achievement. * Unlock an achievement.
@ -241,9 +239,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* achievement is unlocked. * achievement is unlocked.
*/ */
@Cordova() @Cordova()
unlockAchievement(data: AchievementData): Promise<string> { unlockAchievement(data: AchievementData): Promise<string> { return; }
return;
}
/** /**
* Increment an achievement. * Increment an achievement.
@ -253,9 +249,7 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* achievement is incremented. * achievement is incremented.
*/ */
@Cordova() @Cordova()
incrementAchievement(data: IncrementableAchievementData): Promise<string> { incrementAchievement(data: IncrementableAchievementData): Promise<string> { return; }
return;
}
/** /**
* Lauches the native Play Games achievements view controller to show * Lauches the native Play Games achievements view controller to show
@ -265,7 +259,6 @@ export class GooglePlayGamesServices extends IonicNativePlugin {
* achievement window opens. * achievement window opens.
*/ */
@Cordova() @Cordova()
showAchievements(): Promise<any> { showAchievements(): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

@ -1,116 +1,116 @@
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface HealthKitOptions { export interface HealthKitOptions {
/** /**
* HKWorkoutActivityType constant * HKWorkoutActivityType constant
* Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType * Read more here: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType
*/ */
activityType?: string; // activityType?: string; //
/** /**
* 'hour', 'week', 'year' or 'day', default 'day' * 'hour', 'week', 'year' or 'day', default 'day'
*/ */
aggregation?: string; aggregation?: string;
/** /**
* *
*/ */
amount?: number; amount?: number;
/** /**
* *
*/ */
correlationType?: string; correlationType?: string;
/** /**
* *
*/ */
date?: any; date?: any;
/** /**
* *
*/ */
distance?: number; distance?: number;
/** /**
* probably useful with the former param * probably useful with the former param
*/ */
distanceUnit?: string; distanceUnit?: string;
/** /**
* in seconds, optional, use either this or endDate * in seconds, optional, use either this or endDate
*/ */
duration?: number; duration?: number;
/** /**
* *
*/ */
endDate?: any; endDate?: any;
/** /**
* *
*/ */
energy?: number; energy?: number;
/** /**
* J|cal|kcal * J|cal|kcal
*/ */
energyUnit?: string; energyUnit?: string;
/** /**
* *
*/ */
extraData?: any; extraData?: any;
/** /**
* *
*/ */
metadata?: any; metadata?: any;
/** /**
* *
*/ */
quantityType?: string; quantityType?: string;
/** /**
* *
*/ */
readTypes?: any; readTypes?: any;
/** /**
* *
*/ */
requestWritePermission?: boolean; requestWritePermission?: boolean;
/** /**
* *
*/ */
samples?: any; samples?: any;
/** /**
* *
*/ */
sampleType?: string; sampleType?: string;
/** /**
* *
*/ */
startDate?: any; startDate?: any;
/** /**
* m|cm|mm|in|ft * m|cm|mm|in|ft
*/ */
unit?: string; unit?: string;
/** /**
* *
*/ */
requestReadPermission?: boolean; requestReadPermission?: boolean;
/** /**
* *
*/ */
writeTypes?: any; writeTypes?: any;
} }
@ -142,207 +142,168 @@ export interface HealthKitOptions {
}) })
@Injectable() @Injectable()
export class HealthKit extends IonicNativePlugin { export class HealthKit extends IonicNativePlugin {
/**
* Check if HealthKit is supported (iOS8+, not on iPad)
* @returns {Promise<any>}
*/
@Cordova()
available(): Promise<any> {
return;
}
/** /**
* Pass in a type and get back on of undetermined | denied | authorized * Check if HealthKit is supported (iOS8+, not on iPad)
* @param options {HealthKitOptions} * @returns {Promise<any>}
* @returns {Promise<any>} */
*/
@Cordova() @Cordova()
checkAuthStatus(options: HealthKitOptions): Promise<any> { available(): Promise<any> { return; }
return;
}
/** /**
* Ask some or all permissions up front * Pass in a type and get back on of undetermined | denied | authorized
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
requestAuthorization(options: HealthKitOptions): Promise<any> { checkAuthStatus(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* Formatted as yyyy-MM-dd * Ask some or all permissions up front
* @returns {Promise<any>} * @param options {HealthKitOptions}
*/ * @returns {Promise<any>}
*/
@Cordova() @Cordova()
readDateOfBirth(): Promise<any> { requestAuthorization(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* Output = male|female|other|unknown * Formatted as yyyy-MM-dd
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
readGender(): Promise<any> { readDateOfBirth(): Promise<any> { return; }
return;
}
/** /**
* Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown * Output = male|female|other|unknown
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
readBloodType(): Promise<any> { readGender(): Promise<any> { return; }
return;
}
/** /**
* Output = I|II|III|IV|V|VI|unknown * Output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
readFitzpatrickSkinType(): Promise<any> { readBloodType(): Promise<any> { return; }
return;
}
/** /**
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount * Output = I|II|III|IV|V|VI|unknown
* @param options {HealthKitOptions} * @returns {Promise<any>}
* @returns {Promise<any>} */
*/
@Cordova() @Cordova()
saveWeight(options: HealthKitOptions): Promise<any> { readFitzpatrickSkinType(): Promise<any> { return; }
return;
}
/** /**
* Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) * Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
readWeight(options: HealthKitOptions): Promise<any> { saveWeight(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount * Pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
saveHeight(options: HealthKitOptions): Promise<any> { readWeight(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) * Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
readHeight(options: HealthKitOptions): Promise<any> { saveHeight(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* no params yet, so this will return all workouts ever of any type * Pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
* @returns {Promise<any>} * @param options {HealthKitOptions}
*/ * @returns {Promise<any>}
*/
@Cordova() @Cordova()
findWorkouts(): Promise<any> { readHeight(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* * no params yet, so this will return all workouts ever of any type
* @param options {HealthKitOptions} * @returns {Promise<any>}
* @returns {Promise<any>} */
*/
@Cordova() @Cordova()
saveWorkout(options: HealthKitOptions): Promise<any> { findWorkouts(): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
querySampleType(options: HealthKitOptions): Promise<any> { saveWorkout(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { querySampleType(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
deleteSamples(options: HealthKitOptions): Promise<any> { querySampleTypeAggregated(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
monitorSampleType(options: HealthKitOptions): Promise<any> { deleteSamples(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
sumQuantityType(options: HealthKitOptions): Promise<any> { monitorSampleType(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
saveQuantitySample(options: HealthKitOptions): Promise<any> { sumQuantityType(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
saveCorrelation(options: HealthKitOptions): Promise<any> { saveQuantitySample(options: HealthKitOptions): Promise<any> { return; }
return;
}
/** /**
* *
* @param options {HealthKitOptions} * @param options {HealthKitOptions}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
queryCorrelationType(options: HealthKitOptions): Promise<any> { saveCorrelation(options: HealthKitOptions): Promise<any> { return; }
return;
} /**
*
* @param options {HealthKitOptions}
* @returns {Promise<any>}
*/
@Cordova()
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 { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/** /**
* @hidden * @hidden
*/ */
export interface HealthDataType { 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[]; 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[]; write?: string[];
} }
@ -201,6 +201,7 @@ export interface HealthData {
}) })
@Injectable() @Injectable()
export class Health extends IonicNativePlugin { export class Health extends IonicNativePlugin {
/** /**
* Tells if either Google Fit or HealthKit are available. * Tells if either Google Fit or HealthKit are available.
* *
@ -209,9 +210,7 @@ export class Health extends IonicNativePlugin {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
isAvailable(): Promise<boolean> { isAvailable(): Promise<boolean> { return; }
return;
}
/** /**
* Checks if recent Google Play Services and Google Fit are installed. If the play services are not installed, * Checks if recent Google Play Services and Google Fit are installed. If the play services are not installed,
@ -227,9 +226,7 @@ export class Health extends IonicNativePlugin {
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
}) })
promptInstallFit(): Promise<any> { promptInstallFit(): Promise<any> { return; }
return;
}
/** /**
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app * Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
@ -251,11 +248,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
requestAuthorization( requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
datatypes: Array<string | HealthDataType>
): Promise<any> {
return;
}
/** /**
* Check if the app has authorization to read/write a set of datatypes. * Check if the app has authorization to read/write a set of datatypes.
@ -269,9 +262,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status * @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
*/ */
@Cordova() @Cordova()
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
return;
}
/** /**
* Gets all the data points of a certain data type within a certain time window. * Gets all the data points of a certain data type within a certain time window.
@ -305,9 +296,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<HealthData>} * @return {Promise<HealthData>}
*/ */
@Cordova() @Cordova()
query(queryOptions: HealthQueryOptions): Promise<HealthData> { query(queryOptions: HealthQueryOptions): Promise<HealthData> { return; }
return;
}
/** /**
* Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity. * Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity.
@ -331,11 +320,7 @@ export class Health extends IonicNativePlugin {
* @return {Promise<HealthData[]>} * @return {Promise<HealthData[]>}
*/ */
@Cordova() @Cordova()
queryAggregated( queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise<HealthData[]> { return; }
queryOptionsAggregated: HealthQueryOptionsAggregated
): Promise<HealthData[]> {
return;
}
/** /**
* Stores a data point. * Stores a data point.
@ -352,7 +337,6 @@ export class Health extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
store(storeOptions: HealthStoreOptions): Promise<any> { store(storeOptions: HealthStoreOptions): Promise<any> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,22 +1,15 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
CordovaInstance,
InstanceCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer'; import { Observer } from 'rxjs/Observer';
declare const cordova: Cordova & { InAppBrowser: any }; declare const cordova: Cordova & { InAppBrowser: any; };
export interface InAppBrowserOptions { export interface InAppBrowserOptions {
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */ /** Set to yes or no to turn the InAppBrowser's location bar on or off. */
location?: 'yes' | 'no'; location?: 'yes' | 'no';
/** /** Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete.
* Set to yes to create the browser and load the page, but not show it. The loadstop event fires when loading is complete. * Omit or set to no (default) to have the browser open and load normally. */
* Omit or set to no (default) to have the browser open and load normally.
**/
hidden?: 'yes' | 'no'; hidden?: 'yes' | 'no';
/** Set to yes to have the browser's cookie cache cleared before the new window is opened. */ /** Set to yes to have the browser's cookie cache cleared before the new window is opened. */
clearcache?: 'yes'; clearcache?: 'yes';
@ -24,10 +17,8 @@ export interface InAppBrowserOptions {
clearsessioncache?: 'yes'; clearsessioncache?: 'yes';
/** (Android Only) set to yes to show Android browser's zoom controls, set to no to hide them. Default value is 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'; zoom?: 'yes' | 'no';
/** /** Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* 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. */
* 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'; hardwareback?: 'yes' | 'no';
/** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */ /** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */
mediaPlaybackRequiresUserAction?: 'yes' | 'no'; mediaPlaybackRequiresUserAction?: 'yes' | 'no';
@ -54,10 +45,8 @@ export interface InAppBrowserOptions {
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical'; 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. */ /** (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'; toolbarposition?: 'top' | 'bottom';
/** /** (Windows only) Set to yes to create the browser control without a border around it.
* (Windows only) Set to yes to create the browser control without a border around it. * Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window.
**/
fullscreen?: 'yes'; fullscreen?: 'yes';
/** /**
@ -80,6 +69,7 @@ export interface InAppBrowserEvent extends Event {
* @hidden * @hidden
*/ */
export class InAppBrowserObject { export class InAppBrowserObject {
private _objectInstance: any; private _objectInstance: any;
/** /**
@ -93,24 +83,20 @@ export class InAppBrowserObject {
* The options string must not contain any blank space, and each feature's * 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. * name/value pairs must be separated by a comma. Feature names are case insensitive.
*/ */
constructor( constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
url: string,
target?: string,
options?: string | InAppBrowserOptions
) {
try { try {
if (options && typeof options !== 'string') { if (options && typeof options !== 'string') {
options = Object.keys(options) options = Object.keys(options).map((key: string) => `${key}=${(<InAppBrowserOptions>options)[key]}`).join(',');
.map((key: string) => `${key}=${(<InAppBrowserOptions>options)[key]}`)
.join(',');
} }
this._objectInstance = cordova.InAppBrowser.open(url, target, options); this._objectInstance = cordova.InAppBrowser.open(url, target, options);
} catch (e) { } catch (e) {
window.open(url, target); window.open(url, target);
console.warn( console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
'Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.'
);
} }
} }
@ -119,20 +105,20 @@ export class InAppBrowserObject {
* if the InAppBrowser was already visible. * if the InAppBrowser was already visible.
*/ */
@CordovaInstance({ sync: true }) @CordovaInstance({ sync: true })
show(): void {} show(): void { }
/** /**
* Closes the InAppBrowser window. * Closes the InAppBrowser window.
*/ */
@CordovaInstance({ sync: true }) @CordovaInstance({ sync: true })
close(): void {} close(): void { }
/** /**
* Hides an InAppBrowser window that is currently shown. Calling this has no effect * Hides an InAppBrowser window that is currently shown. Calling this has no effect
* if the InAppBrowser was already hidden. * if the InAppBrowser was already hidden.
*/ */
@CordovaInstance({ sync: true }) @CordovaInstance({ sync: true })
hide(): void {} hide(): void { }
/** /**
* Injects JavaScript code into the InAppBrowser window. * Injects JavaScript code into the InAppBrowser window.
@ -140,9 +126,7 @@ export class InAppBrowserObject {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@CordovaInstance() @CordovaInstance()
executeScript(script: { file?: string; code?: string }): Promise<any> { executeScript(script: { file?: string, code?: string }): Promise<any> { return; }
return;
}
/** /**
* Injects CSS into the InAppBrowser window. * Injects CSS into the InAppBrowser window.
@ -150,9 +134,7 @@ export class InAppBrowserObject {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@CordovaInstance() @CordovaInstance()
insertCSS(css: { file?: string; code?: string }): Promise<any> { insertCSS(css: { file?: string, code?: string }): Promise<any> { return; }
return;
}
/** /**
* A method that allows you to listen to events happening in the browser. * A method that allows you to listen to events happening in the browser.
@ -161,19 +143,10 @@ export class InAppBrowserObject {
*/ */
@InstanceCheck() @InstanceCheck()
on(event: string): Observable<InAppBrowserEvent> { on(event: string): Observable<InAppBrowserEvent> {
return new Observable<InAppBrowserEvent>( return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
(observer: Observer<InAppBrowserEvent>) => { this._objectInstance.addEventListener(event, observer.next.bind(observer));
this._objectInstance.addEventListener( return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
event, });
observer.next.bind(observer)
);
return () =>
this._objectInstance.removeEventListener(
event,
observer.next.bind(observer)
);
}
);
} }
} }
@ -212,6 +185,7 @@ export class InAppBrowserObject {
}) })
@Injectable() @Injectable()
export class InAppBrowser extends IonicNativePlugin { export class InAppBrowser extends IonicNativePlugin {
/** /**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser. * Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url {string} The URL to load. * @param url {string} The URL to load.
@ -221,11 +195,8 @@ export class InAppBrowser extends IonicNativePlugin {
* name/value pairs must be separated by a comma. Feature names are case insensitive. * name/value pairs must be separated by a comma. Feature names are case insensitive.
* @returns {InAppBrowserObject} * @returns {InAppBrowserObject}
*/ */
create( create(url: string, target?: string, options?: string | InAppBrowserOptions): InAppBrowserObject {
url: string,
target?: string,
options?: string | InAppBrowserOptions
): InAppBrowserObject {
return new InAppBrowserObject(url, target, options); return new InAppBrowserObject(url, target, options);
} }
} }

View File

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

View File

@ -1,5 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/** /**
* @name In App Purchase * @name In App Purchase
@ -61,6 +62,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
}) })
@Injectable() @Injectable()
export class InAppPurchase extends IonicNativePlugin { export class InAppPurchase extends IonicNativePlugin {
/** /**
* Retrieves a list of full product data from Apple/Google. This method must be called before making purchases. * 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. * @param {array<string>} productId an array of product ids.
@ -69,9 +71,7 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({ @Cordova({
otherPromise: true otherPromise: true
}) })
getProducts(productId: string[]): Promise<any> { getProducts(productId: string[]): Promise<any> { return; }
return;
}
/** /**
* Buy a product that matches the productId. * Buy a product that matches the productId.
@ -81,16 +81,7 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({ @Cordova({
otherPromise: true otherPromise: true
}) })
buy( buy(productId: string): Promise<{ transactionId: string, receipt: string, signature: string, productType: string }> { return; }
productId: string
): Promise<{
transactionId: string;
receipt: string;
signature: string;
productType: string;
}> {
return;
}
/** /**
* Same as buy, but for subscription based products. * Same as buy, but for subscription based products.
@ -100,16 +91,7 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({ @Cordova({
otherPromise: true otherPromise: true
}) })
subscribe( subscribe(productId: string): Promise<{ transactionId: string, receipt: string, signature: string, productType: string }> { return; }
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: * 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:
@ -121,13 +103,7 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({ @Cordova({
otherPromise: true otherPromise: true
}) })
consume( consume(productType: string, receipt: string, signature: string): Promise<any> { return; }
productType: string,
receipt: string,
signature: string
): Promise<any> {
return;
}
/** /**
* Restore all purchases from the store * Restore all purchases from the store
@ -136,9 +112,7 @@ export class InAppPurchase extends IonicNativePlugin {
@Cordova({ @Cordova({
otherPromise: true otherPromise: true
}) })
restorePurchases(): Promise<any> { restorePurchases(): Promise<any> { return; }
return;
}
/** /**
* Get the receipt. * Get the receipt.
@ -148,7 +122,6 @@ export class InAppPurchase extends IonicNativePlugin {
otherPromise: true, otherPromise: true,
platforms: ['iOS'] platforms: ['iOS']
}) })
getReceipt(): Promise<string> { getReceipt(): Promise<string> { return; }
return;
}
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
Cordova,
CordovaCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
declare const cordova: any; declare const cordova: any;
@ -54,9 +49,7 @@ export class JinsMeme extends IonicNativePlugin {
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
setAppClientID(appClientId: string, clientSecret: string): Promise<any> { setAppClientID(appClientId: string, clientSecret: string): Promise<any> { return; }
return;
}
/** /**
* Starts scanning for JINS MEME. * Starts scanning for JINS MEME.
* @returns {Observable<any>} * @returns {Observable<any>}
@ -66,17 +59,13 @@ export class JinsMeme extends IonicNativePlugin {
clearFunction: 'stopScan', clearFunction: 'stopScan',
clearWithArgs: true clearWithArgs: true
}) })
startScan(): Observable<any> { startScan(): Observable<any> { return; }
return;
}
/** /**
* Stops scanning JINS MEME. * Stops scanning JINS MEME.
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
stopScan(): Promise<any> { stopScan(): Promise<any> { return; }
return;
}
/** /**
* Establishes connection to JINS MEME. * Establishes connection to JINS MEME.
* @param {string} target * @param {string} target
@ -87,12 +76,7 @@ export class JinsMeme extends IonicNativePlugin {
}) })
connect(target: string): Observable<any> { connect(target: string): Observable<any> {
return new Observable<any>((observer: any) => { return new Observable<any>((observer: any) => {
let data = cordova.plugins.JinsMemePlugin.connect( let data = cordova.plugins.JinsMemePlugin.connect(target, observer.next.bind(observer), observer.complete.bind(observer), observer.error.bind(observer));
target,
observer.next.bind(observer),
observer.complete.bind(observer),
observer.error.bind(observer)
);
return () => console.log(data); return () => console.log(data);
}); });
} }
@ -102,25 +86,19 @@ export class JinsMeme extends IonicNativePlugin {
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
setAutoConnect(flag: boolean): Promise<any> { setAutoConnect(flag: boolean): Promise<any> { return; }
return;
}
/** /**
* Returns whether a connection to JINS MEME has been established. * Returns whether a connection to JINS MEME has been established.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
isConnected(): Promise<any> { isConnected(): Promise<any> { return; }
return;
}
/** /**
* Disconnects from JINS MEME. * Disconnects from JINS MEME.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
disconnect(): Promise<any> { disconnect(): Promise<any> { return; }
return;
}
/** /**
* Starts receiving realtime data. * Starts receiving realtime data.
* @returns {Observable<any>} * @returns {Observable<any>}
@ -130,80 +108,60 @@ export class JinsMeme extends IonicNativePlugin {
clearFunction: 'stopDataReport', clearFunction: 'stopDataReport',
clearWithArgs: true clearWithArgs: true
}) })
startDataReport(): Observable<any> { startDataReport(): Observable<any> { return; }
return;
}
/** /**
* Stops receiving data. * Stops receiving data.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
stopDataReport(): Promise<any> { stopDataReport(): Promise<any> { return; }
return;
}
/** /**
* Returns SDK version. * Returns SDK version.
* *
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getSDKVersion(): Promise<any> { getSDKVersion(): Promise<any> { return; }
return;
}
/** /**
* Returns JINS MEME connected with other apps. * Returns JINS MEME connected with other apps.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getConnectedByOthers(): Promise<any> { getConnectedByOthers(): Promise<any> { return; }
return;
}
/** /**
* Returns calibration status * Returns calibration status
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
isCalibrated(): Promise<any> { isCalibrated(): Promise<any> { return; }
return;
}
/** /**
* Returns device type. * Returns device type.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getConnectedDeviceType(): Promise<any> { getConnectedDeviceType(): Promise<any> { return; }
return;
}
/** /**
* Returns hardware version. * Returns hardware version.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getConnectedDeviceSubType(): Promise<any> { getConnectedDeviceSubType(): Promise<any> { return; }
return;
}
/** /**
* Returns FW Version. * Returns FW Version.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getFWVersion(): Promise<any> { getFWVersion(): Promise<any> { return; }
return;
}
/** /**
* Returns HW Version. * Returns HW Version.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getHWVersion(): Promise<any> { getHWVersion(): Promise<any> { return; }
return;
}
/** /**
* Returns response about whether data was received or not. * Returns response about whether data was received or not.
*@returns {Promise<any>} *@returns {Promise<any>}
*/ */
@Cordova() @Cordova()
isDataReceiving(): Promise<any> { isDataReceiving(): Promise<any> { return; }
return;
}
} }

View File

@ -1,7 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Keyboard * @name Keyboard
* @description * @description
@ -28,12 +29,13 @@ import { Observable } from 'rxjs/Observable';
}) })
@Injectable() @Injectable()
export class Keyboard extends IonicNativePlugin { export class Keyboard extends IonicNativePlugin {
/** /**
* Hide the keyboard accessory bar with the next, previous and done buttons. * Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean} * @param hide {boolean}
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
hideKeyboardAccessoryBar(hide: boolean): void {} hideKeyboardAccessoryBar(hide: boolean): void { }
/** /**
* Force keyboard to be shown. * Force keyboard to be shown.
@ -42,7 +44,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true, sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows'] platforms: ['Android', 'BlackBerry 10', 'Windows']
}) })
show(): void {} show(): void { }
/** /**
* Close the keyboard if open. * Close the keyboard if open.
@ -51,7 +53,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true, sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
close(): void {} close(): void { }
/** /**
* Prevents the native UIScrollView from moving when an input is focused. * Prevents the native UIScrollView from moving when an input is focused.
@ -61,7 +63,7 @@ export class Keyboard extends IonicNativePlugin {
sync: true, sync: true,
platforms: ['iOS', 'Windows'] 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. * Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
@ -72,9 +74,7 @@ export class Keyboard extends IonicNativePlugin {
event: 'native.keyboardshow', event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
onKeyboardShow(): Observable<any> { onKeyboardShow(): Observable<any> { return; }
return;
}
/** /**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch. * Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
@ -85,7 +85,6 @@ export class Keyboard extends IonicNativePlugin {
event: 'native.keyboardhide', event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows'] platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
}) })
onKeyboardHide(): Observable<any> { onKeyboardHide(): Observable<any> { return; }
return;
}
} }

View File

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

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