From dbcb103adc8c3ea506477acbfe3bb4b6bdbcf40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Fern=C3=A1ndez?= Date: Tue, 9 Jan 2018 20:12:49 +0100 Subject: [PATCH 01/13] fix(web-intent): rename `onNewIntent` to `onIntent` The `onNewIntent` function doesn't exist in `darryncampbell-cordova-plugin-intent`, it's actually called `onIntent`. --- src/@ionic-native/plugins/web-intent/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/@ionic-native/plugins/web-intent/index.ts b/src/@ionic-native/plugins/web-intent/index.ts index a41f063b..471ab67f 100644 --- a/src/@ionic-native/plugins/web-intent/index.ts +++ b/src/@ionic-native/plugins/web-intent/index.ts @@ -147,12 +147,13 @@ export class WebIntent extends IonicNativePlugin { getUri(): Promise { return; }; /** + * Returns the content of the intent used whenever the application activity is launched * @returns {Observable} */ @Cordova({ observable: true }) - onNewIntent(): Observable { return; }; + onIntent(): Observable { return; }; /** * Sends a custom intent passing optional extras @@ -175,12 +176,6 @@ export class WebIntent extends IonicNativePlugin { @Cordova({ sync: true }) unregisterBroadcastReceiver(): void { } - /** - * Returns the content of the intent used whenever the application activity is launched - */ - @Cordova({ sync: true }) - onIntent(): void { } - /** * */ From e5b9d53b179fedb939911753076e579ab7c12748 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Mon, 19 Mar 2018 09:10:25 +0100 Subject: [PATCH 02/13] fix(google-maps): wrong decorators --- .../plugins/google-maps/index.ts | 861 ++++++++++++------ 1 file changed, 597 insertions(+), 264 deletions(-) diff --git a/src/@ionic-native/plugins/google-maps/index.ts b/src/@ionic-native/plugins/google-maps/index.ts index 3d875b2b..d776ba53 100644 --- a/src/@ionic-native/plugins/google-maps/index.ts +++ b/src/@ionic-native/plugins/google-maps/index.ts @@ -1,16 +1,29 @@ -import { Injectable } from '@angular/core'; -import { CordovaCheck, CordovaInstance, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core'; -import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/fromEvent'; +import { Injectable } from '@angular/core'; +import { + checkAvailability, + CordovaCheck, + CordovaInstance, + InstanceCheck, + InstanceProperty, + IonicNativePlugin, + Plugin +} from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; -export type MapType = 'MAP_TYPE_NORMAL' | 'MAP_TYPE_ROADMAP' | 'MAP_TYPE_SATELLITE' | 'MAP_TYPE_HYBRID' | 'MAP_TYPE_TERRAIN' | 'MAP_TYPE_NONE'; +export type MapType = + | 'MAP_TYPE_NORMAL' + | 'MAP_TYPE_ROADMAP' + | 'MAP_TYPE_SATELLITE' + | 'MAP_TYPE_HYBRID' + | 'MAP_TYPE_TERRAIN' + | 'MAP_TYPE_NONE'; /** * @hidden */ export class LatLng implements ILatLng { - lat: number; lng: number; @@ -43,12 +56,11 @@ export interface ILatLngBounds { * @hidden */ export class LatLngBounds implements ILatLngBounds { - private _objectInstance: any; - @InstanceProperty northeast: ILatLng; - @InstanceProperty southwest: ILatLng; - @InstanceProperty type: string; + @InstanceProperty() northeast: ILatLng; + @InstanceProperty() southwest: ILatLng; + @InstanceProperty() type: string; constructor(points?: ILatLng[]) { this._objectInstance = new (GoogleMaps.getPlugin()).LatLngBounds(points); @@ -59,7 +71,9 @@ export class LatLngBounds implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toString(): string { return; } + toString(): string { + return; + } /** * Returns a string of the form "lat_sw,lng_sw,lat_ne,lng_ne" for this bounds, where "sw" corresponds to the southwest corner of the bounding box, while "ne" corresponds to the northeast corner of that box. @@ -67,7 +81,9 @@ export class LatLngBounds implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toUrlValue(precision?: number): string { return; } + toUrlValue(precision?: number): string { + return; + } /** * Extends this bounds to contain the given point. @@ -81,18 +97,21 @@ export class LatLngBounds implements ILatLngBounds { * @param LatLng {ILatLng} */ @CordovaInstance({ sync: true }) - contains(LatLng: ILatLng): boolean { return; } + contains(LatLng: ILatLng): boolean { + return; + } /** * Computes the center of this LatLngBounds * @return {LatLng} */ @CordovaInstance({ sync: true }) - getCenter(): LatLng { return; } + getCenter(): LatLng { + return; + } } export interface GoogleMapControlOptions { - /** * Turns the compass on or off. */ @@ -132,7 +151,6 @@ export interface GoogleMapControlOptions { } export interface GoogleMapGestureOptions { - /** * Set false to disable the scroll gesture (default: true) */ @@ -172,7 +190,6 @@ export interface GoogleMapPaddingOptions { } export interface GoogleMapPreferenceOptions { - /** * Minimum and maximum zoom levels for zooming gestures. */ @@ -195,7 +212,6 @@ export interface GoogleMapPreferenceOptions { } export interface GoogleMapOptions { - /** * mapType [options] */ @@ -328,7 +344,6 @@ export interface CircleOptions { } export interface GeocoderRequest { - /** * The address property or position property is required. * You can not specify both property at the same time. @@ -375,7 +390,7 @@ export interface GeocoderResult { lines?: Array; permises?: string; phone?: string; - url?: string + url?: string; }; locale?: string; locality?: string; @@ -732,7 +747,6 @@ export interface ToDataUrlOptions { uncompress?: boolean; } - /** * Options for map.addKmlOverlay() method */ @@ -758,7 +772,6 @@ export interface KmlOverlayOptions { [key: string]: any; } - /** * @hidden */ @@ -769,41 +782,55 @@ export class VisibleRegion implements ILatLngBounds { * The northeast of the bounds that contains the farLeft, farRight, nearLeft and nearRight. * Since the map view is able to rotate, the farRight is not the same as the northeast. */ - @InstanceProperty northeast: ILatLng; + @InstanceProperty() northeast: ILatLng; /** * The southwest of the bounds that contains the farLeft, farRight, nearLeft and nearRight. * Since the map view is able to rotate, the nearLeft is not the same as the southwest. */ - @InstanceProperty southwest: ILatLng; + @InstanceProperty() southwest: ILatLng; /** * The nearRight indicates the lat/lng of the top-left of the map view. */ - @InstanceProperty farLeft: ILatLng; + @InstanceProperty() farLeft: ILatLng; /** * The nearRight indicates the lat/lng of the top-right of the map view. */ - @InstanceProperty farRight: ILatLng; + @InstanceProperty() farRight: ILatLng; /** * The nearRight indicates the lat/lng of the bottom-left of the map view. */ - @InstanceProperty nearLeft: ILatLng; + @InstanceProperty() nearLeft: ILatLng; /** * The nearRight indicates the lat/lng of the bottom-right of the map view. */ - @InstanceProperty nearRight: ILatLng; + @InstanceProperty() nearRight: ILatLng; /** * constant value : `VisibleRegion` */ - @InstanceProperty type: string; + @InstanceProperty() type: string; - constructor(southwest: LatLngBounds, northeast: LatLngBounds, farLeft: ILatLng, farRight: ILatLng, nearLeft: ILatLng, nearRight: ILatLng) { - this._objectInstance = new (GoogleMaps.getPlugin()).VisibleRegion(southwest, northeast, farLeft, farRight, nearLeft, nearRight); + constructor( + southwest: LatLngBounds, + northeast: LatLngBounds, + farLeft: ILatLng, + farRight: ILatLng, + nearLeft: ILatLng, + nearRight: ILatLng + ) { + this._objectInstance = new (GoogleMaps.getPlugin()).VisibleRegion( + southwest, + northeast, + farLeft, + farRight, + nearLeft, + nearRight + ); } /** @@ -811,7 +838,9 @@ export class VisibleRegion implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toString(): string { return; } + toString(): string { + return; + } /** * Returns a string of the form "lat_sw,lng_sw,lat_ne,lng_ne" for this bounds, where "sw" corresponds to the southwest corner of the bounding box, while "ne" corresponds to the northeast corner of that box. @@ -819,16 +848,18 @@ export class VisibleRegion implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toUrlValue(precision?: number): string { return; } - + toUrlValue(precision?: number): string { + return; + } /** * Returns true if the given lat/lng is in this bounds. * @param LatLng {ILatLng} */ @CordovaInstance({ sync: true }) - contains(LatLng: ILatLng): boolean { return; } - + contains(LatLng: ILatLng): boolean { + return; + } } /** @@ -869,7 +900,7 @@ export const GoogleMapsEvent = { /** * @hidden */ -export const GoogleMapsAnimation: { [animationName: string]: string; } = { +export const GoogleMapsAnimation: { [animationName: string]: string } = { BOUNCE: 'BOUNCE', DROP: 'DROP' }; @@ -877,7 +908,7 @@ export const GoogleMapsAnimation: { [animationName: string]: string; } = { /** * @hidden */ -export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = { +export const GoogleMapsMapTypeId: { [mapType: string]: MapType } = { NORMAL: 'MAP_TYPE_NORMAL', ROADMAP: 'MAP_TYPE_ROADMAP', SATELLITE: 'MAP_TYPE_SATELLITE', @@ -1004,24 +1035,32 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = { pluginRef: 'plugin.google.maps', plugin: 'cordova-plugin-googlemaps', repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps', - document: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md', - install: 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"', + document: + 'https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md', + install: + 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"', installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'], platforms: ['Android', 'iOS'] }) @Injectable() export class GoogleMaps extends IonicNativePlugin { - /** * Creates a new GoogleMap instance * @param element {string | HTMLElement} Element ID or reference to attach the map to * @param options {GoogleMapOptions} [options] Options * @return {GoogleMap} */ - static create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap { + static create( + element: string | HTMLElement | GoogleMapOptions, + options?: GoogleMapOptions + ): GoogleMap { if (element instanceof HTMLElement) { if (element.getAttribute('__pluginMapId')) { - console.error('GoogleMaps', element.tagName + '[__pluginMapId=\'' + element.getAttribute('__pluginMapId') + '\'] has already map.'); + console.error( + `GoogleMaps ${element.tagName}[__pluginMapId='${element.getAttribute( + '__pluginMapId' + )}'] has already map.` + ); return; } } else if (typeof element === 'object') { @@ -1037,11 +1076,13 @@ export class GoogleMaps extends IonicNativePlugin { * @deprecation * @hidden */ - create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap { + create( + element: string | HTMLElement | GoogleMapOptions, + options?: GoogleMapOptions + ): GoogleMap { console.error('GoogleMaps', '[deprecated] Please use GoogleMaps.create()'); return GoogleMaps.create(element, options); } - } /** @@ -1064,7 +1105,7 @@ export class BaseClass { */ @InstanceCheck({ observable: true }) addEventListener(eventName: string): Observable { - return new Observable((observer) => { + return new Observable(observer => { this._objectInstance.on(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1083,7 +1124,9 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance + .getMap() + .get('_overlays')[args[args.length - 1].getId()]; } } observer.next(args); @@ -1098,7 +1141,7 @@ export class BaseClass { */ @InstanceCheck() addListenerOnce(eventName: string): Promise { - return new Promise((resolve) => { + return new Promise(resolve => { this._objectInstance.one(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1117,7 +1160,9 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance + .getMap() + .get('_overlays')[args[args.length - 1].getId()]; } } resolve(args); @@ -1130,7 +1175,9 @@ export class BaseClass { * @param key {any} */ @CordovaInstance({ sync: true }) - get(key: string): any { return; } + get(key: string): any { + return; + } /** * Sets a value @@ -1139,7 +1186,7 @@ export class BaseClass { * @param noNotify {boolean} [options] True if you want to prevent firing the `(key)_changed` event. */ @CordovaInstance({ sync: true }) - set(key: string, value: any, noNotify?: boolean): void { } + set(key: string, value: any, noNotify?: boolean): void {} /** * Bind a key to another object @@ -1149,7 +1196,12 @@ export class BaseClass { * @param noNotify? {boolean} [options] True if you want to prevent `(key)_changed` event when you bind first time, because the internal status is changed from `undefined` to something. */ @CordovaInstance({ sync: true }) - bindTo(key: string, target: any, targetKey?: string, noNotify?: boolean): void { } + bindTo( + key: string, + target: any, + targetKey?: string, + noNotify?: boolean + ): void {} /** * Alias of `addEventListener` @@ -1158,7 +1210,7 @@ export class BaseClass { */ @InstanceCheck({ observable: true }) on(eventName: string): Observable { - return new Observable((observer) => { + return new Observable(observer => { this._objectInstance.on(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1177,7 +1229,9 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance + .getMap() + .get('_overlays')[args[args.length - 1].getId()]; } } observer.next(args); @@ -1192,7 +1246,7 @@ export class BaseClass { */ @InstanceCheck() one(eventName: string): Promise { - return new Promise((resolve) => { + return new Promise(resolve => { this._objectInstance.one(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1211,7 +1265,9 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance + .getMap() + .get('_overlays')[args[args.length - 1].getId()]; } } resolve(args); @@ -1223,7 +1279,7 @@ export class BaseClass { * Clears all stored values */ @CordovaInstance({ sync: true }) - empty(): void { } + empty(): void {} /** * Dispatch event. @@ -1233,7 +1289,6 @@ export class BaseClass { @CordovaInstance({ sync: true }) trigger(eventName: string, ...parameters: any[]): void {} - /** * Executes off() and empty() */ @@ -1241,7 +1296,9 @@ export class BaseClass { destroy(): void { let map: GoogleMap = this._objectInstance.getMap(); if (map) { - delete this._objectInstance.getMap().get('_overlays')[this._objectInstance.getId()]; + delete this._objectInstance.getMap().get('_overlays')[ + this._objectInstance.getId() + ]; } this._objectInstance.remove(); } @@ -1260,7 +1317,10 @@ export class BaseClass { * @param listener {Function} [options] Event listener */ @CordovaInstance({ sync: true }) - removeEventListener(eventName?: string, listener?: (...parameters: any[]) => void): void {} + removeEventListener( + eventName?: string, + listener?: (...parameters: any[]) => void + ): void {} /** * Alias of `removeEventListener` @@ -1270,7 +1330,6 @@ export class BaseClass { */ @CordovaInstance({ sync: true }) off(eventName?: string, listener?: (...parameters: any[]) => void): void {} - } /** @@ -1284,13 +1343,14 @@ export class BaseClass { repo: '' }) export class BaseArrayClass extends BaseClass { - constructor(initialData?: T[] | any) { super(); if (initialData instanceof GoogleMaps.getPlugin().BaseArrayClass) { this._objectInstance = initialData; } else { - this._objectInstance = new (GoogleMaps.getPlugin().BaseArrayClass)(initialData); + this._objectInstance = new (GoogleMaps.getPlugin()).BaseArrayClass( + initialData + ); } } @@ -1314,8 +1374,10 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} */ @CordovaCheck() - forEachAsync(fn: ((element: T, callback: () => void) => void)): Promise { - return new Promise((resolve) => { + forEachAsync( + fn: ((element: T, callback: () => void) => void) + ): Promise { + return new Promise(resolve => { this._objectInstance.forEachAsync(fn, resolve); }); } @@ -1327,7 +1389,9 @@ export class BaseArrayClass extends BaseClass { * @return {Array} returns a new array with the results */ @CordovaInstance({ sync: true }) - map(fn: (element: T, index: number) => any): any[] { return; } + map(fn: (element: T, index: number) => any): any[] { + return; + } /** * Iterate over each element, calling the provided callback. @@ -1337,8 +1401,10 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new array with the results */ @CordovaCheck() - mapAsync(fn: ((element: T, callback: (newElement: any) => void) => void)): Promise { - return new Promise((resolve) => { + mapAsync( + fn: ((element: T, callback: (newElement: any) => void) => void) + ): Promise { + return new Promise(resolve => { this._objectInstance.mapAsync(fn, resolve); }); } @@ -1350,8 +1416,10 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new array with the results */ @CordovaCheck() - mapSeries(fn: ((element: T, callback: (newElement: any) => void) => void)): Promise { - return new Promise((resolve) => { + mapSeries( + fn: ((element: T, callback: (newElement: any) => void) => void) + ): Promise { + return new Promise(resolve => { this._objectInstance.mapSeries(fn, resolve); }); } @@ -1362,7 +1430,9 @@ export class BaseArrayClass extends BaseClass { * @return {Array} returns a new filtered array */ @CordovaInstance({ sync: true }) - filter(fn: (element: T, index: number) => boolean): T[] { return; } + filter(fn: (element: T, index: number) => boolean): T[] { + return; + } /** * The filterAsync() method creates a new array with all elements that pass the test implemented by the provided function. @@ -1371,8 +1441,10 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new filtered array */ @CordovaCheck() - filterAsync(fn: (element: T, callback: (result: boolean) => void) => void): Promise { - return new Promise((resolve) => { + filterAsync( + fn: (element: T, callback: (result: boolean) => void) => void + ): Promise { + return new Promise(resolve => { this._objectInstance.filterAsync(fn, resolve); }); } @@ -1382,7 +1454,9 @@ export class BaseArrayClass extends BaseClass { * @return {Array} */ @CordovaInstance({ sync: true }) - getArray(): T[] { return; } + getArray(): T[] { + return; + } /** * Returns the element at the specified index. @@ -1397,7 +1471,9 @@ export class BaseArrayClass extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getLength(): number { return; } + getLength(): number { + return; + } /** * The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present. @@ -1405,7 +1481,9 @@ export class BaseArrayClass extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - indexOf(element: T): number { return; } + indexOf(element: T): number { + return; + } /** * The reverse() method reverses an array in place. @@ -1435,7 +1513,9 @@ export class BaseArrayClass extends BaseClass { * @return {Object} */ @CordovaInstance({ sync: true }) - pop(noNotify?: boolean): T { return; } + pop(noNotify?: boolean): T { + return; + } /** * Adds one element to the end of the array and returns the new length of the array. @@ -1468,7 +1548,6 @@ export class BaseArrayClass extends BaseClass { * https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/class/Circle/README.md */ export class Circle extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -1482,13 +1561,17 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Change the center position. @@ -1502,14 +1585,18 @@ export class Circle extends BaseClass { * @return {ILatLng} */ @CordovaInstance({ sync: true }) - getCenter(): ILatLng { return; } + getCenter(): ILatLng { + return; + } /** * Return the current circle radius. * @return {number} */ @CordovaInstance({ sync: true }) - getRadius(): number { return; } + getRadius(): number { + return; + } /** * Change the circle radius. @@ -1530,7 +1617,9 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getFillColor(): string { return; } + getFillColor(): string { + return; + } /** * Change the stroke width. @@ -1544,7 +1633,9 @@ export class Circle extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { return; } + getStrokeWidth(): number { + return; + } /** * Change the stroke color (outter color). @@ -1558,7 +1649,9 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { return; } + getStrokeColor(): string { + return; + } /** * Change clickablity of the circle. @@ -1572,7 +1665,9 @@ export class Circle extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { return; } + getClickable(): boolean { + return; + } /** * Change the circle zIndex order. @@ -1586,7 +1681,9 @@ export class Circle extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Remove the circle. @@ -1599,7 +1696,9 @@ export class Circle extends BaseClass { * @return {LatLngBounds} */ @CordovaInstance({ sync: true }) - getBounds(): LatLngBounds { return; } + getBounds(): LatLngBounds { + return; + } /** * Set circle visibility @@ -1613,7 +1712,9 @@ export class Circle extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } } /** @@ -1626,14 +1727,15 @@ export class Circle extends BaseClass { repo: '' }) export class Environment { - /** * Get the open source software license information for Google Maps SDK for iOS. * @return {Promise} */ static getLicenseInfo(): Promise { - return new Promise((resolve) => { - GoogleMaps.getPlugin().environment.getLicenseInfo((text: string) => resolve(text)); + return new Promise(resolve => { + GoogleMaps.getPlugin().environment.getLicenseInfo((text: string) => + resolve(text) + ); }); } @@ -1642,7 +1744,10 @@ export class Environment { * @hidden */ getLicenseInfo(): Promise { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.getLicenseInfo()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Environment.getLicenseInfo()' + ); return Environment.getLicenseInfo(); } @@ -1659,7 +1764,10 @@ export class Environment { * @hidden */ setBackgroundColor(color: string): void { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.setBackgroundColor()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Environment.setBackgroundColor()' + ); Environment.setBackgroundColor(color); } } @@ -1674,13 +1782,17 @@ export class Environment { repo: '' }) export class Geocoder { - /** * @deprecation * @hidden */ - geocode(request: GeocoderRequest): Promise> { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Geocoder.geocode()'); + geocode( + request: GeocoderRequest + ): Promise> { + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Geocoder.geocode()' + ); return Geocoder.geocode(request); } @@ -1689,10 +1801,15 @@ export class Geocoder { * @param {GeocoderRequest} request Request object with either an address or a position * @return {Promise>} */ - static geocode(request: GeocoderRequest): Promise> { - - if (request.address instanceof Array || Array.isArray(request.address) || - request.position instanceof Array || Array.isArray(request.position)) { + static geocode( + request: GeocoderRequest + ): Promise> { + if ( + request.address instanceof Array || + Array.isArray(request.address) || + request.position instanceof Array || + Array.isArray(request.position) + ) { // ------------------------- // Geocoder.geocode({ // address: [ @@ -1717,13 +1834,16 @@ export class Geocoder { // }) // ------------------------- return new Promise((resolve, reject) => { - GoogleMaps.getPlugin().Geocoder.geocode(request, (results: GeocoderResult[]) => { - if (results) { - resolve(results); - } else { - reject(); + GoogleMaps.getPlugin().Geocoder.geocode( + request, + (results: GeocoderResult[]) => { + if (results) { + resolve(results); + } else { + reject(); + } } - }); + ); }); } } @@ -1739,7 +1859,6 @@ export class Geocoder { repo: '' }) export class LocationService { - /** * Get the current device location without map * @return {Promise} @@ -1761,13 +1880,15 @@ export class LocationService { repo: '' }) export class Encoding { - /** * @deprecation * @hidden */ decodePath(encoded: string, precision?: number): Array { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.decodePath()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Encoding.decodePath()' + ); return Encoding.decodePath(encoded, precision); } @@ -1776,7 +1897,10 @@ export class Encoding { * @hidden */ encodePath(path: Array | BaseArrayClass): string { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.encodePath()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Encoding.encodePath()' + ); return Encoding.encodePath(path); } @@ -1787,7 +1911,10 @@ export class Encoding { * @return {ILatLng[]} */ static decodePath(encoded: string, precision?: number): Array { - return GoogleMaps.getPlugin().geometry.encoding.decodePath(encoded, precision); + return GoogleMaps.getPlugin().geometry.encoding.decodePath( + encoded, + precision + ); } /** @@ -1810,7 +1937,6 @@ export class Encoding { repo: '' }) export class Poly { - /** * Returns true if the speicified location is in the polygon path * @param location {ILatLng} @@ -1818,7 +1944,10 @@ export class Poly { * @return {boolean} */ static containsLocation(location: ILatLng, path: ILatLng[]): boolean { - return GoogleMaps.getPlugin().geometry.poly.containsLocation(location, path); + return GoogleMaps.getPlugin().geometry.poly.containsLocation( + location, + path + ); } /** @@ -1828,7 +1957,10 @@ export class Poly { * @return {boolean} */ static isLocationOnEdge(location: ILatLng, path: ILatLng[]): boolean { - return GoogleMaps.getPlugin().geometry.poly.isLocationOnEdge(location, path); + return GoogleMaps.getPlugin().geometry.poly.isLocationOnEdge( + location, + path + ); } } @@ -1842,13 +1974,15 @@ export class Poly { repo: '' }) export class Spherical { - /** * @deprecation * @hidden */ computeDistanceBetween(from: ILatLng, to: ILatLng): number { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeDistanceBetween()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeDistanceBetween()' + ); return Spherical.computeDistanceBetween(from, to); } @@ -1857,7 +1991,10 @@ export class Spherical { * @hidden */ computeOffset(from: ILatLng, distance: number, heading: number): LatLng { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffset()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeOffset()' + ); return Spherical.computeOffset(from, distance, heading); } @@ -1866,7 +2003,10 @@ export class Spherical { * @hidden */ computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffsetOrigin()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeOffsetOrigin()' + ); return Spherical.computeOffsetOrigin(to, distance, heading); } @@ -1875,7 +2015,10 @@ export class Spherical { * @hidden */ computeLength(path: Array | BaseArrayClass): number { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeLength()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeLength()' + ); return Spherical.computeLength(path); } @@ -1884,7 +2027,10 @@ export class Spherical { * @hidden */ computeArea(path: Array | BaseArrayClass): number { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeArea()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeArea()' + ); return Spherical.computeArea(path); } @@ -1893,7 +2039,10 @@ export class Spherical { * @hidden */ computeSignedArea(path: Array | BaseArrayClass): number { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeSignedArea()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeSignedArea()' + ); return Spherical.computeSignedArea(path); } @@ -1902,7 +2051,10 @@ export class Spherical { * @hidden */ computeHeading(from: ILatLng, to: ILatLng): number { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeHeading()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.computeHeading()' + ); return Spherical.computeHeading(from, to); } @@ -1911,16 +2063,13 @@ export class Spherical { * @hidden */ interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng { - console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.interpolate()'); + console.error( + 'GoogleMaps', + '[deprecated] This method is static. Please use Spherical.interpolate()' + ); return Spherical.interpolate(from, to, fraction); } - - - - - - /** * Returns the distance, in meters, between two LatLngs. * @param locationA {ILatLng} @@ -1928,7 +2077,10 @@ export class Spherical { * @return {number} */ static computeDistanceBetween(from: ILatLng, to: ILatLng): number { - return GoogleMaps.getPlugin().geometry.spherical.computeDistanceBetween(from, to); + return GoogleMaps.getPlugin().geometry.spherical.computeDistanceBetween( + from, + to + ); } /** @@ -1938,8 +2090,16 @@ export class Spherical { * @param heading {number} * @return {LatLng} */ - static computeOffset(from: ILatLng, distance: number, heading: number): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.computeOffset(from, distance, heading); + static computeOffset( + from: ILatLng, + distance: number, + heading: number + ): LatLng { + return GoogleMaps.getPlugin().geometry.spherical.computeOffset( + from, + distance, + heading + ); } /** @@ -1949,8 +2109,16 @@ export class Spherical { * @param heading {number} The heading in degrees clockwise from north. * @return {LatLng} */ - static computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.computeOffsetOrigin(to, distance, heading); + static computeOffsetOrigin( + to: ILatLng, + distance: number, + heading: number + ): LatLng { + return GoogleMaps.getPlugin().geometry.spherical.computeOffsetOrigin( + to, + distance, + heading + ); } /** @@ -1976,7 +2144,9 @@ export class Spherical { * @param path {Array | BaseArrayClass}. * @return {number} */ - static computeSignedArea(path: Array | BaseArrayClass): number { + static computeSignedArea( + path: Array | BaseArrayClass + ): number { return GoogleMaps.getPlugin().geometry.spherical.computeSignedArea(path); } @@ -1998,7 +2168,11 @@ export class Spherical { * @return {LatLng} */ static interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.interpolate(from, to, fraction); + return GoogleMaps.getPlugin().geometry.spherical.interpolate( + from, + to, + fraction + ); } } @@ -2012,17 +2186,30 @@ export class Spherical { export class GoogleMap extends BaseClass { constructor(element: string | HTMLElement, options?: GoogleMapOptions) { super(); - if (checkAvailability(GoogleMaps.getPluginRef(), null, GoogleMaps.getPluginName()) === true) { + if ( + checkAvailability( + GoogleMaps.getPluginRef(), + null, + GoogleMaps.getPluginName() + ) === true + ) { if (element instanceof HTMLElement) { - this._objectInstance = GoogleMaps.getPlugin().Map.getMap(element, options); + this._objectInstance = GoogleMaps.getPlugin().Map.getMap( + element, + options + ); } else if (typeof element === 'string') { - let dummyObj: any = new (GoogleMaps.getPlugin().BaseClass)(); + let dummyObj: any = new (GoogleMaps.getPlugin()).BaseClass(); this._objectInstance = dummyObj; let onListeners: any[] = []; let oneListeners: any[] = []; let _origAddEventListener: any = this._objectInstance.addEventListener; - let _origAddEventListenerOnce: any = this._objectInstance.addEventListenerOnce; - this._objectInstance.addEventListener = (eventName: string, fn: () => void) => { + let _origAddEventListenerOnce: any = this._objectInstance + .addEventListenerOnce; + this._objectInstance.addEventListener = ( + eventName: string, + fn: () => void + ) => { if (eventName === GoogleMapsEvent.MAP_READY) { _origAddEventListener.call(dummyObj, eventName, fn); } else { @@ -2031,7 +2218,10 @@ export class GoogleMap extends BaseClass { }; this._objectInstance.on = this._objectInstance.addEventListener; - this._objectInstance.addEventListenerOnce = (eventName: string, fn: () => void) => { + this._objectInstance.addEventListenerOnce = ( + eventName: string, + fn: () => void + ) => { if (eventName === GoogleMapsEvent.MAP_READY) { _origAddEventListenerOnce.call(dummyObj, eventName, fn); } else { @@ -2039,7 +2229,7 @@ export class GoogleMap extends BaseClass { } }; this._objectInstance.one = this._objectInstance.addEventListenerOnce; - (new Promise((resolve, reject) => { + new Promise((resolve, reject) => { let count: number = 0; let timer: any = setInterval(() => { let target = document.querySelector('.show-page #' + element); @@ -2056,23 +2246,26 @@ export class GoogleMap extends BaseClass { reject(); } }, 100); - })) - .then((target: any) => { - this._objectInstance = GoogleMaps.getPlugin().Map.getMap(target, options); - this._objectInstance.one(GoogleMapsEvent.MAP_READY, () => { - this.set('_overlays', {}); - onListeners.forEach((args) => { - this.on.apply(this, args); - }); - oneListeners.forEach((args) => { - this.one.apply(this, args); - }); - dummyObj.trigger(GoogleMapsEvent.MAP_READY); - }); }) - .catch(() => { - this._objectInstance = null; - }); + .then((target: any) => { + this._objectInstance = GoogleMaps.getPlugin().Map.getMap( + target, + options + ); + this._objectInstance.one(GoogleMapsEvent.MAP_READY, () => { + this.set('_overlays', {}); + onListeners.forEach(args => { + this.on.apply(this, args); + }); + oneListeners.forEach(args => { + this.one.apply(this, args); + }); + dummyObj.trigger(GoogleMapsEvent.MAP_READY); + }); + }) + .catch(() => { + this._objectInstance = null; + }); } else if (element === null && options) { this._objectInstance = GoogleMaps.getPlugin().Map.getMap(null, options); } @@ -2086,7 +2279,9 @@ export class GoogleMap extends BaseClass { @InstanceCheck() setDiv(domNode?: HTMLElement | string): void { if (typeof domNode === 'string') { - this._objectInstance.setDiv(document.querySelector('.show-page #' + domNode)); + this._objectInstance.setDiv( + document.querySelector('.show-page #' + domNode) + ); } else { this._objectInstance.setDiv(domNode); } @@ -2097,98 +2292,122 @@ export class GoogleMap extends BaseClass { * @return {HTMLElement} */ @CordovaInstance({ sync: true }) - getDiv(): HTMLElement { return; } + getDiv(): HTMLElement { + return; + } /** * Changes the map type id * @param mapTypeId {string} */ @CordovaInstance({ sync: true }) - setMapTypeId(mapTypeId: MapType): void { } + setMapTypeId(mapTypeId: MapType): void {} /** * Moves the camera with animation * @return {Promise} */ @CordovaInstance() - animateCamera(cameraPosition: CameraPosition): Promise { return; } + animateCamera(cameraPosition: CameraPosition): Promise { + return; + } /** * Zooming in the camera with animation * @return {Promise} */ @CordovaInstance() - animateCameraZoomIn(): Promise { return; } + animateCameraZoomIn(): Promise { + return; + } /** * Zooming out the camera with animation * @return {Promise} */ @CordovaInstance() - animateCameraZoomOut(): Promise { return; } + animateCameraZoomOut(): Promise { + return; + } /** * Moves the camera without animation * @return {Promise} */ @CordovaInstance() - moveCamera(cameraPosition: CameraPosition): Promise { return; } + moveCamera(cameraPosition: CameraPosition): Promise { + return; + } /** * Zooming in the camera without animation * @return {Promise} */ @CordovaInstance() - moveCameraZoomIn(): Promise { return; } + moveCameraZoomIn(): Promise { + return; + } /** * Zooming out the camera without animation * @return {Promise} */ @CordovaInstance() - moveCameraZoomOut(): Promise { return; } + moveCameraZoomOut(): Promise { + return; + } /** * Get the position of the camera. * @return {CameraPosition} */ @CordovaInstance({ sync: true }) - getCameraPosition(): CameraPosition { return; } + getCameraPosition(): CameraPosition { + return; + } /** * Get the current camera target position * @return {Promise} */ @CordovaInstance({ sync: true }) - getCameraTarget(): ILatLng { return; } + getCameraTarget(): ILatLng { + return; + } /** * Get the current camera zoom level * @return {number} */ @CordovaInstance({ sync: true }) - getCameraZoom(): number { return; } + getCameraZoom(): number { + return; + } /** * Get the current camera bearing * @return {number} */ @CordovaInstance({ sync: true }) - getCameraBearing(): number { return; } + getCameraBearing(): number { + return; + } /** * Get the current camera tilt (view angle) * @return {number} */ @CordovaInstance({ sync: true }) - getCameraTilt(): number { return; } + getCameraTilt(): number { + return; + } /** * Set the center position of the camera view * @param latLng {ILatLng | Array} */ @CordovaInstance({ sync: true }) - setCameraTarget(latLng: ILatLng | Array): void { } + setCameraTarget(latLng: ILatLng | Array): void {} /** * Set zoom level of the camera @@ -2217,21 +2436,25 @@ export class GoogleMap extends BaseClass { * @param y {any} */ @CordovaInstance({ sync: true }) - panBy(x: string | number, y: string | number): void { } + panBy(x: string | number, y: string | number): void {} /** * Get the current visible region (southWest and northEast) * @return {VisibleRegion} */ @CordovaInstance({ sync: true }) - getVisibleRegion(): VisibleRegion { return; } + getVisibleRegion(): VisibleRegion { + return; + } /** * Get the current device location * @return {Promise} */ @CordovaInstance() - getMyLocation(options?: MyLocationOptions): Promise { return; } + getMyLocation(options?: MyLocationOptions): Promise { + return; + } /** * Set false to ignore all clicks on the map @@ -2252,7 +2475,7 @@ export class GoogleMap extends BaseClass { delete this.get('_overlays')[overlayId]; }); } - return new Promise((resolve) => { + return new Promise(resolve => { this._objectInstance.remove(() => resolve()); }); } @@ -2269,7 +2492,7 @@ export class GoogleMap extends BaseClass { delete this.get('_overlays')[overlayId]; }); } - return new Promise((resolve) => { + return new Promise(resolve => { this._objectInstance.clear(() => resolve()); }); } @@ -2279,14 +2502,18 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - fromLatLngToPoint(latLng: ILatLng): Promise { return; } + fromLatLngToPoint(latLng: ILatLng): Promise { + return; + } /** * Convert the unit from the pixels from the left/top to the LatLng * @return {Promise} */ @CordovaInstance() - fromPointToLatLng(point: any): Promise { return; } + fromPointToLatLng(point: any): Promise { + return; + } /** * Set true if you want to show the MyLocation control (blue dot) @@ -2307,7 +2534,9 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - getFocusedBuilding(): Promise { return; } + getFocusedBuilding(): Promise { + return; + } /** * Set true if you want to show the indoor map @@ -2352,7 +2581,12 @@ export class GoogleMap extends BaseClass { * @param bottom {number} */ @CordovaInstance({ sync: true }) - setPadding(top?: number, right?: number, bottom?: number, left?: number): void { } + setPadding( + top?: number, + right?: number, + bottom?: number, + left?: number + ): void {} /** * Set options @@ -2394,7 +2628,9 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @InstanceCheck() - addMarkerCluster(options: MarkerClusterOptions): Promise { + addMarkerCluster( + options: MarkerClusterOptions + ): Promise { return new Promise((resolve, reject) => { this._objectInstance.addMarkerCluster(options, (markerCluster: any) => { if (markerCluster) { @@ -2530,7 +2766,9 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @InstanceCheck() - addGroundOverlay(options: GroundOverlayOptions): Promise { + addGroundOverlay( + options: GroundOverlayOptions + ): Promise { return new Promise((resolve, reject) => { this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => { if (groundOverlay) { @@ -2584,15 +2822,15 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - toDataURL(params?: ToDataUrlOptions): Promise { return; } - + toDataURL(params?: ToDataUrlOptions): Promise { + return; + } } /** * @hidden */ export class GroundOverlay extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -2606,13 +2844,17 @@ export class GroundOverlay extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Change the bounds of the GroundOverlay @@ -2626,34 +2868,38 @@ export class GroundOverlay extends BaseClass { * @param bearing {number} */ @CordovaInstance({ sync: true }) - setBearing(bearing: number): void { } + setBearing(bearing: number): void {} /** * Return the current bearing value */ @CordovaInstance({ sync: true }) - getBearing(): number { return; } + getBearing(): number { + return; + } /** * Change the image of the ground overlay * @param image {string} URL of image */ @CordovaInstance({ sync: true }) - setImage(image: string): void {}; + setImage(image: string): void {} /** * Change the opacity of the ground overlay from 0.0 to 1.0 * @param opacity {number} */ @CordovaInstance({ sync: true }) - setOpacity(opacity: number): void { } + setOpacity(opacity: number): void {} /** * Return the current opacity * @return {number} */ @CordovaInstance({ sync: true }) - getOpacity(): number { return; } + getOpacity(): number { + return; + } /** * Change clickablity of the ground overlay @@ -2667,21 +2913,25 @@ export class GroundOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { return; } + getClickable(): boolean { + return; + } /** * Change visibility of the ground overlay * @param visible {boolean} */ @CordovaInstance({ sync: true }) - setVisible(visible: boolean): void { } + setVisible(visible: boolean): void {} /** * Return true if the ground overlay is visible * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } /** * Change the ground overlay zIndex order @@ -2695,7 +2945,9 @@ export class GroundOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Remove the ground overlay @@ -2718,10 +2970,9 @@ export class GroundOverlay extends BaseClass { repo: '' }) export class HtmlInfoWindow extends BaseClass { - constructor() { super(); - this._objectInstance = new (GoogleMaps.getPlugin().HtmlInfoWindow)(); + this._objectInstance = new (GoogleMaps.getPlugin()).HtmlInfoWindow(); } /** @@ -2751,14 +3002,12 @@ export class HtmlInfoWindow extends BaseClass { */ @CordovaInstance() close(): void {} - } /** * @hidden */ export class Marker extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -2772,27 +3021,35 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Set the marker position. * @param latLng {ILatLng} */ @CordovaInstance({ sync: true }) - setPosition(latLng: ILatLng): void { return; } + setPosition(latLng: ILatLng): void { + return; + } /** * Return the marker position. * @return {ILatLng} */ @CordovaInstance({ sync: true }) - getPosition(): ILatLng { return; } + getPosition(): ILatLng { + return; + } /** * Show the normal infoWindow of the marker. @@ -2831,7 +3088,9 @@ export class Marker extends BaseClass { * Return true if the marker is visible */ @CordovaInstance({ sync: true }) - isVisible(): boolean { return; } + isVisible(): boolean { + return; + } /** * Change title of the normal infoWindow. @@ -2845,7 +3104,9 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getTitle(): string { return; } + getTitle(): string { + return; + } /** * Change snippet of the normal infoWindow. @@ -2859,7 +3120,9 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getSnippet(): string { return; } + getSnippet(): string { + return; + } /** * Change the marker opacity from 0.0 to 1.0. @@ -2873,7 +3136,9 @@ export class Marker extends BaseClass { * @return {number} Opacity */ @CordovaInstance({ sync: true }) - getOpacity(): number { return; } + getOpacity(): number { + return; + } /** * Remove the marker. @@ -2906,14 +3171,18 @@ export class Marker extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - isInfoWindowShown(): boolean { return; } + isInfoWindowShown(): boolean { + return; + } /** * Return the marker hash code. * @return {string} Marker hash code */ @CordovaInstance({ sync: true }) - getHashCode(): string { return; } + getHashCode(): string { + return; + } /** * Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays. @@ -2927,57 +3196,65 @@ export class Marker extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Set true if you allow all users to drag the marker. * @param draggable {boolean} */ @CordovaInstance({ sync: true }) - setDraggable(draggable: boolean): void { } + setDraggable(draggable: boolean): void {} /** * Return true if the marker drag is enabled. * @return {boolean} */ @CordovaInstance({ sync: true }) - isDraggable(): boolean { return; } + isDraggable(): boolean { + return; + } /** * Set true if you want to be flat marker. * @param flat {boolean} */ @CordovaInstance({ sync: true }) - setFlat(flat: boolean): void { return; } + setFlat(flat: boolean): void { + return; + } /** * Change icon url and/or size * @param icon */ @CordovaInstance({ sync: true }) - setIcon(icon: MarkerIcon): void { return; } + setIcon(icon: MarkerIcon): void { + return; + } /** * Set the marker rotation angle. * @param rotation {number} */ @CordovaInstance({ sync: true }) - setRotation(rotation: number): void { } + setRotation(rotation: number): void {} /** * Return the marker rotation angle. * @return {number} */ @CordovaInstance({ sync: true }) - getRotation(): number { return; } - + getRotation(): number { + return; + } } /** * @hidden */ export class MarkerCluster extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -2991,7 +3268,9 @@ export class MarkerCluster extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Add one marker location @@ -3023,15 +3302,15 @@ export class MarkerCluster extends BaseClass { * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } - + getMap(): GoogleMap { + return this._map; + } } /** * @hidden */ export class Polygon extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3045,13 +3324,17 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Change the polygon points. @@ -3090,7 +3373,7 @@ export class Polygon extends BaseClass { results.push(hole); }); return results; - } + } /** * Change the filling color (inner color) @@ -3104,7 +3387,9 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getFillColor(): string { return; } + getFillColor(): string { + return; + } /** * Change the stroke color (outer color) @@ -3118,7 +3403,9 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { return; } + getStrokeColor(): string { + return; + } /** * Change clickablity of the polygon @@ -3131,7 +3418,9 @@ export class Polygon extends BaseClass { * Return true if the polygon is clickable */ @CordovaInstance({ sync: true }) - getClickable(): boolean { return; } + getClickable(): boolean { + return; + } /** * Change visibility of the polygon @@ -3145,7 +3434,9 @@ export class Polygon extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } /** * Change the polygon zIndex order. @@ -3159,7 +3450,9 @@ export class Polygon extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Remove the polygon. @@ -3181,7 +3474,9 @@ export class Polygon extends BaseClass { * Return the polygon stroke width */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { return; } + getStrokeWidth(): number { + return; + } /** * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. @@ -3195,15 +3490,15 @@ export class Polygon extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getGeodesic(): boolean { return; } - + getGeodesic(): boolean { + return; + } } /** * @hidden */ export class Polyline extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3217,13 +3512,17 @@ export class Polyline extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Change the polyline points. @@ -3253,7 +3552,9 @@ export class Polyline extends BaseClass { * Return true if the polyline is geodesic */ @CordovaInstance({ sync: true }) - getGeodesic(): boolean { return; } + getGeodesic(): boolean { + return; + } /** * Change visibility of the polyline @@ -3267,7 +3568,9 @@ export class Polyline extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } /** * Change clickablity of the polyline @@ -3281,7 +3584,9 @@ export class Polyline extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { return; } + getClickable(): boolean { + return; + } /** * Change the polyline color @@ -3295,7 +3600,9 @@ export class Polyline extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { return; } + getStrokeColor(): string { + return; + } /** * Change the polyline stroke width @@ -3309,7 +3616,9 @@ export class Polyline extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { return; } + getStrokeWidth(): number { + return; + } /** * Change the polyline zIndex order. @@ -3323,7 +3632,9 @@ export class Polyline extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Remove the polyline @@ -3340,7 +3651,6 @@ export class Polyline extends BaseClass { * @hidden */ export class TileOverlay extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3354,13 +3664,17 @@ export class TileOverlay extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Set whether the tiles should fade in. @@ -3374,7 +3688,9 @@ export class TileOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getFadeIn(): boolean { return; } + getFadeIn(): boolean { + return; + } /** * Set the zIndex of the tile overlay @@ -3388,7 +3704,9 @@ export class TileOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { return; } + getZIndex(): number { + return; + } /** * Set the opacity of the tile overlay @@ -3402,7 +3720,9 @@ export class TileOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getOpacity(): number { return; } + getOpacity(): number { + return; + } /** * Set false if you want to hide @@ -3416,13 +3736,17 @@ export class TileOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } /** * Get tile size */ @CordovaInstance({ sync: true }) - getTileSize(): any { return; } + getTileSize(): any { + return; + } /** * Remove the tile overlay @@ -3439,7 +3763,6 @@ export class TileOverlay extends BaseClass { * @hidden */ export class KmlOverlay extends BaseClass { - private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3448,12 +3771,12 @@ export class KmlOverlay extends BaseClass { this._objectInstance = _objectInstance; Object.defineProperty(self, 'camera', { - value: this._objectInstance.camera, - writable: false + value: this._objectInstance.camera, + writable: false }); Object.defineProperty(self, 'kmlData', { - value: this._objectInstance.kmlData, - writable: false + value: this._objectInstance.kmlData, + writable: false }); } @@ -3461,20 +3784,26 @@ export class KmlOverlay extends BaseClass { * Returns the viewport to contains all overlays */ @CordovaInstance({ sync: true }) - getDefaultViewport(): CameraPosition { return; } + getDefaultViewport(): CameraPosition { + return; + } /** * Return the ID of instance. * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { return; } + getId(): string { + return; + } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { return this._map; } + getMap(): GoogleMap { + return this._map; + } /** * Change visibility of the polyline @@ -3488,7 +3817,9 @@ export class KmlOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { return; } + getVisible(): boolean { + return; + } /** * Change clickablity of the KmlOverlay @@ -3502,7 +3833,9 @@ export class KmlOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { return; } + getClickable(): boolean { + return; + } /** * Remove the KmlOverlay From f700bb3817efee02c1fb1d7be105f7e1adaa6847 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Mon, 19 Mar 2018 09:10:25 +0100 Subject: [PATCH 03/13] Revert "fix(google-maps): wrong decorators" This reverts commit e5b9d53b179fedb939911753076e579ab7c12748. --- .../plugins/google-maps/index.ts | 859 ++++++------------ 1 file changed, 263 insertions(+), 596 deletions(-) diff --git a/src/@ionic-native/plugins/google-maps/index.ts b/src/@ionic-native/plugins/google-maps/index.ts index d776ba53..3d875b2b 100644 --- a/src/@ionic-native/plugins/google-maps/index.ts +++ b/src/@ionic-native/plugins/google-maps/index.ts @@ -1,29 +1,16 @@ +import { Injectable } from '@angular/core'; +import { CordovaCheck, CordovaInstance, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/fromEvent'; -import { Injectable } from '@angular/core'; -import { - checkAvailability, - CordovaCheck, - CordovaInstance, - InstanceCheck, - InstanceProperty, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; -import { Observable } from 'rxjs/Observable'; -export type MapType = - | 'MAP_TYPE_NORMAL' - | 'MAP_TYPE_ROADMAP' - | 'MAP_TYPE_SATELLITE' - | 'MAP_TYPE_HYBRID' - | 'MAP_TYPE_TERRAIN' - | 'MAP_TYPE_NONE'; +export type MapType = 'MAP_TYPE_NORMAL' | 'MAP_TYPE_ROADMAP' | 'MAP_TYPE_SATELLITE' | 'MAP_TYPE_HYBRID' | 'MAP_TYPE_TERRAIN' | 'MAP_TYPE_NONE'; /** * @hidden */ export class LatLng implements ILatLng { + lat: number; lng: number; @@ -56,11 +43,12 @@ export interface ILatLngBounds { * @hidden */ export class LatLngBounds implements ILatLngBounds { + private _objectInstance: any; - @InstanceProperty() northeast: ILatLng; - @InstanceProperty() southwest: ILatLng; - @InstanceProperty() type: string; + @InstanceProperty northeast: ILatLng; + @InstanceProperty southwest: ILatLng; + @InstanceProperty type: string; constructor(points?: ILatLng[]) { this._objectInstance = new (GoogleMaps.getPlugin()).LatLngBounds(points); @@ -71,9 +59,7 @@ export class LatLngBounds implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toString(): string { - return; - } + toString(): string { return; } /** * Returns a string of the form "lat_sw,lng_sw,lat_ne,lng_ne" for this bounds, where "sw" corresponds to the southwest corner of the bounding box, while "ne" corresponds to the northeast corner of that box. @@ -81,9 +67,7 @@ export class LatLngBounds implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toUrlValue(precision?: number): string { - return; - } + toUrlValue(precision?: number): string { return; } /** * Extends this bounds to contain the given point. @@ -97,21 +81,18 @@ export class LatLngBounds implements ILatLngBounds { * @param LatLng {ILatLng} */ @CordovaInstance({ sync: true }) - contains(LatLng: ILatLng): boolean { - return; - } + contains(LatLng: ILatLng): boolean { return; } /** * Computes the center of this LatLngBounds * @return {LatLng} */ @CordovaInstance({ sync: true }) - getCenter(): LatLng { - return; - } + getCenter(): LatLng { return; } } export interface GoogleMapControlOptions { + /** * Turns the compass on or off. */ @@ -151,6 +132,7 @@ export interface GoogleMapControlOptions { } export interface GoogleMapGestureOptions { + /** * Set false to disable the scroll gesture (default: true) */ @@ -190,6 +172,7 @@ export interface GoogleMapPaddingOptions { } export interface GoogleMapPreferenceOptions { + /** * Minimum and maximum zoom levels for zooming gestures. */ @@ -212,6 +195,7 @@ export interface GoogleMapPreferenceOptions { } export interface GoogleMapOptions { + /** * mapType [options] */ @@ -344,6 +328,7 @@ export interface CircleOptions { } export interface GeocoderRequest { + /** * The address property or position property is required. * You can not specify both property at the same time. @@ -390,7 +375,7 @@ export interface GeocoderResult { lines?: Array; permises?: string; phone?: string; - url?: string; + url?: string }; locale?: string; locality?: string; @@ -747,6 +732,7 @@ export interface ToDataUrlOptions { uncompress?: boolean; } + /** * Options for map.addKmlOverlay() method */ @@ -772,6 +758,7 @@ export interface KmlOverlayOptions { [key: string]: any; } + /** * @hidden */ @@ -782,55 +769,41 @@ export class VisibleRegion implements ILatLngBounds { * The northeast of the bounds that contains the farLeft, farRight, nearLeft and nearRight. * Since the map view is able to rotate, the farRight is not the same as the northeast. */ - @InstanceProperty() northeast: ILatLng; + @InstanceProperty northeast: ILatLng; /** * The southwest of the bounds that contains the farLeft, farRight, nearLeft and nearRight. * Since the map view is able to rotate, the nearLeft is not the same as the southwest. */ - @InstanceProperty() southwest: ILatLng; + @InstanceProperty southwest: ILatLng; /** * The nearRight indicates the lat/lng of the top-left of the map view. */ - @InstanceProperty() farLeft: ILatLng; + @InstanceProperty farLeft: ILatLng; /** * The nearRight indicates the lat/lng of the top-right of the map view. */ - @InstanceProperty() farRight: ILatLng; + @InstanceProperty farRight: ILatLng; /** * The nearRight indicates the lat/lng of the bottom-left of the map view. */ - @InstanceProperty() nearLeft: ILatLng; + @InstanceProperty nearLeft: ILatLng; /** * The nearRight indicates the lat/lng of the bottom-right of the map view. */ - @InstanceProperty() nearRight: ILatLng; + @InstanceProperty nearRight: ILatLng; /** * constant value : `VisibleRegion` */ - @InstanceProperty() type: string; + @InstanceProperty type: string; - constructor( - southwest: LatLngBounds, - northeast: LatLngBounds, - farLeft: ILatLng, - farRight: ILatLng, - nearLeft: ILatLng, - nearRight: ILatLng - ) { - this._objectInstance = new (GoogleMaps.getPlugin()).VisibleRegion( - southwest, - northeast, - farLeft, - farRight, - nearLeft, - nearRight - ); + constructor(southwest: LatLngBounds, northeast: LatLngBounds, farLeft: ILatLng, farRight: ILatLng, nearLeft: ILatLng, nearRight: ILatLng) { + this._objectInstance = new (GoogleMaps.getPlugin()).VisibleRegion(southwest, northeast, farLeft, farRight, nearLeft, nearRight); } /** @@ -838,9 +811,7 @@ export class VisibleRegion implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toString(): string { - return; - } + toString(): string { return; } /** * Returns a string of the form "lat_sw,lng_sw,lat_ne,lng_ne" for this bounds, where "sw" corresponds to the southwest corner of the bounding box, while "ne" corresponds to the northeast corner of that box. @@ -848,18 +819,16 @@ export class VisibleRegion implements ILatLngBounds { * @return {string} */ @CordovaInstance({ sync: true }) - toUrlValue(precision?: number): string { - return; - } + toUrlValue(precision?: number): string { return; } + /** * Returns true if the given lat/lng is in this bounds. * @param LatLng {ILatLng} */ @CordovaInstance({ sync: true }) - contains(LatLng: ILatLng): boolean { - return; - } + contains(LatLng: ILatLng): boolean { return; } + } /** @@ -900,7 +869,7 @@ export const GoogleMapsEvent = { /** * @hidden */ -export const GoogleMapsAnimation: { [animationName: string]: string } = { +export const GoogleMapsAnimation: { [animationName: string]: string; } = { BOUNCE: 'BOUNCE', DROP: 'DROP' }; @@ -908,7 +877,7 @@ export const GoogleMapsAnimation: { [animationName: string]: string } = { /** * @hidden */ -export const GoogleMapsMapTypeId: { [mapType: string]: MapType } = { +export const GoogleMapsMapTypeId: { [mapType: string]: MapType; } = { NORMAL: 'MAP_TYPE_NORMAL', ROADMAP: 'MAP_TYPE_ROADMAP', SATELLITE: 'MAP_TYPE_SATELLITE', @@ -1035,32 +1004,24 @@ export const GoogleMapsMapTypeId: { [mapType: string]: MapType } = { pluginRef: 'plugin.google.maps', plugin: 'cordova-plugin-googlemaps', repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps', - document: - 'https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md', - install: - 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"', + document: 'https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md', + install: 'ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"', installVariables: ['API_KEY_FOR_ANDROID', 'API_KEY_FOR_IOS'], platforms: ['Android', 'iOS'] }) @Injectable() export class GoogleMaps extends IonicNativePlugin { + /** * Creates a new GoogleMap instance * @param element {string | HTMLElement} Element ID or reference to attach the map to * @param options {GoogleMapOptions} [options] Options * @return {GoogleMap} */ - static create( - element: string | HTMLElement | GoogleMapOptions, - options?: GoogleMapOptions - ): GoogleMap { + static create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap { if (element instanceof HTMLElement) { if (element.getAttribute('__pluginMapId')) { - console.error( - `GoogleMaps ${element.tagName}[__pluginMapId='${element.getAttribute( - '__pluginMapId' - )}'] has already map.` - ); + console.error('GoogleMaps', element.tagName + '[__pluginMapId=\'' + element.getAttribute('__pluginMapId') + '\'] has already map.'); return; } } else if (typeof element === 'object') { @@ -1076,13 +1037,11 @@ export class GoogleMaps extends IonicNativePlugin { * @deprecation * @hidden */ - create( - element: string | HTMLElement | GoogleMapOptions, - options?: GoogleMapOptions - ): GoogleMap { + create(element: string | HTMLElement | GoogleMapOptions, options?: GoogleMapOptions): GoogleMap { console.error('GoogleMaps', '[deprecated] Please use GoogleMaps.create()'); return GoogleMaps.create(element, options); } + } /** @@ -1105,7 +1064,7 @@ export class BaseClass { */ @InstanceCheck({ observable: true }) addEventListener(eventName: string): Observable { - return new Observable(observer => { + return new Observable((observer) => { this._objectInstance.on(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1124,9 +1083,7 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance - .getMap() - .get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; } } observer.next(args); @@ -1141,7 +1098,7 @@ export class BaseClass { */ @InstanceCheck() addListenerOnce(eventName: string): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { this._objectInstance.one(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1160,9 +1117,7 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance - .getMap() - .get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; } } resolve(args); @@ -1175,9 +1130,7 @@ export class BaseClass { * @param key {any} */ @CordovaInstance({ sync: true }) - get(key: string): any { - return; - } + get(key: string): any { return; } /** * Sets a value @@ -1186,7 +1139,7 @@ export class BaseClass { * @param noNotify {boolean} [options] True if you want to prevent firing the `(key)_changed` event. */ @CordovaInstance({ sync: true }) - set(key: string, value: any, noNotify?: boolean): void {} + set(key: string, value: any, noNotify?: boolean): void { } /** * Bind a key to another object @@ -1196,12 +1149,7 @@ export class BaseClass { * @param noNotify? {boolean} [options] True if you want to prevent `(key)_changed` event when you bind first time, because the internal status is changed from `undefined` to something. */ @CordovaInstance({ sync: true }) - bindTo( - key: string, - target: any, - targetKey?: string, - noNotify?: boolean - ): void {} + bindTo(key: string, target: any, targetKey?: string, noNotify?: boolean): void { } /** * Alias of `addEventListener` @@ -1210,7 +1158,7 @@ export class BaseClass { */ @InstanceCheck({ observable: true }) on(eventName: string): Observable { - return new Observable(observer => { + return new Observable((observer) => { this._objectInstance.on(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1229,9 +1177,7 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance - .getMap() - .get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; } } observer.next(args); @@ -1246,7 +1192,7 @@ export class BaseClass { */ @InstanceCheck() one(eventName: string): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { this._objectInstance.one(eventName, (...args: any[]) => { if (args[args.length - 1] instanceof GoogleMaps.getPlugin().BaseClass) { if (args[args.length - 1].type === 'Map') { @@ -1265,9 +1211,7 @@ export class BaseClass { } args[args.length - 1] = overlay; } else { - args[args.length - 1] = this._objectInstance - .getMap() - .get('_overlays')[args[args.length - 1].getId()]; + args[args.length - 1] = this._objectInstance.getMap().get('_overlays')[args[args.length - 1].getId()]; } } resolve(args); @@ -1279,7 +1223,7 @@ export class BaseClass { * Clears all stored values */ @CordovaInstance({ sync: true }) - empty(): void {} + empty(): void { } /** * Dispatch event. @@ -1289,6 +1233,7 @@ export class BaseClass { @CordovaInstance({ sync: true }) trigger(eventName: string, ...parameters: any[]): void {} + /** * Executes off() and empty() */ @@ -1296,9 +1241,7 @@ export class BaseClass { destroy(): void { let map: GoogleMap = this._objectInstance.getMap(); if (map) { - delete this._objectInstance.getMap().get('_overlays')[ - this._objectInstance.getId() - ]; + delete this._objectInstance.getMap().get('_overlays')[this._objectInstance.getId()]; } this._objectInstance.remove(); } @@ -1317,10 +1260,7 @@ export class BaseClass { * @param listener {Function} [options] Event listener */ @CordovaInstance({ sync: true }) - removeEventListener( - eventName?: string, - listener?: (...parameters: any[]) => void - ): void {} + removeEventListener(eventName?: string, listener?: (...parameters: any[]) => void): void {} /** * Alias of `removeEventListener` @@ -1330,6 +1270,7 @@ export class BaseClass { */ @CordovaInstance({ sync: true }) off(eventName?: string, listener?: (...parameters: any[]) => void): void {} + } /** @@ -1343,14 +1284,13 @@ export class BaseClass { repo: '' }) export class BaseArrayClass extends BaseClass { + constructor(initialData?: T[] | any) { super(); if (initialData instanceof GoogleMaps.getPlugin().BaseArrayClass) { this._objectInstance = initialData; } else { - this._objectInstance = new (GoogleMaps.getPlugin()).BaseArrayClass( - initialData - ); + this._objectInstance = new (GoogleMaps.getPlugin().BaseArrayClass)(initialData); } } @@ -1374,10 +1314,8 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} */ @CordovaCheck() - forEachAsync( - fn: ((element: T, callback: () => void) => void) - ): Promise { - return new Promise(resolve => { + forEachAsync(fn: ((element: T, callback: () => void) => void)): Promise { + return new Promise((resolve) => { this._objectInstance.forEachAsync(fn, resolve); }); } @@ -1389,9 +1327,7 @@ export class BaseArrayClass extends BaseClass { * @return {Array} returns a new array with the results */ @CordovaInstance({ sync: true }) - map(fn: (element: T, index: number) => any): any[] { - return; - } + map(fn: (element: T, index: number) => any): any[] { return; } /** * Iterate over each element, calling the provided callback. @@ -1401,10 +1337,8 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new array with the results */ @CordovaCheck() - mapAsync( - fn: ((element: T, callback: (newElement: any) => void) => void) - ): Promise { - return new Promise(resolve => { + mapAsync(fn: ((element: T, callback: (newElement: any) => void) => void)): Promise { + return new Promise((resolve) => { this._objectInstance.mapAsync(fn, resolve); }); } @@ -1416,10 +1350,8 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new array with the results */ @CordovaCheck() - mapSeries( - fn: ((element: T, callback: (newElement: any) => void) => void) - ): Promise { - return new Promise(resolve => { + mapSeries(fn: ((element: T, callback: (newElement: any) => void) => void)): Promise { + return new Promise((resolve) => { this._objectInstance.mapSeries(fn, resolve); }); } @@ -1430,9 +1362,7 @@ export class BaseArrayClass extends BaseClass { * @return {Array} returns a new filtered array */ @CordovaInstance({ sync: true }) - filter(fn: (element: T, index: number) => boolean): T[] { - return; - } + filter(fn: (element: T, index: number) => boolean): T[] { return; } /** * The filterAsync() method creates a new array with all elements that pass the test implemented by the provided function. @@ -1441,10 +1371,8 @@ export class BaseArrayClass extends BaseClass { * @return {Promise} returns a new filtered array */ @CordovaCheck() - filterAsync( - fn: (element: T, callback: (result: boolean) => void) => void - ): Promise { - return new Promise(resolve => { + filterAsync(fn: (element: T, callback: (result: boolean) => void) => void): Promise { + return new Promise((resolve) => { this._objectInstance.filterAsync(fn, resolve); }); } @@ -1454,9 +1382,7 @@ export class BaseArrayClass extends BaseClass { * @return {Array} */ @CordovaInstance({ sync: true }) - getArray(): T[] { - return; - } + getArray(): T[] { return; } /** * Returns the element at the specified index. @@ -1471,9 +1397,7 @@ export class BaseArrayClass extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getLength(): number { - return; - } + getLength(): number { return; } /** * The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present. @@ -1481,9 +1405,7 @@ export class BaseArrayClass extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - indexOf(element: T): number { - return; - } + indexOf(element: T): number { return; } /** * The reverse() method reverses an array in place. @@ -1513,9 +1435,7 @@ export class BaseArrayClass extends BaseClass { * @return {Object} */ @CordovaInstance({ sync: true }) - pop(noNotify?: boolean): T { - return; - } + pop(noNotify?: boolean): T { return; } /** * Adds one element to the end of the array and returns the new length of the array. @@ -1548,6 +1468,7 @@ export class BaseArrayClass extends BaseClass { * https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/class/Circle/README.md */ export class Circle extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -1561,17 +1482,13 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Change the center position. @@ -1585,18 +1502,14 @@ export class Circle extends BaseClass { * @return {ILatLng} */ @CordovaInstance({ sync: true }) - getCenter(): ILatLng { - return; - } + getCenter(): ILatLng { return; } /** * Return the current circle radius. * @return {number} */ @CordovaInstance({ sync: true }) - getRadius(): number { - return; - } + getRadius(): number { return; } /** * Change the circle radius. @@ -1617,9 +1530,7 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getFillColor(): string { - return; - } + getFillColor(): string { return; } /** * Change the stroke width. @@ -1633,9 +1544,7 @@ export class Circle extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { - return; - } + getStrokeWidth(): number { return; } /** * Change the stroke color (outter color). @@ -1649,9 +1558,7 @@ export class Circle extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { - return; - } + getStrokeColor(): string { return; } /** * Change clickablity of the circle. @@ -1665,9 +1572,7 @@ export class Circle extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { - return; - } + getClickable(): boolean { return; } /** * Change the circle zIndex order. @@ -1681,9 +1586,7 @@ export class Circle extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Remove the circle. @@ -1696,9 +1599,7 @@ export class Circle extends BaseClass { * @return {LatLngBounds} */ @CordovaInstance({ sync: true }) - getBounds(): LatLngBounds { - return; - } + getBounds(): LatLngBounds { return; } /** * Set circle visibility @@ -1712,9 +1613,7 @@ export class Circle extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } } /** @@ -1727,15 +1626,14 @@ export class Circle extends BaseClass { repo: '' }) export class Environment { + /** * Get the open source software license information for Google Maps SDK for iOS. * @return {Promise} */ static getLicenseInfo(): Promise { - return new Promise(resolve => { - GoogleMaps.getPlugin().environment.getLicenseInfo((text: string) => - resolve(text) - ); + return new Promise((resolve) => { + GoogleMaps.getPlugin().environment.getLicenseInfo((text: string) => resolve(text)); }); } @@ -1744,10 +1642,7 @@ export class Environment { * @hidden */ getLicenseInfo(): Promise { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Environment.getLicenseInfo()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.getLicenseInfo()'); return Environment.getLicenseInfo(); } @@ -1764,10 +1659,7 @@ export class Environment { * @hidden */ setBackgroundColor(color: string): void { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Environment.setBackgroundColor()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Environment.setBackgroundColor()'); Environment.setBackgroundColor(color); } } @@ -1782,17 +1674,13 @@ export class Environment { repo: '' }) export class Geocoder { + /** * @deprecation * @hidden */ - geocode( - request: GeocoderRequest - ): Promise> { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Geocoder.geocode()' - ); + geocode(request: GeocoderRequest): Promise> { + console.error('GoogleMaps', '[deprecated] This method is static. Please use Geocoder.geocode()'); return Geocoder.geocode(request); } @@ -1801,15 +1689,10 @@ export class Geocoder { * @param {GeocoderRequest} request Request object with either an address or a position * @return {Promise>} */ - static geocode( - request: GeocoderRequest - ): Promise> { - if ( - request.address instanceof Array || - Array.isArray(request.address) || - request.position instanceof Array || - Array.isArray(request.position) - ) { + static geocode(request: GeocoderRequest): Promise> { + + if (request.address instanceof Array || Array.isArray(request.address) || + request.position instanceof Array || Array.isArray(request.position)) { // ------------------------- // Geocoder.geocode({ // address: [ @@ -1834,16 +1717,13 @@ export class Geocoder { // }) // ------------------------- return new Promise((resolve, reject) => { - GoogleMaps.getPlugin().Geocoder.geocode( - request, - (results: GeocoderResult[]) => { - if (results) { - resolve(results); - } else { - reject(); - } + GoogleMaps.getPlugin().Geocoder.geocode(request, (results: GeocoderResult[]) => { + if (results) { + resolve(results); + } else { + reject(); } - ); + }); }); } } @@ -1859,6 +1739,7 @@ export class Geocoder { repo: '' }) export class LocationService { + /** * Get the current device location without map * @return {Promise} @@ -1880,15 +1761,13 @@ export class LocationService { repo: '' }) export class Encoding { + /** * @deprecation * @hidden */ decodePath(encoded: string, precision?: number): Array { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Encoding.decodePath()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.decodePath()'); return Encoding.decodePath(encoded, precision); } @@ -1897,10 +1776,7 @@ export class Encoding { * @hidden */ encodePath(path: Array | BaseArrayClass): string { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Encoding.encodePath()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Encoding.encodePath()'); return Encoding.encodePath(path); } @@ -1911,10 +1787,7 @@ export class Encoding { * @return {ILatLng[]} */ static decodePath(encoded: string, precision?: number): Array { - return GoogleMaps.getPlugin().geometry.encoding.decodePath( - encoded, - precision - ); + return GoogleMaps.getPlugin().geometry.encoding.decodePath(encoded, precision); } /** @@ -1937,6 +1810,7 @@ export class Encoding { repo: '' }) export class Poly { + /** * Returns true if the speicified location is in the polygon path * @param location {ILatLng} @@ -1944,10 +1818,7 @@ export class Poly { * @return {boolean} */ static containsLocation(location: ILatLng, path: ILatLng[]): boolean { - return GoogleMaps.getPlugin().geometry.poly.containsLocation( - location, - path - ); + return GoogleMaps.getPlugin().geometry.poly.containsLocation(location, path); } /** @@ -1957,10 +1828,7 @@ export class Poly { * @return {boolean} */ static isLocationOnEdge(location: ILatLng, path: ILatLng[]): boolean { - return GoogleMaps.getPlugin().geometry.poly.isLocationOnEdge( - location, - path - ); + return GoogleMaps.getPlugin().geometry.poly.isLocationOnEdge(location, path); } } @@ -1974,15 +1842,13 @@ export class Poly { repo: '' }) export class Spherical { + /** * @deprecation * @hidden */ computeDistanceBetween(from: ILatLng, to: ILatLng): number { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeDistanceBetween()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeDistanceBetween()'); return Spherical.computeDistanceBetween(from, to); } @@ -1991,10 +1857,7 @@ export class Spherical { * @hidden */ computeOffset(from: ILatLng, distance: number, heading: number): LatLng { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeOffset()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffset()'); return Spherical.computeOffset(from, distance, heading); } @@ -2003,10 +1866,7 @@ export class Spherical { * @hidden */ computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeOffsetOrigin()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeOffsetOrigin()'); return Spherical.computeOffsetOrigin(to, distance, heading); } @@ -2015,10 +1875,7 @@ export class Spherical { * @hidden */ computeLength(path: Array | BaseArrayClass): number { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeLength()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeLength()'); return Spherical.computeLength(path); } @@ -2027,10 +1884,7 @@ export class Spherical { * @hidden */ computeArea(path: Array | BaseArrayClass): number { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeArea()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeArea()'); return Spherical.computeArea(path); } @@ -2039,10 +1893,7 @@ export class Spherical { * @hidden */ computeSignedArea(path: Array | BaseArrayClass): number { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeSignedArea()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeSignedArea()'); return Spherical.computeSignedArea(path); } @@ -2051,10 +1902,7 @@ export class Spherical { * @hidden */ computeHeading(from: ILatLng, to: ILatLng): number { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.computeHeading()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.computeHeading()'); return Spherical.computeHeading(from, to); } @@ -2063,13 +1911,16 @@ export class Spherical { * @hidden */ interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng { - console.error( - 'GoogleMaps', - '[deprecated] This method is static. Please use Spherical.interpolate()' - ); + console.error('GoogleMaps', '[deprecated] This method is static. Please use Spherical.interpolate()'); return Spherical.interpolate(from, to, fraction); } + + + + + + /** * Returns the distance, in meters, between two LatLngs. * @param locationA {ILatLng} @@ -2077,10 +1928,7 @@ export class Spherical { * @return {number} */ static computeDistanceBetween(from: ILatLng, to: ILatLng): number { - return GoogleMaps.getPlugin().geometry.spherical.computeDistanceBetween( - from, - to - ); + return GoogleMaps.getPlugin().geometry.spherical.computeDistanceBetween(from, to); } /** @@ -2090,16 +1938,8 @@ export class Spherical { * @param heading {number} * @return {LatLng} */ - static computeOffset( - from: ILatLng, - distance: number, - heading: number - ): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.computeOffset( - from, - distance, - heading - ); + static computeOffset(from: ILatLng, distance: number, heading: number): LatLng { + return GoogleMaps.getPlugin().geometry.spherical.computeOffset(from, distance, heading); } /** @@ -2109,16 +1949,8 @@ export class Spherical { * @param heading {number} The heading in degrees clockwise from north. * @return {LatLng} */ - static computeOffsetOrigin( - to: ILatLng, - distance: number, - heading: number - ): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.computeOffsetOrigin( - to, - distance, - heading - ); + static computeOffsetOrigin(to: ILatLng, distance: number, heading: number): LatLng { + return GoogleMaps.getPlugin().geometry.spherical.computeOffsetOrigin(to, distance, heading); } /** @@ -2144,9 +1976,7 @@ export class Spherical { * @param path {Array | BaseArrayClass}. * @return {number} */ - static computeSignedArea( - path: Array | BaseArrayClass - ): number { + static computeSignedArea(path: Array | BaseArrayClass): number { return GoogleMaps.getPlugin().geometry.spherical.computeSignedArea(path); } @@ -2168,11 +1998,7 @@ export class Spherical { * @return {LatLng} */ static interpolate(from: ILatLng, to: ILatLng, fraction: number): LatLng { - return GoogleMaps.getPlugin().geometry.spherical.interpolate( - from, - to, - fraction - ); + return GoogleMaps.getPlugin().geometry.spherical.interpolate(from, to, fraction); } } @@ -2186,30 +2012,17 @@ export class Spherical { export class GoogleMap extends BaseClass { constructor(element: string | HTMLElement, options?: GoogleMapOptions) { super(); - if ( - checkAvailability( - GoogleMaps.getPluginRef(), - null, - GoogleMaps.getPluginName() - ) === true - ) { + if (checkAvailability(GoogleMaps.getPluginRef(), null, GoogleMaps.getPluginName()) === true) { if (element instanceof HTMLElement) { - this._objectInstance = GoogleMaps.getPlugin().Map.getMap( - element, - options - ); + this._objectInstance = GoogleMaps.getPlugin().Map.getMap(element, options); } else if (typeof element === 'string') { - let dummyObj: any = new (GoogleMaps.getPlugin()).BaseClass(); + let dummyObj: any = new (GoogleMaps.getPlugin().BaseClass)(); this._objectInstance = dummyObj; let onListeners: any[] = []; let oneListeners: any[] = []; let _origAddEventListener: any = this._objectInstance.addEventListener; - let _origAddEventListenerOnce: any = this._objectInstance - .addEventListenerOnce; - this._objectInstance.addEventListener = ( - eventName: string, - fn: () => void - ) => { + let _origAddEventListenerOnce: any = this._objectInstance.addEventListenerOnce; + this._objectInstance.addEventListener = (eventName: string, fn: () => void) => { if (eventName === GoogleMapsEvent.MAP_READY) { _origAddEventListener.call(dummyObj, eventName, fn); } else { @@ -2218,10 +2031,7 @@ export class GoogleMap extends BaseClass { }; this._objectInstance.on = this._objectInstance.addEventListener; - this._objectInstance.addEventListenerOnce = ( - eventName: string, - fn: () => void - ) => { + this._objectInstance.addEventListenerOnce = (eventName: string, fn: () => void) => { if (eventName === GoogleMapsEvent.MAP_READY) { _origAddEventListenerOnce.call(dummyObj, eventName, fn); } else { @@ -2229,7 +2039,7 @@ export class GoogleMap extends BaseClass { } }; this._objectInstance.one = this._objectInstance.addEventListenerOnce; - new Promise((resolve, reject) => { + (new Promise((resolve, reject) => { let count: number = 0; let timer: any = setInterval(() => { let target = document.querySelector('.show-page #' + element); @@ -2246,26 +2056,23 @@ export class GoogleMap extends BaseClass { reject(); } }, 100); - }) - .then((target: any) => { - this._objectInstance = GoogleMaps.getPlugin().Map.getMap( - target, - options - ); - this._objectInstance.one(GoogleMapsEvent.MAP_READY, () => { - this.set('_overlays', {}); - onListeners.forEach(args => { - this.on.apply(this, args); - }); - oneListeners.forEach(args => { - this.one.apply(this, args); - }); - dummyObj.trigger(GoogleMapsEvent.MAP_READY); + })) + .then((target: any) => { + this._objectInstance = GoogleMaps.getPlugin().Map.getMap(target, options); + this._objectInstance.one(GoogleMapsEvent.MAP_READY, () => { + this.set('_overlays', {}); + onListeners.forEach((args) => { + this.on.apply(this, args); }); - }) - .catch(() => { - this._objectInstance = null; + oneListeners.forEach((args) => { + this.one.apply(this, args); + }); + dummyObj.trigger(GoogleMapsEvent.MAP_READY); }); + }) + .catch(() => { + this._objectInstance = null; + }); } else if (element === null && options) { this._objectInstance = GoogleMaps.getPlugin().Map.getMap(null, options); } @@ -2279,9 +2086,7 @@ export class GoogleMap extends BaseClass { @InstanceCheck() setDiv(domNode?: HTMLElement | string): void { if (typeof domNode === 'string') { - this._objectInstance.setDiv( - document.querySelector('.show-page #' + domNode) - ); + this._objectInstance.setDiv(document.querySelector('.show-page #' + domNode)); } else { this._objectInstance.setDiv(domNode); } @@ -2292,122 +2097,98 @@ export class GoogleMap extends BaseClass { * @return {HTMLElement} */ @CordovaInstance({ sync: true }) - getDiv(): HTMLElement { - return; - } + getDiv(): HTMLElement { return; } /** * Changes the map type id * @param mapTypeId {string} */ @CordovaInstance({ sync: true }) - setMapTypeId(mapTypeId: MapType): void {} + setMapTypeId(mapTypeId: MapType): void { } /** * Moves the camera with animation * @return {Promise} */ @CordovaInstance() - animateCamera(cameraPosition: CameraPosition): Promise { - return; - } + animateCamera(cameraPosition: CameraPosition): Promise { return; } /** * Zooming in the camera with animation * @return {Promise} */ @CordovaInstance() - animateCameraZoomIn(): Promise { - return; - } + animateCameraZoomIn(): Promise { return; } /** * Zooming out the camera with animation * @return {Promise} */ @CordovaInstance() - animateCameraZoomOut(): Promise { - return; - } + animateCameraZoomOut(): Promise { return; } /** * Moves the camera without animation * @return {Promise} */ @CordovaInstance() - moveCamera(cameraPosition: CameraPosition): Promise { - return; - } + moveCamera(cameraPosition: CameraPosition): Promise { return; } /** * Zooming in the camera without animation * @return {Promise} */ @CordovaInstance() - moveCameraZoomIn(): Promise { - return; - } + moveCameraZoomIn(): Promise { return; } /** * Zooming out the camera without animation * @return {Promise} */ @CordovaInstance() - moveCameraZoomOut(): Promise { - return; - } + moveCameraZoomOut(): Promise { return; } /** * Get the position of the camera. * @return {CameraPosition} */ @CordovaInstance({ sync: true }) - getCameraPosition(): CameraPosition { - return; - } + getCameraPosition(): CameraPosition { return; } /** * Get the current camera target position * @return {Promise} */ @CordovaInstance({ sync: true }) - getCameraTarget(): ILatLng { - return; - } + getCameraTarget(): ILatLng { return; } /** * Get the current camera zoom level * @return {number} */ @CordovaInstance({ sync: true }) - getCameraZoom(): number { - return; - } + getCameraZoom(): number { return; } /** * Get the current camera bearing * @return {number} */ @CordovaInstance({ sync: true }) - getCameraBearing(): number { - return; - } + getCameraBearing(): number { return; } /** * Get the current camera tilt (view angle) * @return {number} */ @CordovaInstance({ sync: true }) - getCameraTilt(): number { - return; - } + getCameraTilt(): number { return; } /** * Set the center position of the camera view * @param latLng {ILatLng | Array} */ @CordovaInstance({ sync: true }) - setCameraTarget(latLng: ILatLng | Array): void {} + setCameraTarget(latLng: ILatLng | Array): void { } /** * Set zoom level of the camera @@ -2436,25 +2217,21 @@ export class GoogleMap extends BaseClass { * @param y {any} */ @CordovaInstance({ sync: true }) - panBy(x: string | number, y: string | number): void {} + panBy(x: string | number, y: string | number): void { } /** * Get the current visible region (southWest and northEast) * @return {VisibleRegion} */ @CordovaInstance({ sync: true }) - getVisibleRegion(): VisibleRegion { - return; - } + getVisibleRegion(): VisibleRegion { return; } /** * Get the current device location * @return {Promise} */ @CordovaInstance() - getMyLocation(options?: MyLocationOptions): Promise { - return; - } + getMyLocation(options?: MyLocationOptions): Promise { return; } /** * Set false to ignore all clicks on the map @@ -2475,7 +2252,7 @@ export class GoogleMap extends BaseClass { delete this.get('_overlays')[overlayId]; }); } - return new Promise(resolve => { + return new Promise((resolve) => { this._objectInstance.remove(() => resolve()); }); } @@ -2492,7 +2269,7 @@ export class GoogleMap extends BaseClass { delete this.get('_overlays')[overlayId]; }); } - return new Promise(resolve => { + return new Promise((resolve) => { this._objectInstance.clear(() => resolve()); }); } @@ -2502,18 +2279,14 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - fromLatLngToPoint(latLng: ILatLng): Promise { - return; - } + fromLatLngToPoint(latLng: ILatLng): Promise { return; } /** * Convert the unit from the pixels from the left/top to the LatLng * @return {Promise} */ @CordovaInstance() - fromPointToLatLng(point: any): Promise { - return; - } + fromPointToLatLng(point: any): Promise { return; } /** * Set true if you want to show the MyLocation control (blue dot) @@ -2534,9 +2307,7 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - getFocusedBuilding(): Promise { - return; - } + getFocusedBuilding(): Promise { return; } /** * Set true if you want to show the indoor map @@ -2581,12 +2352,7 @@ export class GoogleMap extends BaseClass { * @param bottom {number} */ @CordovaInstance({ sync: true }) - setPadding( - top?: number, - right?: number, - bottom?: number, - left?: number - ): void {} + setPadding(top?: number, right?: number, bottom?: number, left?: number): void { } /** * Set options @@ -2628,9 +2394,7 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @InstanceCheck() - addMarkerCluster( - options: MarkerClusterOptions - ): Promise { + addMarkerCluster(options: MarkerClusterOptions): Promise { return new Promise((resolve, reject) => { this._objectInstance.addMarkerCluster(options, (markerCluster: any) => { if (markerCluster) { @@ -2766,9 +2530,7 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @InstanceCheck() - addGroundOverlay( - options: GroundOverlayOptions - ): Promise { + addGroundOverlay(options: GroundOverlayOptions): Promise { return new Promise((resolve, reject) => { this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => { if (groundOverlay) { @@ -2822,15 +2584,15 @@ export class GoogleMap extends BaseClass { * @return {Promise} */ @CordovaInstance() - toDataURL(params?: ToDataUrlOptions): Promise { - return; - } + toDataURL(params?: ToDataUrlOptions): Promise { return; } + } /** * @hidden */ export class GroundOverlay extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -2844,17 +2606,13 @@ export class GroundOverlay extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Change the bounds of the GroundOverlay @@ -2868,38 +2626,34 @@ export class GroundOverlay extends BaseClass { * @param bearing {number} */ @CordovaInstance({ sync: true }) - setBearing(bearing: number): void {} + setBearing(bearing: number): void { } /** * Return the current bearing value */ @CordovaInstance({ sync: true }) - getBearing(): number { - return; - } + getBearing(): number { return; } /** * Change the image of the ground overlay * @param image {string} URL of image */ @CordovaInstance({ sync: true }) - setImage(image: string): void {} + setImage(image: string): void {}; /** * Change the opacity of the ground overlay from 0.0 to 1.0 * @param opacity {number} */ @CordovaInstance({ sync: true }) - setOpacity(opacity: number): void {} + setOpacity(opacity: number): void { } /** * Return the current opacity * @return {number} */ @CordovaInstance({ sync: true }) - getOpacity(): number { - return; - } + getOpacity(): number { return; } /** * Change clickablity of the ground overlay @@ -2913,25 +2667,21 @@ export class GroundOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { - return; - } + getClickable(): boolean { return; } /** * Change visibility of the ground overlay * @param visible {boolean} */ @CordovaInstance({ sync: true }) - setVisible(visible: boolean): void {} + setVisible(visible: boolean): void { } /** * Return true if the ground overlay is visible * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } /** * Change the ground overlay zIndex order @@ -2945,9 +2695,7 @@ export class GroundOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Remove the ground overlay @@ -2970,9 +2718,10 @@ export class GroundOverlay extends BaseClass { repo: '' }) export class HtmlInfoWindow extends BaseClass { + constructor() { super(); - this._objectInstance = new (GoogleMaps.getPlugin()).HtmlInfoWindow(); + this._objectInstance = new (GoogleMaps.getPlugin().HtmlInfoWindow)(); } /** @@ -3002,12 +2751,14 @@ export class HtmlInfoWindow extends BaseClass { */ @CordovaInstance() close(): void {} + } /** * @hidden */ export class Marker extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3021,35 +2772,27 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Set the marker position. * @param latLng {ILatLng} */ @CordovaInstance({ sync: true }) - setPosition(latLng: ILatLng): void { - return; - } + setPosition(latLng: ILatLng): void { return; } /** * Return the marker position. * @return {ILatLng} */ @CordovaInstance({ sync: true }) - getPosition(): ILatLng { - return; - } + getPosition(): ILatLng { return; } /** * Show the normal infoWindow of the marker. @@ -3088,9 +2831,7 @@ export class Marker extends BaseClass { * Return true if the marker is visible */ @CordovaInstance({ sync: true }) - isVisible(): boolean { - return; - } + isVisible(): boolean { return; } /** * Change title of the normal infoWindow. @@ -3104,9 +2845,7 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getTitle(): string { - return; - } + getTitle(): string { return; } /** * Change snippet of the normal infoWindow. @@ -3120,9 +2859,7 @@ export class Marker extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getSnippet(): string { - return; - } + getSnippet(): string { return; } /** * Change the marker opacity from 0.0 to 1.0. @@ -3136,9 +2873,7 @@ export class Marker extends BaseClass { * @return {number} Opacity */ @CordovaInstance({ sync: true }) - getOpacity(): number { - return; - } + getOpacity(): number { return; } /** * Remove the marker. @@ -3171,18 +2906,14 @@ export class Marker extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - isInfoWindowShown(): boolean { - return; - } + isInfoWindowShown(): boolean { return; } /** * Return the marker hash code. * @return {string} Marker hash code */ @CordovaInstance({ sync: true }) - getHashCode(): string { - return; - } + getHashCode(): string { return; } /** * Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays. @@ -3196,65 +2927,57 @@ export class Marker extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Set true if you allow all users to drag the marker. * @param draggable {boolean} */ @CordovaInstance({ sync: true }) - setDraggable(draggable: boolean): void {} + setDraggable(draggable: boolean): void { } /** * Return true if the marker drag is enabled. * @return {boolean} */ @CordovaInstance({ sync: true }) - isDraggable(): boolean { - return; - } + isDraggable(): boolean { return; } /** * Set true if you want to be flat marker. * @param flat {boolean} */ @CordovaInstance({ sync: true }) - setFlat(flat: boolean): void { - return; - } + setFlat(flat: boolean): void { return; } /** * Change icon url and/or size * @param icon */ @CordovaInstance({ sync: true }) - setIcon(icon: MarkerIcon): void { - return; - } + setIcon(icon: MarkerIcon): void { return; } /** * Set the marker rotation angle. * @param rotation {number} */ @CordovaInstance({ sync: true }) - setRotation(rotation: number): void {} + setRotation(rotation: number): void { } /** * Return the marker rotation angle. * @return {number} */ @CordovaInstance({ sync: true }) - getRotation(): number { - return; - } + getRotation(): number { return; } + } /** * @hidden */ export class MarkerCluster extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3268,9 +2991,7 @@ export class MarkerCluster extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Add one marker location @@ -3302,15 +3023,15 @@ export class MarkerCluster extends BaseClass { * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } + } /** * @hidden */ export class Polygon extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3324,17 +3045,13 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Change the polygon points. @@ -3373,7 +3090,7 @@ export class Polygon extends BaseClass { results.push(hole); }); return results; - } + } /** * Change the filling color (inner color) @@ -3387,9 +3104,7 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getFillColor(): string { - return; - } + getFillColor(): string { return; } /** * Change the stroke color (outer color) @@ -3403,9 +3118,7 @@ export class Polygon extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { - return; - } + getStrokeColor(): string { return; } /** * Change clickablity of the polygon @@ -3418,9 +3131,7 @@ export class Polygon extends BaseClass { * Return true if the polygon is clickable */ @CordovaInstance({ sync: true }) - getClickable(): boolean { - return; - } + getClickable(): boolean { return; } /** * Change visibility of the polygon @@ -3434,9 +3145,7 @@ export class Polygon extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } /** * Change the polygon zIndex order. @@ -3450,9 +3159,7 @@ export class Polygon extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Remove the polygon. @@ -3474,9 +3181,7 @@ export class Polygon extends BaseClass { * Return the polygon stroke width */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { - return; - } + getStrokeWidth(): number { return; } /** * When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. @@ -3490,15 +3195,15 @@ export class Polygon extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getGeodesic(): boolean { - return; - } + getGeodesic(): boolean { return; } + } /** * @hidden */ export class Polyline extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3512,17 +3217,13 @@ export class Polyline extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Change the polyline points. @@ -3552,9 +3253,7 @@ export class Polyline extends BaseClass { * Return true if the polyline is geodesic */ @CordovaInstance({ sync: true }) - getGeodesic(): boolean { - return; - } + getGeodesic(): boolean { return; } /** * Change visibility of the polyline @@ -3568,9 +3267,7 @@ export class Polyline extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } /** * Change clickablity of the polyline @@ -3584,9 +3281,7 @@ export class Polyline extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { - return; - } + getClickable(): boolean { return; } /** * Change the polyline color @@ -3600,9 +3295,7 @@ export class Polyline extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getStrokeColor(): string { - return; - } + getStrokeColor(): string { return; } /** * Change the polyline stroke width @@ -3616,9 +3309,7 @@ export class Polyline extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getStrokeWidth(): number { - return; - } + getStrokeWidth(): number { return; } /** * Change the polyline zIndex order. @@ -3632,9 +3323,7 @@ export class Polyline extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Remove the polyline @@ -3651,6 +3340,7 @@ export class Polyline extends BaseClass { * @hidden */ export class TileOverlay extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3664,17 +3354,13 @@ export class TileOverlay extends BaseClass { * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Set whether the tiles should fade in. @@ -3688,9 +3374,7 @@ export class TileOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getFadeIn(): boolean { - return; - } + getFadeIn(): boolean { return; } /** * Set the zIndex of the tile overlay @@ -3704,9 +3388,7 @@ export class TileOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getZIndex(): number { - return; - } + getZIndex(): number { return; } /** * Set the opacity of the tile overlay @@ -3720,9 +3402,7 @@ export class TileOverlay extends BaseClass { * @return {number} */ @CordovaInstance({ sync: true }) - getOpacity(): number { - return; - } + getOpacity(): number { return; } /** * Set false if you want to hide @@ -3736,17 +3416,13 @@ export class TileOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } /** * Get tile size */ @CordovaInstance({ sync: true }) - getTileSize(): any { - return; - } + getTileSize(): any { return; } /** * Remove the tile overlay @@ -3763,6 +3439,7 @@ export class TileOverlay extends BaseClass { * @hidden */ export class KmlOverlay extends BaseClass { + private _map: GoogleMap; constructor(_map: GoogleMap, _objectInstance: any) { @@ -3771,12 +3448,12 @@ export class KmlOverlay extends BaseClass { this._objectInstance = _objectInstance; Object.defineProperty(self, 'camera', { - value: this._objectInstance.camera, - writable: false + value: this._objectInstance.camera, + writable: false }); Object.defineProperty(self, 'kmlData', { - value: this._objectInstance.kmlData, - writable: false + value: this._objectInstance.kmlData, + writable: false }); } @@ -3784,26 +3461,20 @@ export class KmlOverlay extends BaseClass { * Returns the viewport to contains all overlays */ @CordovaInstance({ sync: true }) - getDefaultViewport(): CameraPosition { - return; - } + getDefaultViewport(): CameraPosition { return; } /** * Return the ID of instance. * @return {string} */ @CordovaInstance({ sync: true }) - getId(): string { - return; - } + getId(): string { return; } /** * Return the map instance. * @return {GoogleMap} */ - getMap(): GoogleMap { - return this._map; - } + getMap(): GoogleMap { return this._map; } /** * Change visibility of the polyline @@ -3817,9 +3488,7 @@ export class KmlOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getVisible(): boolean { - return; - } + getVisible(): boolean { return; } /** * Change clickablity of the KmlOverlay @@ -3833,9 +3502,7 @@ export class KmlOverlay extends BaseClass { * @return {boolean} */ @CordovaInstance({ sync: true }) - getClickable(): boolean { - return; - } + getClickable(): boolean { return; } /** * Remove the KmlOverlay From 560d708002795719a366a3b5be26c48174057e40 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 19 Mar 2018 13:37:30 -0500 Subject: [PATCH 04/13] 4.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dfead97c..d4cc528f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "4.5.2", + "version": "4.6.0", "description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support", "homepage": "https://ionicframework.com/", "author": "Ionic Team (https://ionic.io)", From 0b1e8f9b9d8b9bc74e762be8e06f34067ead4b3e Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 19 Mar 2018 19:42:12 +0100 Subject: [PATCH 05/13] chore(): update changelog --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c0c47f..99cddb63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,51 @@ - -## [4.5.2](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.3...v4.5.2) (2018-01-25) + +# [4.6.0](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.3...v4.6.0) (2018-03-19) ### Bug Fixes +* **badge:** add correct requestPermission function ([586c7e5](https://github.com/ionic-team/ionic-native/commit/586c7e5)) +* **call-log:** comments erratum ([4b9cf17](https://github.com/ionic-team/ionic-native/commit/4b9cf17)) +* **call-log:** update getCallLog signature ([61c0ecf](https://github.com/ionic-team/ionic-native/commit/61c0ecf)) +* **contacts:** refactor wrong ContactFieldTypes ([f607a03](https://github.com/ionic-team/ionic-native/commit/f607a03)) +* **facebook:** remove browserInit function ([f718432](https://github.com/ionic-team/ionic-native/commit/f718432)) +* **firebase-analytics:** add `sync` option for all methods ([42fd1f2](https://github.com/ionic-team/ionic-native/commit/42fd1f2)) +* **google-maps:** wrong decorators ([e5b9d53](https://github.com/ionic-team/ionic-native/commit/e5b9d53)) +* **health-kit:** add missing properties to HealthKitOptions ([f8e79ce](https://github.com/ionic-team/ionic-native/commit/f8e79ce)) +* **index-app-content:** remove onItemPressed function ([270678f](https://github.com/ionic-team/ionic-native/commit/270678f)) +* **printer:** add correct npm repository ([4bf55d3](https://github.com/ionic-team/ionic-native/commit/4bf55d3)) * **pro:** proper callback type and guard for plugin instantiate. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([61293c3](https://github.com/ionic-team/ionic-native/commit/61293c3)) +* **pro:** Tweak to pro plugin. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([c8ecee0](https://github.com/ionic-team/ionic-native/commit/c8ecee0)) +* **Pro:** CordovaCheck should sync. [#2136](https://github.com/ionic-team/ionic-native/issues/2136) [#2127](https://github.com/ionic-team/ionic-native/issues/2127) ([f419db5](https://github.com/ionic-team/ionic-native/commit/f419db5)) +* **push:** Android senderID as optional ([1b237aa](https://github.com/ionic-team/ionic-native/commit/1b237aa)) +* **Radmob-pro:** add offsetTopBar option ([4948640](https://github.com/ionic-team/ionic-native/commit/4948640)) +* **sqlite:** remove trailing whitespaces ([7547a94](https://github.com/ionic-team/ionic-native/commit/7547a94)) +* **web-intent:** allow extras ([8dc5ad2](https://github.com/ionic-team/ionic-native/commit/8dc5ad2)) + + +### Features + +* **app-rate:** add custom locale interface ([2a18dbc](https://github.com/ionic-team/ionic-native/commit/2a18dbc)) +* **app-update:** add app update options ([0f325ed](https://github.com/ionic-team/ionic-native/commit/0f325ed)) +* **appodeal:** add new functions ([247a1a1](https://github.com/ionic-team/ionic-native/commit/247a1a1)) +* **base64-to-gallery:** add options interface ([11d516f](https://github.com/ionic-team/ionic-native/commit/11d516f)) +* **ble:** add scan options interface ([e345fed](https://github.com/ionic-team/ionic-native/commit/e345fed)) +* **calendar:** add getCreateCalendarOptions function ([13765d2](https://github.com/ionic-team/ionic-native/commit/13765d2)) +* **call-log:** add plugin ([76a644d](https://github.com/ionic-team/ionic-native/commit/76a644d)) +* **camera-preview:** add onBackButton function ([a345e2c](https://github.com/ionic-team/ionic-native/commit/a345e2c)) +* **device-accounts:** add android account interface ([d2261b6](https://github.com/ionic-team/ionic-native/commit/d2261b6)) +* **device-feedback:** add feedback interface ([7cafebd](https://github.com/ionic-team/ionic-native/commit/7cafebd)) +* **google-analytics:** add missing functions ([ff0008e](https://github.com/ionic-team/ionic-native/commit/ff0008e)) +* **google-maps:** update to match latest plugin version ([#2320](https://github.com/ionic-team/ionic-native/issues/2320)) ([f11be24](https://github.com/ionic-team/ionic-native/commit/f11be24)) +* **hot code push:** add cordova-hot-code-push ([e7968da](https://github.com/ionic-team/ionic-native/commit/e7968da)) +* **hot code push:** add update events ([04bdade](https://github.com/ionic-team/ionic-native/commit/04bdade)) +* **jins-meme:** enable background mode data collection ([1932f2d](https://github.com/ionic-team/ionic-native/commit/1932f2d)) +* **local-notifications:** added a new param to specify if the notification will be silent ([6e58192](https://github.com/ionic-team/ionic-native/commit/6e58192)) +* **one-signal:** add clearOneSignalNotifications function ([fc0338a](https://github.com/ionic-team/ionic-native/commit/fc0338a)) +* **plugin:** add iOS File Picker ([571df3a](https://github.com/ionic-team/ionic-native/commit/571df3a)) +* **speechkit:** plugin implementation ([41e5a0f](https://github.com/ionic-team/ionic-native/commit/41e5a0f)) +* **sqlite:** add selfTest function ([241f073](https://github.com/ionic-team/ionic-native/commit/241f073)) +* **web-intent:** add startService function ([15bb350](https://github.com/ionic-team/ionic-native/commit/15bb350)) From 4497e00670974b9da132fded41a1331c4b392716 Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Mon, 12 Mar 2018 00:22:05 +0100 Subject: [PATCH 06/13] feat(http): add support for new methods (#2249) --- src/@ionic-native/plugins/http/index.ts | 65 +++++++++++++++++++++---- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/src/@ionic-native/plugins/http/index.ts b/src/@ionic-native/plugins/http/index.ts index b9a1bdcf..c5d0f838 100644 --- a/src/@ionic-native/plugins/http/index.ts +++ b/src/@ionic-native/plugins/http/index.ts @@ -33,7 +33,7 @@ export interface HTTPResponse { * ```typescript * import { HTTP } from '@ionic-native/http'; * - * constructor(private http: HTTP) { } + * constructor(private http: HTTP) {} * * ... * @@ -89,28 +89,56 @@ export class HTTP extends IonicNativePlugin { useBasicAuth(username: string, password: string): void {} /** - * Set a header for all future requests. Takes a header and a value. + * Get all headers defined for a given hostname. + * @param host {string} The hostname + * @returns {string} return all headers defined for the hostname + */ + @Cordova({ sync: true }) + getHeaders(host: string): string { + return; + } + + /** + * Set a header for all future requests. Takes a hostname, a header and a value. + * @param host {string} The hostname to be used for scoping this header * @param header {string} The name of the header * @param value {string} The value of the header */ @Cordova({ sync: true }) - setHeader(header: string, value: string): void {} + setHeader(host: string, header: string, value: string): void {} + + /** + * Get the name of the data serializer which will be used for all future POST and PUT requests. + * @returns {string} returns the name of the configured data serializer + */ + @Cordova({ sync: true }) + getDataSerializer(): string { + return; + } /** * 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, utf8 or json */ @Cordova({ sync: true }) setDataSerializer(serializer: string): void {} /** - * Clear all cookies + * Add a custom cookie. + * @param url {string} Scope of the cookie + * @param cookie {string} RFC compliant cookie string + */ + @Cordova({ sync: true }) + setCookie(url: string, cookie: string): void {} + + /** + * Clear all cookies. */ @Cordova({ sync: true }) clearCookies(): void {} /** - * Remove cookies + * Remove cookies for given URL. * @param url {string} * @param cb */ @@ -118,14 +146,23 @@ export class HTTP extends IonicNativePlugin { removeCookies(url: string, cb: () => void): void {} /** - * Disable following redirects automatically - * @param disable {boolean} Set to true to disable following redirects automatically + * Resolve cookie string for given URL. + * @param url {string} */ @Cordova({ sync: true }) - disableRedirect(disable: boolean): void {} + getCookieString(url: string): string { return; } /** - * Set request timeout + * Get global request timeout value in seconds. + * @returns {number} returns the global request timeout value + */ + @Cordova({ sync: true }) + getRequestTimeout(): number { + return; + } + + /** + * Set global request timeout value in seconds. * @param timeout {number} The timeout in seconds. Default 60 */ @Cordova({ sync: true }) @@ -155,6 +192,14 @@ export class HTTP extends IonicNativePlugin { return; } + /** + * Disable following redirects automatically. + * @param disable {boolean} Set to true to disable following redirects automatically + * @returns {Promise} returns a promise that will resolve on success, and reject on failure + */ + @Cordova() + disableRedirect(disable: boolean): Promise { return; } + /** * Make a POST request * @param url {string} The url to send the request to From c2a62cd3c811357d9ddfb8bf8163822298a95d0c Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Wed, 21 Mar 2018 21:30:06 +0100 Subject: [PATCH 07/13] feat(http): add support for new properties (#2135) --- src/@ionic-native/plugins/http/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/http/index.ts b/src/@ionic-native/plugins/http/index.ts index c5d0f838..c55d2e46 100644 --- a/src/@ionic-native/plugins/http/index.ts +++ b/src/@ionic-native/plugins/http/index.ts @@ -6,14 +6,18 @@ export interface HTTPResponse { * The status number of the response */ status: number; - /** - * The data that is in the response. This property usually exists when a promise returned by a request method resolves. - */ - data?: any; /** * The headers of the response */ headers: any; + /** + * The URL of the response. This property will be the final URL obtained after any redirects. + */ + url: string; + /** + * The data that is in the response. This property usually exists when a promise returned by a request method resolves. + */ + data?: any; /** * Error response from the server. This property usually exists when a promise returned by a request method rejects. */ From 8b8ccfbdc359714ea80d5a7f8df32c2241465c4b Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Thu, 22 Mar 2018 12:12:52 +0100 Subject: [PATCH 08/13] docs(file-picker): change plugin name fixes: #2413 --- src/@ionic-native/plugins/file-picker/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/file-picker/index.ts b/src/@ionic-native/plugins/file-picker/index.ts index 9ce195b7..311f764b 100644 --- a/src/@ionic-native/plugins/file-picker/index.ts +++ b/src/@ionic-native/plugins/file-picker/index.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** - * @name File Chooser + * @name iOS File Picker * @description * * Opens the file picker on iOS for the user to select a file, returns a file URI. From e5034bf8276362cb25af27b86815a56b1757bd99 Mon Sep 17 00:00:00 2001 From: Lorenz an Mey Date: Thu, 22 Mar 2018 17:08:23 +0100 Subject: [PATCH 09/13] feat(local-notifications): Support version 0.9.0-beta.3 of cordova-plugin-local-notifications --- .../plugins/local-notifications/index.ts | 438 ++++++++++++++++-- 1 file changed, 388 insertions(+), 50 deletions(-) diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index 0aa51fe0..d21bff20 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -1,5 +1,192 @@ import { Injectable } from '@angular/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; + +export enum ELocalNotificationTriggerUnit { + SECOND = 'second', + MINUTE = 'minute', + HOUR = 'hour', + DAY = 'day', + WEEK = 'week', + MONTH = 'month', + QUARTER = 'quarter', + YEAR = 'year', + WEEKDAY = 'weekday', + WEEKDAY_ORDINAL = 'weekdayOrdinal', + WEEK_OF_MONTH = 'weekOfMonth' +} + +export interface ILocalNotificationTrigger { + + /** ***** FIX ***** */ + + /** + * The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately. + * Default: now ~ new Date() + */ + at?: Date; + + /** ***** TIMESPAN ***** */ + + /** + * Amount of units + */ + in?: number; + + /** + * Unit + */ + unit?: ELocalNotificationTriggerUnit; + + /** ***** REPEAT/MATCH ***** */ + + /** + * Amount of units + */ + count?: number; + + /** + * Unit + */ + every?: ELocalNotificationTriggerUnit; + + before?: Date; + + /** + * The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately. + * Only for "repeat" + * Default: now ~ new Date() + */ + firstAt?: Date; + + /** + * Only for "match" + */ + after?: Date; + + /** ***** LOCATION ***** */ + + /** + * IOS ONLY + * Center of the location + * Latitude and Longitude values + */ + center?: number[]; + + /** + * IOS ONLY + * Radius in meters + */ + radius?: number; + + /** + * IOS ONLY + * Trigger on entry of the location + */ + notifyOnEntry?: boolean; + + /** + * IOS ONLY + * Trigger on exit of the location + */ + notifyOnExit?: boolean; + + /** + * IOS ONLY + * Trigger only once? + */ + single?: boolean; +} + +export enum ILocalNotificationActionType { + INPUT = 'input', + BUTTON = 'button' +} + +/** + * Notification action + * + * @see https://github.com/katzer/cordova-plugin-local-notifications#actions + */ +export interface ILocalNotificationAction { + /** + * The id of the action is used as the event name in the listener function + */ + id?: string; + + /** + * The title of the notification message + */ + title?: string; + + /** + * Specifies whether the action causes the app to launch in the foreground + */ + launch?: boolean; + + /** + * If the value is 'decline' the action is displayed with special highlighting to indicate that it performs a destructive task + */ + ui?: string; + + /** + * Specifies whether the action requires that the user’s device be unlocked. + * When the user selects an action with this option, the system prompts + * the user to unlock the device + */ + needsAuth?: boolean; + + /** + * The resource path of the action icon + */ + icon?: string; + + /** + * The type of the action. If omitted 'button' is used. + */ + type?: ILocalNotificationActionType; +} + +export interface ILocalNotificationProgressBar { + /** + * Is the progress bar enabled? + */ + enabled?: boolean; + + /** + * The current value + */ + value?: number; + + /** + * ANDROID ONLY + * The maximum value (default is 100) + */ + maxValue?: number; + + /** + * ANDROID ONLY + * Show an indeterminate progress bar + */ + indeterminate?: boolean; + + /** + * WINDOWS ONLY + * Gets or sets an optional string to be displayed instead of the + * default percentage string. If this isn't provided, something + * like "70%" will be displayed. + */ + description?: string; + + /** + * WINDOWS ONLY + * Sets the status (required), which is displayed underneath the progress bar + * on the left. + * This string should reflect the status of the operation, + * like "Downloading..." or "Installing..." + */ + status?: string; +} export interface ILocalNotification { @@ -19,20 +206,7 @@ export interface ILocalNotification { * Second row of the notification * Default: Empty string */ - text?: string; - - /** - * The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year - * Default: 0 (which means that the system triggers the local notification once) - */ - every?: string; - - /** - * The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately. - * Default: now ~ new Date() - */ - at?: any; - firstAt?: any; + text?: string | string[]; /** * The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android) @@ -67,38 +241,159 @@ export interface ILocalNotification { smallIcon?: string; /** - * ANDROID ONLY - * RGB value for the background color of the smallIcon. - * Default: Androids COLOR_DEFAULT, which will vary based on Android version. - */ + * ANDROID ONLY + * RGB value for the background color of the smallIcon. + * Default: Androids COLOR_DEFAULT, which will vary based on Android version. + */ color?: string; + /** + * ANDROID ONLY + * Use the default notification vibrate. + */ + vibrate?: boolean; /** * ANDROID ONLY - * Ongoing notifications differ from regular notifications in the following ways: - * - They are sorted above the regular notifications in the notification panel - * - They do not have an 'X' close button, and are not affected by the "Clear all" button - * Default: false + * Define the blinking of the LED on the device. + * If set to true, the LED will blink in the default color with + * timings for on and off set to 1000 ms. + * If set to a string, the LED will blink in this ARGB value with + * timings for on and off set to 1000 ms. + * If set to an array, the value of the key 0 will be used as the color, + * the value of the key 1 will be used as the 'on' timing, the value of + * the key 2 will be used as the 'off' timing */ - ongoing?: boolean; + led?: {color: string, on: number, off: number} | any[] | boolean | string; /** - * ANDROID ONLY - * ARGB value that you would like the LED on the device to blink - * Default: FFFFFF + * Notification priority. + * Integers between -2 and 2, whereas -2 is minimum and 2 is maximum priority */ - led?: string; - - /** - * Notification priority. - */ priority?: number; /** * Is a silent notification */ silent?: boolean; + + /** + * Specifies whether the a click on the notification causes the app + * to launch in the foreground + */ + launch?: boolean; + + /** + * ANDROID ONLY + * Wakeup the device. (default is true) + */ + wakeup?: boolean; + + /** + * ANDROID ONLY + * Specifies a duration in milliseconds after which this notification should be canceled, if it is not already canceled. + */ + timeoutAfter?: number | false; + + /** + * Actions id or actions + */ + actions?: string | ILocalNotificationAction[]; + + /** + * When to trigger the notification + */ + trigger?: ILocalNotificationTrigger; + + /** + * A list of image attachments + */ + attachments?: string[]; + + /** + * ANDROID ONLY + * If and how the notification shall show the when date. + * Possbile values: + * boolean: true equals 'clock', false disable a watch/counter + * 'clock': Show the when date in the content view + * 'chronometer': Show a stopwatch + * + */ + clock?: boolean | string; + + /** + * Shows a progress bar + * Setting a boolean is a shortcut for {enabled: true/false} respectively + */ + progressBar?: ILocalNotificationProgressBar | boolean; + + /** + * ANDROID ONLY + * If multiple notifications have the same group your app can present + * them as a single group. + */ + group?: string; + + /** + * ANDROID ONLY + * If set to 'true' this notification could use 'summary' to summarize + * the contents of the whole group + */ + groupSummary?: boolean; + + /** + * ANDROID ONLY + * Summary of the whole notification group. Should be used in conjuntion + * with 'groupSummary' set to true + */ + summary?: string; + + /** + * ANDROID ONLY + * Sets the number of items this notification represents. + */ + number?: number; + + /** + * ANDROID ONLY + * Set whether this is an "ongoing" notification. + * Ongoing notifications cannot be dismissed by the user, + * so your application or service must take care of canceling them. + */ + sticky?: boolean; + + /** + * ANDROID ONLY + * Make this notification automatically dismissed when the user touches it. + */ + autoClear?: boolean; + + /** + * ANDROID ONLY + * If set to true the notification will be show in its entirety on all lockscreens. + * If set to false it will not be revealed on a secure lockscreen. + */ + lockscreen?: boolean; + + /** + * ANDROID ONLY + * Set the default notification options that will be used. + * The value should be one or more of the following fields combined with + * bitwise-or: DEFAULT_SOUND, DEFAULT_VIBRATE, DEFAULT_LIGHTS. + */ + defaults?: number; + + /** + * ANDROID ONLY + * Specifies the channel the notification should be delivered on. + */ + channel?: string; + + /** + * ANDROID ONLY + * Set the token for the media session + */ + mediaSession?: string; } /** @@ -142,7 +437,7 @@ export interface ILocalNotification { * // Schedule delayed notification * this.localNotifications.schedule({ * text: 'Delayed ILocalNotification', - * at: new Date(new Date().getTime() + 3600), + * trigger: {at: new Date(new Date().getTime() + 3600)}, * led: 'FF0000', * sound: null * }); @@ -190,10 +485,7 @@ export class LocalNotifications extends IonicNativePlugin { * Clears all notifications * @returns {Promise} Returns a promise when all notifications have cleared */ - @Cordova({ - successIndex: 0, - errorIndex: 2 - }) + @Cordova() clearAll(): Promise { return; } /** @@ -208,10 +500,7 @@ export class LocalNotifications extends IonicNativePlugin { * Cancels all notifications * @returns {Promise} Returns a promise when all notifications are canceled */ - @Cordova({ - successIndex: 0, - errorIndex: 2 - }) + @Cordova() cancelAll(): Promise { return; } /** @@ -243,7 +532,7 @@ export class LocalNotifications extends IonicNativePlugin { * @returns {Promise>} */ @Cordova() - getAllIds(): Promise> { return; } + getIds(): Promise> { return; } /** * Get the ids of triggered notifications @@ -318,26 +607,75 @@ export class LocalNotifications extends IonicNativePlugin { @Cordova() hasPermission(): Promise { return; } + /** + * Adds a group of actions + * @param groupId The id of the action group + * @param actions The actions of this group + * @returns {Promise} + */ + @Cordova() + addActions(groupId: any, actions: Array): Promise { return; } + + /** + * Removes a group of actions + * @param groupId The id of the action group + * @returns {Promise} + */ + @Cordova() + removeActions(groupId: any): Promise { return; } + + /** + * Checks if a group of actions is defined + * @param groupId The id of the action group + * @returns {Promise} Whether the group is defined + */ + @Cordova() + hasActions(groupId: any): Promise { return; } + + /** + * Gets the (platform specific) default settings. + * @returns {Promise} An object with all default settings + */ + @Cordova({ + sync: true + }) + getDefaults(): Promise { return; } + + /** + * Overwrites the (platform specific) default settings. + * @returns {Promise} + */ + @Cordova({ + sync: true + }) + setDefaults(defaults: any): Promise { return; } /** * Sets a callback for a specific event - * @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall - * @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only. + * @param eventName {string} The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions + * @return {Observable} */ @Cordova({ - sync: true + observable: true, + clearFunction: 'un', + clearWithArgs: true }) - on(eventName: string, callback: any): void { } + on(eventName: string): Observable { return; } /** - * Removes a callback of a specific event - * @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall - * @param callback Call back function. All events return notification and state parameter. clear and clearall return state parameter only. + * Not an official interface, however its possible to manually fire events. + ** @param eventName The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions + * @param args Optional arguments */ @Cordova({ sync: true }) - un(eventName: string, callback: any): void { } - + fireEvent(eventName: string, args: any): void { } + /** + * Fire queued events once the device is ready and all listeners are registered. + * @returns {Promise} + */ + @Cordova() + fireQueuedEvents(): Promise{ return; } } From b05c9a4f8b355835e5be271cdabeeb5452baf72b Mon Sep 17 00:00:00 2001 From: Thomas Linford Date: Thu, 22 Mar 2018 17:10:35 +0100 Subject: [PATCH 10/13] feat(zeroconf) add watchAddressFamily and registerAddressFamily properties --- src/@ionic-native/plugins/zeroconf/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/@ionic-native/plugins/zeroconf/index.ts b/src/@ionic-native/plugins/zeroconf/index.ts index 63ce7457..d91228ff 100644 --- a/src/@ionic-native/plugins/zeroconf/index.ts +++ b/src/@ionic-native/plugins/zeroconf/index.ts @@ -131,4 +131,12 @@ export class Zeroconf extends IonicNativePlugin { */ @Cordova() reInit(): Promise { return; } + /** + * Family of addresses to register: ipv4, ipv6 or any. + */ + registerAddressFamily: 'ipv4' | 'ipv6' | 'any'; + /** + * Family of addresses to watch for: ipv4, ipv6 or any. + */ + watchAddressFamily: 'ipv4' | 'ipv6' | 'any'; } From 8a2637789f02e0392d60bed28f044f26d133b00f Mon Sep 17 00:00:00 2001 From: Lorenz an Mey Date: Thu, 22 Mar 2018 17:18:44 +0100 Subject: [PATCH 11/13] fix(local-notifications): fixed linting errors --- package-lock.json | 2 +- src/@ionic-native/plugins/local-notifications/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c7cf0248..7de92d6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "4.5.2", + "version": "4.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index d21bff20..927e386c 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -677,5 +677,5 @@ export class LocalNotifications extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - fireQueuedEvents(): Promise{ return; } + fireQueuedEvents(): Promise { return; } } From 37833fe41dcf281075fc782816ed68a2965852e7 Mon Sep 17 00:00:00 2001 From: Lorenz an Mey Date: Thu, 22 Mar 2018 17:25:41 +0100 Subject: [PATCH 12/13] docs(local-notifications): Complete sourcecode docs --- src/@ionic-native/plugins/local-notifications/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index 927e386c..8ee9b025 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -46,10 +46,13 @@ export interface ILocalNotificationTrigger { count?: number; /** - * Unit + * The unit */ every?: ELocalNotificationTriggerUnit; + /** + * The end of the repeating notification + */ before?: Date; /** From 84cecf78414c682779b872bc605d0bbd9b2e3bdb Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 22 Mar 2018 22:42:45 +0100 Subject: [PATCH 13/13] feat(call-log): add operator 'like' and array of values --- src/@ionic-native/plugins/call-log/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts index fd790628..43608abb 100644 --- a/src/@ionic-native/plugins/call-log/index.ts +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -3,8 +3,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface CallLogObject { name: string; - value: string; - operator: '==' | '!=' | '>' | '>=' | '<' | '<='; + value: string|Array; + operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like'; } /**