chore(package): bump dependencies and lint rules

This commit is contained in:
Daniel
2018-03-16 22:04:01 +01:00
parent 7547a94c80
commit 21ad4734fa
178 changed files with 10565 additions and 4194 deletions
@@ -1,5 +1,10 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
import {
CordovaInstance,
InstanceCheck,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var cordova: any;
@@ -71,15 +76,24 @@ export interface ThemeableBrowserOptions {
* @hidden
*/
export class ThemeableBrowserObject {
private _objectInstance: any;
constructor(url: string, target: string, styleOptions: ThemeableBrowserOptions) {
constructor(
url: string,
target: string,
styleOptions: ThemeableBrowserOptions
) {
try {
this._objectInstance = cordova.ThemeableBrowser.open(url, target, styleOptions);
this._objectInstance = cordova.ThemeableBrowser.open(
url,
target,
styleOptions
);
} catch (e) {
window.open(url);
console.warn('Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.');
console.warn(
'Native: ThemeableBrowser is not installed or you are running on a browser. Falling back to window.open.'
);
}
}
@@ -88,19 +102,19 @@ export class ThemeableBrowserObject {
* if the browser was already visible.
*/
@CordovaInstance({ sync: true })
show(): void { }
show(): void {}
/**
* Closes the browser window.
*/
@CordovaInstance({ sync: true })
close(): void { }
close(): void {}
/**
* Reloads the current page
*/
@CordovaInstance({ sync: true })
reload(): void { }
reload(): void {}
/**
* Injects JavaScript code into the browser window.
@@ -108,7 +122,9 @@ export class ThemeableBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
executeScript(script: { file?: string, code?: string }): Promise<any> { return; }
executeScript(script: { file?: string; code?: string }): Promise<any> {
return;
}
/**
* Injects CSS into the browser window.
@@ -116,7 +132,9 @@ export class ThemeableBrowserObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
insertCss(css: { file?: string, code?: string }): Promise<any> { return; }
insertCss(css: { file?: string; code?: string }): Promise<any> {
return;
}
/**
* A method that allows you to listen to events happening in the browser.
@@ -126,12 +144,18 @@ export class ThemeableBrowserObject {
*/
@InstanceCheck({ observable: true })
on(event: string): Observable<any> {
return new Observable<any>((observer) => {
this._objectInstance.addEventListener(event, observer.next.bind(observer));
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
return new Observable<any>(observer => {
this._objectInstance.addEventListener(
event,
observer.next.bind(observer)
);
return () =>
this._objectInstance.removeEventListener(
event,
observer.next.bind(observer)
);
});
}
}
/**
@@ -224,11 +248,20 @@ export class ThemeableBrowserObject {
plugin: 'cordova-plugin-themeablebrowser',
pluginRef: 'cordova.ThemeableBrowser',
repo: 'https://github.com/initialxy/cordova-plugin-themeablebrowser',
platforms: ['Amazon Fire OS', 'Android', 'Blackberry 10', 'Browser', 'FirefoxOS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
platforms: [
'Amazon Fire OS',
'Android',
'Blackberry 10',
'Browser',
'FirefoxOS',
'iOS',
'Ubuntu',
'Windows',
'Windows Phone'
]
})
@Injectable()
export class ThemeableBrowser extends IonicNativePlugin {
/**
* Creates a browser instance
* @param url {string} URL to open
@@ -236,8 +269,11 @@ export class ThemeableBrowser extends IonicNativePlugin {
* @param styleOptions {ThemeableBrowserOptions} Themeable browser options
* @returns {ThemeableBrowserObject}
*/
create(url: string, target: string, styleOptions: ThemeableBrowserOptions): ThemeableBrowserObject {
create(
url: string,
target: string,
styleOptions: ThemeableBrowserOptions
): ThemeableBrowserObject {
return new ThemeableBrowserObject(url, target, styleOptions);
}
}