import { type ReactElement, type ReactNode } from 'react'; import type { MaskInput, PatchesFor } from '../kaleidoscope/types'; import type { KaleidoscopePresetBook } from '../kaleidoscope.preset-book.types'; import { type KaleidoscopeStateStore, type StoredPatch, type StoredPatches } from './state'; export type KaleidoscopeStateValue

= { /** False until the persisted selection has been read; apply no effects before then. */ readonly hydrated: boolean; /** The selected preset id, or null when nothing is selected. */ readonly presetId: (keyof P & string) | null; /** The shared segmentation edge. */ readonly mask: MaskInput; /** Every preset's stored per-layer overrides (keyed by preset id, then layer id). */ readonly patches: StoredPatches; readonly setPreset: (presetId: (keyof P & string) | null) => void; readonly setMask: (mask: MaskInput) => void; /** Record one control-panel patch against a preset (and persist it). */ readonly setPatch: (presetId: keyof P & string, patch: StoredPatch) => void; /** A preset's stored overrides in the array shape `kaleidoscope(id, patches)` takes. */ readonly patchesFor: (presetId: K) => PatchesFor; /** Clear the stored selection back to defaults (and persist the cleared state). */ readonly reset: () => void; }; export type KaleidoscopeStateProviderProps

= { /** The consumer's preset book; stored state is pruned against it at hydrate. */ readonly presets: P; /** The backing store. Defaults to the AsyncStorage store (lazily loaded). */ readonly store?: KaleidoscopeStateStore; /** The mask used before hydration and after `reset`. Defaults to 0.5/0.5. */ readonly defaultMask?: MaskInput; readonly children: ReactNode; }; export declare function KaleidoscopeStateProvider

({ presets, store, defaultMask, children, }: KaleidoscopeStateProviderProps

): ReactElement; /** * The persisted selection plus its setters. Typed by the consumer's book: * `useKaleidoscopeState()`. Throws outside the provider. */ export declare function useKaleidoscopeState

(): KaleidoscopeStateValue

; //# sourceMappingURL=provider.d.ts.map