/// type GoogleMapsLibraries = { core: google.maps.CoreLibrary; maps: google.maps.MapsLibrary; places: google.maps.PlacesLibrary; geocoding: google.maps.GeocodingLibrary; routes: google.maps.RoutesLibrary; marker: google.maps.MarkerLibrary; geometry: google.maps.GeometryLibrary; elevation: google.maps.ElevationLibrary; streetView: google.maps.StreetViewLibrary; journeySharing: google.maps.JourneySharingLibrary; drawing: google.maps.DrawingLibrary; visualization: google.maps.VisualizationLibrary; }; type GoogleMapsLibrary = keyof GoogleMapsLibraries; type GoogleMapsLoaderOptions = { /** * Your [API key](https://developers.google.com/maps/documentation/javascript/get-api-key) */ key: string; /** * @deprecated * @see https://developers.google.com/maps/premium/overview */ channel?: string; /** * @deprecated use {@link GoogleMapsLoaderOptions.apiKey apiKey} instead * @see https://developers.google.com/maps/premium/overview */ client?: string; /** * The [version](https://developers.google.com/maps/documentation/javascript/versions) of the Maps JavaScript API to use */ v?: string; /** * The [language](https://developers.google.com/maps/documentation/javascript/localization) to use. This affects the names of controls, copyright notices, driving directions, and control labels, as well as the responses to service requests. See the [list of supported languages](https://developers.google.com/maps/faq#languagesupport) */ language?: string; /** * The [region](https://developers.google.com/maps/documentation/javascript/localization#Region) code to use. This alters the map's behavior based on a given country or territory */ region?: string; /** * @deprecated Passing `map_ids` is no longer required in the script tag */ map_ids?: string[]; /** * Maps JS customers can configure HTTP Referrer Restrictions in the Cloud Console to limit which URLs are allowed to use a particular API Key. By default, these restrictions can be configured to allow only certain paths to use an API Key. If any URL on the same domain or origin may use the API Key, you can set `"origin"` to limit the amount of data sent when authorizing requests from the Maps JavaScript API. This is available starting in version **3.46**. When this parameter is specified and HTTP Referrer Restrictions are enabled on Cloud Console, Maps JavaScript API will only be able to load if there is an HTTP Referrer Restriction that matches the current website's domain without a path specified */ auth_referrer_policy?: 'origin'; }; type OmitMethods = { [key in keyof T]: T[key] extends (...args: any[]) => any ? never : T[key]; }; type ScriptOptions = Partial | 'src' | 'type'>>>; type GoogleMapsLoaderStatus = 'none' | 'loading' | 'loaded' | 'error'; type Identity = T; declare class GoogleMapsLoader { /** @returns current status of {@link google.maps} script loading */ static getStatus(): GoogleMapsLoaderStatus; /** @returns current status of a specific {@link library} loading */ static getStatus(library: GoogleMapsLibrary): GoogleMapsLoaderStatus; /** * @returns promise of {@link google.maps} script loading completion * * **Resolves** if {@link GoogleMapsLoader.load load} is successful * * **Rejects** * * - if {@link google.maps} was loaded outside of this library * - if no `options` were set * - if script loading failed */ static getCompletion(): Promise; /** * @returns promise of loading the provided {@link library} */ static getCompletion(library: L): Promise; /** * @returns promise of loading provided {@link libraries} */ static getCompletion(...libraries: A): Promise<{ [Index in keyof A]: GoogleMapsLibraries[A[Index]]; }>; /** * Can be called multiple times, only on the first call it starts loading {@link google.maps} script with the given `options` */ static load(): Promise; /** * loads {@link google.maps} script and a provided {@link library} */ static load(library: L): Promise; /** * loads {@link google.maps} script and provided {@link libraries} */ static load(...libraries: A): Promise<{ [Index in keyof A]: GoogleMapsLibraries[A[Index]]; }>; /** * @returns provided {@link library} or `undefined` if it's not loaded yet */ static get(library: L): GoogleMapsLibraries[L] | undefined; /** * @returns error for {@link google.maps} script or `undefined` */ static getError(): Error | undefined; /** * @returns error for the provided {@link library} or `undefined` */ static getError(library: GoogleMapsLibrary): Error | google.maps.MapsServerError | google.maps.MapsNetworkError | google.maps.MapsRequestError | undefined; } interface GoogleMapsLoader extends Identity { /** * Sets options for the {@link GoogleMapsLoader} * @param options - options for {@link google.maps} script loading * @param scriptOptions - options for script element * @param callbackName - name for callback, which will be called when {@link google.maps} script loading ends, defaults to `"__gmlcb"` */ (options: GoogleMapsLoaderOptions, scriptOptions?: ScriptOptions, callbackName?: string): GoogleMapsLoader; } declare const googleMapsLoader: GoogleMapsLoader; export { type GoogleMapsLibraries, type GoogleMapsLibrary, googleMapsLoader as GoogleMapsLoader, type GoogleMapsLoaderOptions, type GoogleMapsLoaderStatus, type ScriptOptions };