import type { HistoirePresetAction, HistoirePresetList } from '@histoire/protocol'; /** Compatible serializable preferences stay inside first-party story runtime. */ export interface RuntimePresetStorageSnapshot { /** Opaque IDs accompany cleaned state only in local storage adapter. */ items: { id: string; label: string; value: Record; }[]; /** Explicit legacy selection; missing value preserves initial state. */ selectedId?: string; } /** Standalone injects storage; embedded presets remain memory-only. */ export interface RuntimePresetPersistence { /** Loads compatible legacy entries without mutating runtime state. */ load: () => RuntimePresetStorageSnapshot; /** Persists cleaned values; denied storage must remain non-fatal. */ save: (snapshot: RuntimePresetStorageSnapshot) => void; } /** Presets live in selected runtime document; only opaque IDs and labels leave it. */ export declare function createRuntimeStatePresets(getState: () => Record, serialize: (value: any) => Record, persistence?: RuntimePresetPersistence, resetSelected?: () => void): { /** Called after initial reset snapshot capture, once before readiness publication. */ restoreSelected(): void; /** Reset updates preference without deleting compatible saved presets. */ clearSelection(): void; /** Finite UI actions never transfer values/callbacks or execute arbitrary code. */ execute(input: HistoirePresetAction): HistoirePresetList; };