import type { WritableAtom } from 'jotai/vanilla'; import { RESET } from './constants'; export declare const NO_STORAGE_VALUE: unique symbol; type Unsubscribe = () => void; type SetStateActionWithReset = Value | typeof RESET | ((prev: Value) => Value | typeof RESET); export interface AsyncStorage { getItem: (key: string) => Promise; setItem: (key: string, newValue: Value) => Promise; removeItem: (key: string) => Promise; subscribe?: (key: string, callback: (value: Value) => void) => Unsubscribe; } export interface SyncStorage { getItem: (key: string) => Value | typeof NO_STORAGE_VALUE; setItem: (key: string, newValue: Value) => void; removeItem: (key: string) => void; subscribe?: (key: string, callback: (value: Value) => void) => Unsubscribe; } export interface AsyncStringStorage { getItem: (key: string) => Promise; setItem: (key: string, newValue: string) => Promise; removeItem: (key: string) => Promise; } export interface SyncStringStorage { getItem: (key: string) => string | null; setItem: (key: string, newValue: string) => void; removeItem: (key: string) => void; } export declare function createJSONStorage(getStringStorage: () => AsyncStringStorage): AsyncStorage; export declare function createJSONStorage(getStringStorage: () => SyncStringStorage): SyncStorage; export declare function atomWithStorage(key: string, initialValue: Value, storage?: SyncStorage | AsyncStorage): WritableAtom], void>; export {};