import type { WritableAtom } from 'jotai/vanilla'; import { RESET } from './constants'; type Unsubscribe = () => void; type SetStateActionWithReset = Value | typeof RESET | ((prev: Value) => Value | typeof RESET); export interface AsyncStorage { getItem: (key: string, initialValue: Value) => PromiseLike; setItem: (key: string, newValue: Value) => PromiseLike; removeItem: (key: string) => PromiseLike; subscribe?: (key: string, callback: (value: Value) => void, initialValue: Value) => Unsubscribe; } export interface SyncStorage { getItem: (key: string, initialValue: Value) => Value; setItem: (key: string, newValue: Value) => void; removeItem: (key: string) => void; subscribe?: (key: string, callback: (value: Value) => void, initialValue: Value) => Unsubscribe; } export interface AsyncStringStorage { getItem: (key: string) => PromiseLike; setItem: (key: string, newValue: string) => PromiseLike; removeItem: (key: string) => PromiseLike; } 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: AsyncStorage, unstable_options?: { unstable_getOnInit?: boolean; }): WritableAtom, [ SetStateActionWithReset> ], Promise>; export declare function atomWithStorage(key: string, initialValue: Value, storage?: SyncStorage, unstable_options?: { unstable_getOnInit?: boolean; }): WritableAtom], void>; export {};