UNPKG

universal-geocoder

Version:

Universal geocoding abstraction server-side and client-side with multiple built-in providers

45 lines 2.57 kB
import { ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; import { ErrorCallback, GeocodedResultsCallback, GeoPluginGeocoded, ProviderInterface, ProviderOptionsInterface } from "./.."; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../../query"; export interface GeoPluginResult { geoplugin_request: string; geoplugin_status: number; geoplugin_delay: string; geoplugin_credit: string; geoplugin_city: string; geoplugin_region: string; geoplugin_regionCode: string; geoplugin_regionName: string; geoplugin_areaCode: string; geoplugin_dmaCode: string; geoplugin_countryCode: string; geoplugin_countryName: string; geoplugin_inEU: boolean; geoplugin_euVATrate: number; geoplugin_continentCode: string; geoplugin_continentName: string; geoplugin_latitude: string; geoplugin_longitude: string; geoplugin_locationAccuracyRadius: string; geoplugin_timezone: string; geoplugin_currencyCode: string; geoplugin_currencySymbol: string; geoplugin_currencySymbol_UTF8: string; geoplugin_currencyConverter: string; } declare type GeoPluginGeocodedResultsCallback = GeocodedResultsCallback<GeoPluginGeocoded>; export default class GeoPluginProvider implements ProviderInterface<GeoPluginGeocoded> { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); geocode(query: string | GeocodeQuery | GeocodeQueryObject): Promise<GeoPluginGeocoded[]>; geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeoPluginGeocodedResultsCallback, errorCallback?: ErrorCallback): void; geodecode(query: ReverseQuery | ReverseQueryObject): Promise<GeoPluginGeocoded[]>; geodecode(query: ReverseQuery | ReverseQueryObject, callback: GeoPluginGeocodedResultsCallback, errorCallback?: ErrorCallback): void; geodecode(latitude: number | string, longitude: number | string): Promise<GeoPluginGeocoded[]>; geodecode(latitude: number | string, longitude: number | string, callback: GeoPluginGeocodedResultsCallback, errorCallback?: ErrorCallback): void; executeRequest(params: ExternalLoaderParams, callback: GeoPluginGeocodedResultsCallback, headers?: ExternalLoaderHeaders, body?: ExternalLoaderBody, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: GeoPluginResult): GeoPluginGeocoded; } export {}; //# sourceMappingURL=GeoPluginProvider.d.ts.map