UNPKG

universal-geocoder

Version:

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

54 lines 4.01 kB
import { BingProvider, BingProviderOptionsInterface, ChainProvider, ChainProviderOptionsInterface, GeoPluginProvider, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, LocationIQProvider, LocationIQProviderOptionsInterface, MapboxProvider, MapboxProviderOptionsInterface, MapQuestProvider, MapQuestProviderOptionsInterface, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, OpenCageProviderOptionsInterface, ProviderInterface, YandexProvider, YandexProviderOptionsInterface } from "./provider"; import Geocoded from "./Geocoded"; export declare type ProviderName = "chain" | "bing" | "bingmaps" | "microsoft" | "geoplugin" | "google" | "googlemaps" | "locationiq" | "mapbox" | "mapquest" | "nominatim" | "openstreetmap" | "opencage" | "yandex"; export interface ProviderOptionInterface { provider: string; } export interface RestrictedProviderOptionInterface { provider: ProviderName; } export interface ChainGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, ChainProviderOptionsInterface { provider: "chain"; } export interface BingGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, BingProviderOptionsInterface { provider: "bing" | "bingmaps" | "microsoft"; } export interface GeoPluginGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface { provider: "geoplugin"; } export interface GoogleMapsGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, GoogleMapsProviderOptionsInterface { provider: "google" | "googlemaps"; } export interface LocationIQGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, LocationIQProviderOptionsInterface { provider: "locationiq"; } export interface MapboxGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, MapboxProviderOptionsInterface { provider: "mapbox"; } export interface MapQuestGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, MapQuestProviderOptionsInterface { provider: "mapquest"; } export interface NominatimGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, NominatimProviderOptionsInterface { provider: "nominatim" | "openstreetmap"; } export interface OpenCageGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, OpenCageProviderOptionsInterface { provider: "opencage"; } export interface YandexGeocoderProviderFactoryOptions extends RestrictedProviderOptionInterface, YandexProviderOptionsInterface { provider: "yandex"; } export default class ProviderFactory { static createProvider(options: "chain" | ChainGeocoderProviderFactoryOptions): ChainProvider; static createProvider(options: "bing" | "bingmaps" | "microsoft" | BingGeocoderProviderFactoryOptions): BingProvider; static createProvider(options: "geoplugin" | GeoPluginGeocoderProviderFactoryOptions): GeoPluginProvider; static createProvider(options: "google" | "googlemaps" | GoogleMapsGeocoderProviderFactoryOptions): GoogleMapsProvider; static createProvider(options: "locationiq" | LocationIQGeocoderProviderFactoryOptions): LocationIQProvider; static createProvider(options: "mapbox" | MapboxGeocoderProviderFactoryOptions): MapboxProvider; static createProvider(options: "mapquest" | MapQuestGeocoderProviderFactoryOptions): MapQuestProvider; static createProvider(options: "nominatim" | "openstreetmap" | NominatimGeocoderProviderFactoryOptions): NominatimProvider; static createProvider(options: "opencage" | OpenCageGeocoderProviderFactoryOptions): OpenCageProvider; static createProvider(options: "yandex" | YandexGeocoderProviderFactoryOptions): YandexProvider; static createProvider<O extends RestrictedProviderOptionInterface>(options: ProviderName | O): ProviderInterface<Geocoded>; static createProvider<O extends ProviderOptionInterface>(options: string | O): ProviderInterface<Geocoded> | undefined; } //# sourceMappingURL=GeocoderProviderFactory.d.ts.map