import { ReactNode } from 'react'; export interface SpatialSelectionContextValue { /** ID of the currently selected object, or null if nothing is selected. */ selectedId: string | null; /** Set the selection (or clear with `null`). */ setSelectedId: (id: string | null) => void; /** Toggle selection: select the id if it isn't selected, clear otherwise. */ toggleSelection: (id: string) => void; /** Convenience: clear any current selection. */ clearSelection: () => void; } export interface SpatialSelectionProviderProps { children: ReactNode; /** Initial selected id. Default null (nothing selected). */ defaultSelectedId?: string | null; /** Controlled mode: when set, the provider mirrors this value instead * of owning state. Pair with `onSelectionChange`. */ selectedId?: string | null; /** Called whenever the selection changes (uncontrolled or controlled). */ onSelectionChange?: (id: string | null) => void; } export declare function SpatialSelectionProvider({ children, defaultSelectedId, selectedId: controlledId, onSelectionChange, }: SpatialSelectionProviderProps): import("react/jsx-runtime").JSX.Element; /** * Read the spatial-selection context. Returns `null` when used outside * a `` — components MUST handle that case so * they stay standalone-usable. Treat the provider as a progressive * enhancement, never a hard dependency. * * const ctx = useSpatialSelection(); * const selectedId = ctx?.selectedId ?? null; // safe outside provider * const onSelect = ctx?.setSelectedId ?? noop; // safe outside provider */ export declare function useSpatialSelection(): SpatialSelectionContextValue | null; /** * Strict variant — throws if used outside a provider. Useful in the * provider's own children when the dependency is intentional. */ export declare function useSpatialSelectionStrict(): SpatialSelectionContextValue; export default SpatialSelectionProvider;