import type { AdapterConfig } from "@trackunit/react-map-adapter-shared"; import { type ComponentType } from "react"; import type { MapComponentProps, MapType } from "./types"; /** * Options for the preview map */ type UsePreviewMapOptions = Readonly<{ /** Map type to set once the map is ready (e.g., "satellite" for satellite previews) */ mapType?: MapType; }>; /** * Return value of the `usePreviewMap` hook. * * Provides `Map` (a stable, memoised component reference) and `ready` * to indicate whether the adapter instance has finished initializing. */ export type UsePreviewMapReturn = Readonly<{ /** Stable Map component reference — safe to render without triggering the static-components lint rule */ Map: ComponentType; /** Whether the preview adapter instance reports `isReady` */ ready: boolean; }>; /** * Creates a lightweight, non-interactive sibling map from a derived AdapterConfig. * * Returns a stable `Map` component reference and a `ready` flag. * Use this to spawn preview maps for map style settings. * * The preview map optionally sets a mapType after the adapter connects, * which is needed for satellite/hybrid previews where the base layer * differs from the default. * * @param adapterConfig - Adapter config (typically from `api.adapterConfig.derive(overrides)`) * @param options - Optional settings like mapType * @returns Object with a stable `Map` component and a `ready` boolean * @example * ```tsx * const { Map: PreviewMap } = usePreviewMap(api.adapterConfig.derive({ theme: "dark" })); * return ; * ``` */ export declare const usePreviewMap: (adapterConfig: AdapterConfig, options?: UsePreviewMapOptions) => UsePreviewMapReturn; export {};