From 46f80555f73fab73a9b851a7680da0ec653a9b4d Mon Sep 17 00:00:00 2001 From: Ibby Date: Wed, 1 Mar 2017 19:35:35 -0500 Subject: [PATCH] refactor(): remove some prefixes --- .../plugins/action-sheet/index.ts | 17 +- src/@ionic-native/plugins/ad-mob/index.ts | 20 +- .../plugins/android-fingerprint-auth/index.ts | 14 +- src/@ionic-native/plugins/app-rate/index.ts | 6 +- .../plugins/google-maps/index.ts | 187 +++++++++--------- test/plugins/googlemap.spec.ts | 2 +- 6 files changed, 126 insertions(+), 120 deletions(-) diff --git a/src/@ionic-native/plugins/action-sheet/index.ts b/src/@ionic-native/plugins/action-sheet/index.ts index b7a11cfb2..f4c84a585 100644 --- a/src/@ionic-native/plugins/action-sheet/index.ts +++ b/src/@ionic-native/plugins/action-sheet/index.ts @@ -55,15 +55,18 @@ export interface ActionSheetOptions { * * @usage * ```typescript - * import { ActionSheet } from '@ionic-native/action-sheet'; + * import { ActionSheet, ActionSheetOptions } from '@ionic-native/action-sheet'; * * let buttonLabels = ['Share via Facebook', 'Share via Twitter']; - * ActionSheet.show({ - * 'title': 'What do you want with this image?', - * 'buttonLabels': buttonLabels, - * 'addCancelButtonWithLabel': 'Cancel', - * 'addDestructiveButtonWithLabel' : 'Delete' - * }).then((buttonIndex: number) => { + * + * const options: ActionSheetOptions = { + * title: 'What do you want with this image?', + * buttonLabels: buttonLabels, + * addCancelButtonWithLabel: 'Cancel', + * addDestructiveButtonWithLabel: 'Delete' + * }; + * + * ActionSheet.show(options).then((buttonIndex: number) => { * console.log('Button pressed: ' + buttonIndex); * }); * ``` diff --git a/src/@ionic-native/plugins/ad-mob/index.ts b/src/@ionic-native/plugins/ad-mob/index.ts index 76940132a..b0082c024 100644 --- a/src/@ionic-native/plugins/ad-mob/index.ts +++ b/src/@ionic-native/plugins/ad-mob/index.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Cordova, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; -export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM'; +export type AdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM'; export interface AdMobOptions { @@ -14,7 +14,7 @@ export interface AdMobOptions { /** * Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM` */ - adSize?: AdMobAdSize; + adSize?: AdSize; /** * Banner width, valid when `adSize` is set to `CUSTOM` @@ -64,11 +64,11 @@ export interface AdMobOptions { /** * Set extra color style for Ad */ - adExtras?: AdMobAdExtras; + adExtras?: AdExtras; } -export interface AdMobAdExtras { +export interface AdExtras { color_bg: string; @@ -90,23 +90,25 @@ export interface AdMobAdExtras { * Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks. * @usage * ```typescript - * import { AdMob } from '@ionic-native/ad-mob'; + * import { AdMob, AdMobOptions, AdSize, AdExtras } from '@ionic-native/ad-mob'; + * + * constructor(private admob: AdMob){} * * ionViewDidLoad() { - * AdMob.onAdDismiss() + * this.admob.onAdDismiss() * .subscribe(() => { console.log('User dismissed ad'); }); * } * * onClick() { - * AdMob.prepareInterstitial('YOUR_ADID') - * .then(() => { AdMob.showInterstitial(); }); + * this.admob.prepareInterstitial('YOUR_ADID') + * .then(() => { this.admob.showInterstitial(); }); * } * * ``` * * @interfaces * AdMobOptions - * AdMobAdExtras + * AdExtras */ @Plugin({ pluginName: 'AdMob', diff --git a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts b/src/@ionic-native/plugins/android-fingerprint-auth/index.ts index 310332d13..bd7c84b4b 100644 --- a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts +++ b/src/@ionic-native/plugins/android-fingerprint-auth/index.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Cordova, Plugin } from '@ionic-native/core'; -export interface AndroidFingerprintAuthOptions { +export interface AuthOptions { /** * Required @@ -71,7 +71,7 @@ export interface AndroidFingerprintAuthOptions { * This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup. * @usage * ```typescript - * import { AndroidFingerprintAuth } from '@ionic-native/android-fingerprint-auth'; + * import { AndroidFingerprintAuth, AuthOptions } from '@ionic-native/android-fingerprint-auth'; * * AndroidFingerprintAuth.isAvailable() * .then((result)=> { @@ -100,7 +100,7 @@ export interface AndroidFingerprintAuthOptions { * .catch(error => console.error(error)); * ``` * @interfaces - * AndroidFingerprintAuthOptions + * AuthOptions */ @Plugin({ pluginName: 'AndroidFingerprintAuth', @@ -113,11 +113,11 @@ export class AndroidFingerprintAuth { /** * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. - * @param options {AndroidFingerprintAuthOptions} Options + * @param options {AuthOptions} Options * @returns {Promise} */ @Cordova() - encrypt(options: AndroidFingerprintAuthOptions): Promise<{ + encrypt(options: AuthOptions): Promise<{ /** * Biometric authentication */ @@ -134,11 +134,11 @@ export class AndroidFingerprintAuth { /** * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. - * @param options {AndroidFingerprintAuthOptions} Options + * @param options {AuthOptions} Options * @returns {Promise} */ @Cordova() - decrypt(options: AndroidFingerprintAuthOptions): Promise<{ + decrypt(options: AuthOptions): Promise<{ /** * Biometric authentication */ diff --git a/src/@ionic-native/plugins/app-rate/index.ts b/src/@ionic-native/plugins/app-rate/index.ts index 5bad2e1b2..088671cc3 100644 --- a/src/@ionic-native/plugins/app-rate/index.ts +++ b/src/@ionic-native/plugins/app-rate/index.ts @@ -49,7 +49,7 @@ export interface AppRatePreferences { /** * App Store URLS */ - storeAppURL?: AppRateStoreAppUrls; + storeAppURL?: AppUrls; } @@ -67,7 +67,7 @@ export interface AppRateCallbacks { } -export interface AppRateStoreAppUrls { +export interface AppUrls { /** * application id in AppStore @@ -112,7 +112,7 @@ export interface AppRateStoreAppUrls { * * @interfaces * AppRatePreferences - * AppRateStoreAppUrls + * AppUrls * AppRateCallbacks * */ diff --git a/src/@ionic-native/plugins/google-maps/index.ts b/src/@ionic-native/plugins/google-maps/index.ts index 3c8e1eeb1..4d276bfc8 100644 --- a/src/@ionic-native/plugins/google-maps/index.ts +++ b/src/@ionic-native/plugins/google-maps/index.ts @@ -41,7 +41,7 @@ export const GoogleMapsAnimation = { /** * @private */ -export class GoogleMapsObject { +export class GoogleMap { _objectInstance: any; /** @@ -184,7 +184,7 @@ export class GoogleMapsObject { getLicenseInfo(): Promise { return; } @CordovaInstance({ sync: true }) - setCenter(latLng: GoogleMapsLatLng): void { } + setCenter(latLng: LatLng): void { } @CordovaInstance({ sync: true }) setZoom(zoomLevel: number): void { } @@ -223,17 +223,17 @@ export class GoogleMapsObject { setAllGesturesEnabled(enabled: boolean): void { } /** - * @returns {Promise} + * @returns {Promise} */ - addMarker(options: GoogleMapsMarkerOptions): Promise { + addMarker(options: MarkerOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addMarker(options, (marker: any) => { if (marker) { - resolve(new GoogleMapsMarker(marker)); + resolve(new Marker(marker)); } else { reject(); } @@ -243,17 +243,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addCircle(options: GoogleMapsCircleOptions): Promise { + addCircle(options: CircleOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addCircle(options, (circle: any) => { if (circle) { - resolve(new GoogleMapsCircle(circle)); + resolve(new Circle(circle)); } else { reject(); } @@ -263,17 +263,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addPolygon(options: GoogleMapsPolygonOptions): Promise { + addPolygon(options: PolygonOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addPolygon(options, (polygon: any) => { if (polygon) { - resolve(new GoogleMapsPolygon(polygon)); + resolve(new Polygon(polygon)); } else { reject(); } @@ -283,17 +283,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addPolyline(options: GoogleMapsPolylineOptions): Promise { + addPolyline(options: PolylineOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addPolyline(options, (polyline: any) => { if (polyline) { - resolve(new GoogleMapsPolyline(polyline)); + resolve(new Polyline(polyline)); } else { reject(); } @@ -303,17 +303,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addTileOverlay(options: GoogleMapsTileOverlayOptions): Promise { + addTileOverlay(options: TileOverlayOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addTileOverlay(options, (tileOverlay: any) => { if (tileOverlay) { - resolve(new GoogleMapsTileOverlay(tileOverlay)); + resolve(new TileOverlay(tileOverlay)); } else { reject(); } @@ -323,17 +323,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addGroundOverlay(options: GoogleMapsGroundOverlayOptions): Promise { + addGroundOverlay(options: GroundOverlayOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addGroundOverlay(options, (groundOverlay: any) => { if (groundOverlay) { - resolve(new GoogleMapsGroundOverlay(groundOverlay)); + resolve(new GroundOverlay(groundOverlay)); } else { reject(); } @@ -343,17 +343,17 @@ export class GoogleMapsObject { } /** - * @returns {Promise} + * @returns {Promise} */ - addKmlOverlay(options: GoogleMapsKmlOverlayOptions): Promise { + addKmlOverlay(options: KmlOverlayOptions): Promise { if (!this._objectInstance) { return Promise.reject({ error: 'plugin_not_installed' }); } - return new Promise( + return new Promise( (resolve, reject) => { this._objectInstance.addKmlOverlay(options, (kmlOverlay: any) => { if (kmlOverlay) { - resolve(new GoogleMapsKmlOverlay(kmlOverlay)); + resolve(new KmlOverlay(kmlOverlay)); } else { reject(); } @@ -387,13 +387,13 @@ export class GoogleMapsObject { * @returns {Promise} */ @CordovaInstance() - fromLatLngToPoint(latLng: GoogleMapsLatLng, point: any): Promise { return; } + fromLatLngToPoint(latLng: LatLng, point: any): Promise { return; } /** - * @returns {Promise} + * @returns {Promise} */ @CordovaInstance() - fromPointToLatLng(point: any, latLng: GoogleMapsLatLng): Promise { return; } + fromPointToLatLng(point: any, latLng: LatLng): Promise { return; } /** * @returns {Promise} @@ -414,16 +414,17 @@ export class GoogleMapsObject { * @usage * ``` * import { + * GoogleMaps, * GoogleMap, * GoogleMapsEvent, - * GoogleMapsLatLng, + * LatLng, * CameraPosition, - * GoogleMapsMarkerOptions, - * GoogleMapsMarker + * MarkerOptions, + * Marker * } from '@ionic-native/google-maps'; * * export class MapPage { - * constructor() {} + * constructor(private googleMaps: GoogleMaps) {} * * // Load map only after view is initialize * ngAfterViewInit() { @@ -440,13 +441,13 @@ export class GoogleMapsObject { * // create a new map by passing HTMLElement * let element: HTMLElement = document.getElementById('map'); * - * let map = new GoogleMap(element); + * let map: GoogleMap = GoogleMaps.create(element); * * // listen to MAP_READY event * map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!')); * * // create LatLng object - * let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802); + * let ionic: LatLng = new GoogleMapsLatLng(43.0741904,-89.3809802); * * // create CameraPosition * let position: CameraPosition = { @@ -459,13 +460,13 @@ export class GoogleMapsObject { * map.moveCamera(position); * * // create new marker - * let markerOptions: GoogleMapsMarkerOptions = { + * let markerOptions: MarkerOptions = { * position: ionic, * title: 'Ionic' * }; * - * map.addMarker(markerOptions) - * .then((marker: GoogleMapsMarker) => { + * const marker: Marker = map.addMarker(markerOptions) + * .then((marker: Marker) => { * marker.showInfoWindow(); * }); * } @@ -473,7 +474,7 @@ export class GoogleMapsObject { * } * ``` * @classes - * GoogleMapsObject + * GoogleMap */ @Plugin({ pluginName: 'GoogleMaps', @@ -490,10 +491,10 @@ export class GoogleMaps { * Creates a new GoogleMap instance * @param element {string | HTMLElement} Element ID or reference to attach the map to * @param options {any} Options - * @returns {GoogleMapsObject} + * @returns {GoogleMap} */ - create(element: string | HTMLElement, options?: any): GoogleMapsObject { - return new GoogleMapsObject(element, options); + create(element: string | HTMLElement, options?: any): GoogleMap { + return new GoogleMap(element, options); } } @@ -502,7 +503,7 @@ export class GoogleMaps { * @private */ export interface AnimateCameraOptions { - target?: GoogleMapsLatLng | Array | GoogleMapsLatLngBounds; + target?: LatLng | Array | LatLngBounds; tilt?: number; zoom?: number; bearing?: number; @@ -513,7 +514,7 @@ export interface AnimateCameraOptions { * @private */ export interface CameraPosition { - target?: GoogleMapsLatLng | GoogleMapsLatLngBounds | GoogleMapsLatLng[]; + target?: LatLng | LatLngBounds | LatLng[]; zoom?: number; tilt?: number; bearing?: number; @@ -523,7 +524,7 @@ export interface CameraPosition { * @private */ export interface MyLocation { - latLng?: GoogleMapsLatLng; + latLng?: LatLng; speed?: number; time?: string; bearing?: number; @@ -547,7 +548,7 @@ export interface VisibleRegion { /** * @private */ -export interface GoogleMapsMarkerOptions { +export interface MarkerOptions { /** * The icon image url or properties. Also you can specify HTML Color values. Alternatively you can specify the image as Base64 */ @@ -566,7 +567,7 @@ export interface GoogleMapsMarkerOptions { /** * The position of the marker. */ - position?: GoogleMapsLatLng; + position?: LatLng; /** * Specify the anchor of the InfoWindow @@ -627,7 +628,7 @@ export interface GoogleMapsMarkerOptions { /** * @private */ -export interface GoogleMapsMarkerIcon { +export interface MarkerIcon { url?: string; size?: { width?: number; @@ -638,7 +639,7 @@ export interface GoogleMapsMarkerIcon { /** * @private */ -export class GoogleMapsMarker { +export class Marker { constructor(private _objectInstance: any) { } @@ -809,7 +810,7 @@ export class GoogleMapsMarker { * @param icon */ @CordovaInstance({ sync: true }) - setIcon(icon: GoogleMapsMarkerIcon): void { return; } + setIcon(icon: MarkerIcon): void { return; } /** * Change title of the infoWindow. @@ -872,21 +873,21 @@ export class GoogleMapsMarker { * @param latLng {GoogleMapLatLng} */ @CordovaInstance({ sync: true }) - setPosition(latLng: GoogleMapsLatLng): void { return; } + setPosition(latLng: LatLng): void { return; } /** * Return the marker position. * @return {Promise} */ @CordovaInstance() - getPosition(): Promise { return; } + getPosition(): Promise { return; } /** * Return the map instance. * @return {GoogleMap} */ @CordovaInstance({ sync: true }) - getMap(): GoogleMapsObject { return; } + getMap(): GoogleMap { return; } /** * Specify the animation either `DROP` or `BOUNCE` @@ -900,8 +901,8 @@ export class GoogleMapsMarker { /** * @private */ -export interface GoogleMapsCircleOptions { - center?: GoogleMapsLatLng; +export interface CircleOptions { + center?: LatLng; radius?: number; strokeColor?: string; strokeWidth?: number; @@ -914,7 +915,7 @@ export interface GoogleMapsCircleOptions { * @private */ -export class GoogleMapsCircle { +export class Circle { constructor(private _objectInstance: any) { } @@ -997,7 +998,7 @@ export class GoogleMapsCircle { empty(): void { } @CordovaInstance({ sync: true }) - getCenter(): GoogleMapsLatLng { return; } + getCenter(): LatLng { return; } @CordovaInstance({ sync: true }) getRadius(): number { return; } @@ -1015,7 +1016,7 @@ export class GoogleMapsCircle { remove(): void { } @CordovaInstance({ sync: true }) - setCenter(latLng: GoogleMapsLatLng): void { } + setCenter(latLng: LatLng): void { } @CordovaInstance({ sync: true }) setFillColor(fillColor: string): void { } @@ -1036,14 +1037,14 @@ export class GoogleMapsCircle { setRadius(radius: number): void { } @CordovaInstance({ sync: true }) - getMap(): GoogleMapsObject { return; } + getMap(): GoogleMap { return; } } /** * @private */ -export interface GoogleMapsPolylineOptions { - points?: Array; +export interface PolylineOptions { + points?: Array; visible?: boolean; geodesic?: boolean; color?: string; @@ -1055,7 +1056,7 @@ export interface GoogleMapsPolylineOptions { * @private */ -export class GoogleMapsPolyline { +export class Polyline { constructor(private _objectInstance: any) { } /** @@ -1137,7 +1138,7 @@ export class GoogleMapsPolyline { empty(): void { } @CordovaInstance({ sync: true }) - getPoints(): Array { return; } + getPoints(): Array { return; } @CordovaInstance({ sync: true }) getCOlor(): string { return; } @@ -1155,7 +1156,7 @@ export class GoogleMapsPolyline { remove(): void { } @CordovaInstance({ sync: true }) - setPoints(points: Array): void { } + setPoints(points: Array): void { } @CordovaInstance({ sync: true }) setColor(color: string): void { } @@ -1173,29 +1174,29 @@ export class GoogleMapsPolyline { setGeoDesic(geoDesic: boolean): void { } @CordovaInstance({ sync: true }) - getMap(): GoogleMapsObject { return; } + getMap(): GoogleMap { return; } } /** * @private */ -export interface GoogleMapsPolygonOptions { - points?: Array; +export interface PolygonOptions { + points?: Array; geodesic?: boolean; strokeColor?: string; strokeWidth?: number; fillColor?: string; visible?: boolean; zIndex?: number; - addHole?: Array; + addHole?: Array; } /** * @private */ -export class GoogleMapsPolygon { +export class Polygon { constructor(private _objectInstance: any) { } @@ -1278,7 +1279,7 @@ export class GoogleMapsPolygon { empty(): void { } @CordovaInstance({ sync: true }) - getPoints(): Array { return; } + getPoints(): Array { return; } @CordovaInstance({ sync: true }) getStrokeColor(): string { return; } @@ -1302,7 +1303,7 @@ export class GoogleMapsPolygon { remove(): void { } @CordovaInstance({ sync: true }) - setPoints(points: Array): void { } + setPoints(points: Array): void { } @CordovaInstance({ sync: true }) setStrokeColor(strokeColor: string): void { } @@ -1326,7 +1327,7 @@ export class GoogleMapsPolygon { /** * @private */ -export interface GoogleMapsTileOverlayOptions { +export interface TileOverlayOptions { tileUrlFormat?: string; visible?: boolean; zIndex?: number; @@ -1337,7 +1338,7 @@ export interface GoogleMapsTileOverlayOptions { /** * @private */ -export class GoogleMapsTileOverlay { +export class TileOverlay { constructor(private _objectInstance: any) { } @@ -1454,9 +1455,9 @@ export class GoogleMapsTileOverlay { /** * @private */ -export interface GoogleMapsGroundOverlayOptions { +export interface GroundOverlayOptions { url?: string; - bounds?: Array; + bounds?: Array; visible?: boolean; opacity?: number; bearing?: number; @@ -1466,7 +1467,7 @@ export interface GoogleMapsGroundOverlayOptions { /** * @private */ -export class GoogleMapsGroundOverlay { +export class GroundOverlay { constructor(private _objectInstance: any) { } @@ -1577,7 +1578,7 @@ export class GoogleMapsGroundOverlay { /** * @private */ -export interface GoogleMapsKmlOverlayOptions { +export interface KmlOverlayOptions { url?: string; preserveViewport?: boolean; animation?: boolean; @@ -1586,7 +1587,7 @@ export interface GoogleMapsKmlOverlayOptions { /** * @private */ -export class GoogleMapsKmlOverlay { +export class KmlOverlay { constructor(private _objectInstance: any) { } @@ -1672,20 +1673,20 @@ export class GoogleMapsKmlOverlay { remove(): void { } @CordovaInstance({ sync: true }) - getOverlays(): Array { return; } + getOverlays(): Array { return; } } /** * @private */ -export class GoogleMapsLatLngBounds { +export class LatLngBounds { private _objectInstance: any; - @InstanceProperty northeast: GoogleMapsLatLng; - @InstanceProperty southwest: GoogleMapsLatLng; + @InstanceProperty northeast: LatLng; + @InstanceProperty southwest: LatLng; @InstanceProperty type: string; - constructor(southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], northeast?: GoogleMapsLatLng) { + constructor(southwestOrArrayOfLatLng: LatLng | LatLng[], northeast?: LatLng) { let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng; this._objectInstance = new plugin.google.maps.LatLngBounds(args); } @@ -1697,20 +1698,20 @@ export class GoogleMapsLatLngBounds { toUrlValue(precision?: number): string { return; } @CordovaInstance({ sync: true }) - extend(LatLng: GoogleMapsLatLng): void { } + extend(LatLng: LatLng): void { } @CordovaInstance({ sync: true }) - contains(LatLng: GoogleMapsLatLng): boolean { return; } + contains(LatLng: LatLng): boolean { return; } @CordovaInstance({ sync: true }) - getCenter(): GoogleMapsLatLng { return; } + getCenter(): LatLng { return; } } /** * @private */ -export class GoogleMapsLatLng { +export class LatLng { lat: number; lng: number; @@ -1720,7 +1721,7 @@ export class GoogleMapsLatLng { this.lng = lng; } - equals(other: GoogleMapsLatLng): boolean { + equals(other: LatLng): boolean { return this.lat === other.lat && this.lng === other.lng; } @@ -1739,7 +1740,7 @@ export class GoogleMapsLatLng { */ export interface GeocoderRequest { address?: string; - bounds?: GoogleMapsLatLng[]; + bounds?: LatLng[]; position?: { lat: number; lng: number }; } /** diff --git a/test/plugins/googlemap.spec.ts b/test/plugins/googlemap.spec.ts index 1718743eb..3f89d15cf 100644 --- a/test/plugins/googlemap.spec.ts +++ b/test/plugins/googlemap.spec.ts @@ -20,7 +20,7 @@ window.plugin = { } }; -describe('GoogleMapsLatLngBounds', () => { +describe('LatLngBounds', () => { const southwest = new GoogleMapsLatLng(1,1); const northeast = new GoogleMapsLatLng(4,4);