import type { InjectionKey, Ref, ShallowRef } from 'vue'; export declare const MAP_INJECTION_KEY: InjectionKey<{ map: ShallowRef; mapsApi: Ref; /** Close the previously active InfoWindow and register a new one as active */ activateInfoWindow: (iw: google.maps.InfoWindow) => void; }>; export declare const MARKER_INJECTION_KEY: InjectionKey<{ advancedMarkerElement: ShallowRef; }>; /** * Bind Google Maps event listeners that forward to Vue emit. * * Two categories: * - `noPayload`: emits with no arguments (state-change events like `position_changed`) * - `withPayload`: forwards the first argument from the listener (mouse events, etc.) */ export declare function bindGoogleMapsEvents(instance: { addListener: (event: string, handler: (...args: any[]) => void) => void; }, emit: (...args: any[]) => void, config: { noPayload?: readonly string[]; withPayload?: readonly string[]; }): void; export interface GoogleMapsResourceContext { map: google.maps.Map; mapsApi: typeof google.maps; } /** * Normalizes a `LatLng | LatLngLiteral` value into a plain `LatLngLiteral`. * * Google's `LatLng` exposes coordinates via `.lat()`/`.lng()` methods, while * `LatLngLiteral` exposes them as plain `lat`/`lng` numeric properties. The * runtime distinguishes them by checking whether `.lat` is callable; this is * preferred over `instanceof google.maps.LatLng` because mocked APIs in tests * return plain objects rather than real `LatLng` instances. */ export declare function normalizeLatLng(p: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.LatLngLiteral; /** * Defines a deprecated property alias on an exposed object. Reading the alias * returns the value of the canonical key and emits a one-shot * `console.warn` (so repeated reads don't spam the console). * * Used to provide backward-compatible renames on `defineExpose` payloads * without breaking existing template-ref consumers. Call sites should wrap * this in `if (import.meta.dev)` so production builds skip the getter * entirely and the alias stays a plain data property. */ export declare function defineDeprecatedAlias(target: T, alias: string, canonicalKey: K, message: string): T; /** * Emits dev-mode deprecation warnings for the legacy top-level `center` and * `zoom` props on ``. Both props still work, but new code * should pass them via `mapOptions` instead. * * Returns the number of warnings emitted (useful for tests). */ export declare function warnDeprecatedTopLevelMapProps(props: { center?: unknown; zoom?: unknown; }): number; /** * Wait until the Google Maps API and a Map instance are both available. * * Triggers script loading via `load()` if not already loaded. Uses an * immediate watcher (matching `importLibrary`'s pattern) to avoid the race * where `load()` resolves synchronously: a non-immediate watcher would miss * the change and the promise would hang forever. * * Rejects if `status` enters an `'error'` state before both refs are populated. * Runs the watcher inside a detached effect scope so it is safe to call from * any context (component setup, exposed methods, tests). */ export declare function waitForMapsReady({ mapsApi, map, status, load, }: { mapsApi: ShallowRef; map: ShallowRef; status: Ref; load: () => Promise | unknown; }): Promise; /** * Composable for safely managing Google Maps resource lifecycle. * * Handles the common pattern: wait for map readiness → async create → cleanup on unmount. * * Safety guarantees: * - No watchers created after `await` (prevents orphaned watchers that leak memory) * - Unmount guard prevents resource creation after component unmount * - Resources created during the async gap are immediately cleaned up * - Resource ref is always nulled on unmount to allow GC */ export declare function useGoogleMapsResource({ ready, create, cleanup, }: { /** Additional readiness condition beyond map + mapsApi being available */ ready?: () => boolean; /** Create the Google Maps resource. Receives map context snapshot. May be async. */ create: (ctx: GoogleMapsResourceContext) => Promise | T; /** Clean up the resource. Called on unmount, or immediately if resource was created after unmount. */ cleanup?: (resource: T, ctx: { mapsApi: typeof google.maps; }) => void; }): ShallowRef;