import { type AppColorName } from './color-presets';
import type { ThemeMode } from './types';
/**
 * Storage adapter for persisting Bloom theme state.
 *
 * Methods may be synchronous or asynchronous. The provider awaits both, so
 * `AsyncStorage`-compatible adapters on native and `localStorage`-backed
 * adapters on web both work without consumer-side branching.
 *
 * On web, a synchronous adapter lets Bloom hydrate before the first paint —
 * preventing a flash of the default palette. On native, the provider can
 * gate `children` rendering until hydration completes (see
 * `awaitHydration` on `BloomThemeProvider`).
 */
export interface BloomThemeStorage {
    getItem(key: string): string | null | Promise<string | null>;
    setItem(key: string, value: string): void | Promise<void>;
    removeItem?(key: string): void | Promise<void>;
}
export interface PersistedThemeState {
    mode?: ThemeMode;
    colorPreset?: AppColorName;
}
export type SyncReadResult = {
    kind: 'sync';
    state: PersistedThemeState | null;
} | {
    kind: 'async';
} | {
    kind: 'none';
};
/**
 * Read persisted state during the first render. Returns a discriminated union
 * so the provider can tell apart:
 *   - `none`: persistence not configured.
 *   - `sync`: adapter returned a value synchronously (web `localStorage`).
 *     Provider can render immediately with the resolved state.
 *   - `async`: adapter returned a Promise (native `AsyncStorage`). Provider
 *     must await `readPersistedTheme` before painting if gating is enabled.
 */
export declare function readPersistedThemeSync(persistKey: string | undefined, storage: BloomThemeStorage | undefined): SyncReadResult;
export declare function readPersistedTheme(persistKey: string | undefined, storage: BloomThemeStorage | undefined): Promise<PersistedThemeState | null>;
export declare function writePersistedTheme(persistKey: string | undefined, storage: BloomThemeStorage | undefined, state: PersistedThemeState): Promise<void>;
export declare function removePersistedTheme(persistKey: string | undefined, storage: BloomThemeStorage | undefined): Promise<void>;
/**
 * `localStorage`-backed storage adapter. Only defined on web; on native the
 * export is `undefined` so consumers pass an `AsyncStorage` adapter explicitly.
 */
export declare const webLocalStorage: BloomThemeStorage | undefined;
//# sourceMappingURL=persistence.d.ts.map