import type { AdapterConfig } from "@trackunit/react-map-adapter-shared"; import type { ContainerRefHolder, MapActions, MapStatus } from "../core/types"; import type { BuiltInControlsConfig } from "./types"; /** * Options for `useDefaultControls`. * Each control can be individually disabled. Omitting the options object (or any * sub-key) means all controls are enabled. */ export type UseDefaultControlsOptions = Readonly<{ navigation?: Readonly<{ zoom?: Readonly<{ enabled?: boolean; }>; fullscreen?: Readonly<{ enabled?: boolean; }>; myLocation?: Readonly<{ enabled?: boolean; }>; }>; settings?: Readonly<{ mapStyle?: Readonly<{ enabled?: boolean; }>; }>; }>; /** * Minimal slice of `MapApi` consumed by `useDefaultControls`. * Using a structural sub-type avoids a direct dependency on the full MapApi. */ type DefaultControlsApi = Readonly<{ state: MapStatus; actions: MapActions; adapterConfig: AdapterConfig; containerRef: ContainerRefHolder; }>; /** * Builds the default built-in controls configuration (zoom, fullscreen, my * location, map style) from the map API. * * Replaces `useControlsConfig` with a cleaner, flat options structure. Each * control can be disabled individually via `options`. Omitting `options` * enables all controls. * * Returns a `BuiltInControlsConfig` — a `ControlsConfig` enriched with named * handles for each built-in control so consumers can reference them without * searching by id. * * @example * ```tsx * const builtIn = useDefaultControls(api); * return ; * ``` * @example Disable specific controls * ```tsx * const builtIn = useDefaultControls(api, { * navigation: { myLocation: { enabled: false } }, * }); * ``` */ export declare const useDefaultControls: (api: DefaultControlsApi, options?: UseDefaultControlsOptions) => BuiltInControlsConfig; export {};