import type { AdapterConfig } from "@trackunit/react-map-adapter-shared"; import { z } from "zod"; import { type MapActions, type MapStatus, type MapTheme, type MapType } from "../core/types"; /** * Increment this number to invalidate stored appearance settings in localStorage * and reset all users to defaults. */ export declare const APPEARANCE_SETTINGS_VERSION = 1; export declare const persistedAppearanceSchema: z.ZodObject<{ theme: z.ZodEnum<["light", "dark"]>; mapType: z.ZodEnum<["roadmap", "satellite", "hybrid"]>; showRoads: z.ZodBoolean; } & { version: z.ZodLiteral<1>; }, "strip", z.ZodTypeAny, { mapType: "roadmap" | "satellite" | "hybrid"; theme: "light" | "dark"; version: 1; showRoads: boolean; }, { mapType: "roadmap" | "satellite" | "hybrid"; theme: "light" | "dark"; version: 1; showRoads: boolean; }>; /** Appearance state persisted to localStorage (MapAppearance + migration version) */ export type PersistedAppearance = Readonly>; /** Default persisted appearance when nothing is stored */ export declare const DEFAULT_PERSISTED_APPEARANCE: PersistedAppearance; type SetThemeAction = Readonly<{ type: "setTheme"; payload: MapTheme; }>; type SetMapTypeAction = Readonly<{ type: "setMapType"; payload: MapType; }>; type SetShowRoadsAction = Readonly<{ type: "setShowRoads"; payload: boolean; }>; export type AppearanceAction = Readonly; /** Reducer for persisted appearance state */ export declare const appearanceReducer: (state: PersistedAppearance, action: AppearanceAction) => PersistedAppearance; /** Configuration for which appearance options to show in the settings panel */ export type AppearanceOptions = Readonly<{ /** Which themes to offer. Default: ["light", "dark"] */ themes?: ReadonlyArray; /** Which map types to offer. Default: ["roadmap", "satellite"] */ mapTypes?: ReadonlyArray; /** Whether to show the roads toggle when satellite/hybrid is selected. Default: true */ roads?: boolean; }>; /** * Narrowed API surface that useMapAppearanceControls actually needs. * Accepts the full MapApi (structural subtyping) but avoids * coupling the hook to fields it never touches. */ export type MapAppearanceApi = Readonly<{ state: MapStatus; actions: MapActions; adapterConfig: AdapterConfig; }>; /** Parameters for the useMapAppearanceControls hook */ export type UseMapAppearanceControlsParams = Readonly<{ /** The map API object from useMap (only state, actions, and adapterConfig are used) */ api: MapAppearanceApi; /** Optional: configure which appearance options to show */ options?: AppearanceOptions; /** Optional: localStorage persistence key. Default: "map-appearance-settings" */ persistenceKey?: string; }>; /** A single appearance option shown in the preview grid */ export type AppearanceOption = Readonly<{ /** Unique key for this option */ key: string; /** Display label (translated) */ label: string; /** Theme for this option */ theme: MapTheme; /** Map type for this option */ mapType: MapType; }>; export {};