UNPKG

geo-search-utils

Version:

A powerful TypeScript utility that enables you to use Google Maps features without requiring an API key! Extract location data, search addresses, and process Google Maps URLs - all without authentication. Supports multiple URL patterns, coordinate extract

43 lines (40 loc) 1.25 kB
interface LangTypes { lang?: "en" | "hi" | "bn" | "ta" | "te" | "mr" | "gu" | "kn" | "ml" | "zh-CN" | "zh-TW" | "ja" | "ko" | "de" | "fr" | "es" | "it" | "pt" | "ru" | "pl" | "vi" | "id" | "th" | "tr" | "ar" | "uk" | "af" | "ms" | "my" | "fil" | "sw" | "xh" | "zu" | "cy" | "string"; } interface NominatimResponse { place_id: number; lat: string; lon: string; type: string; place_rank: number; addresstype: string; name: string; display_name: string; } declare function getDataByUrl(url: string, lang?: LangTypes): Promise<string | { latitude: number; longitude: number; sourceUrl: string; address: { locality: string; city: string; postcode: string; plusCode: string; district: string; state: string; stateCode: string; countryName: string; countryCode: string; lookupSource: string; localityLanguageRequested: string; continent: string; continentCode: string; }; } | { error: string; } | null>; declare const searchAddress: (query: string) => Promise<NominatimResponse[] | { error: boolean; message: string; }>; export { type NominatimResponse, getDataByUrl, searchAddress };