import type { SetStateAction, WritableAtom } from 'jotai'; import { RESET } from './constants'; declare type Unsubscribe = () => void; declare type AsyncStorage = { getItem: (key: string) => Promise; setItem: (key: string, newValue: Value) => Promise; removeItem: (key: string) => Promise; delayInit?: boolean; subscribe?: (key: string, callback: (value: Value) => void) => Unsubscribe; }; declare type SyncStorage = { getItem: (key: string) => Value; setItem: (key: string, newValue: Value) => void; removeItem: (key: string) => void; delayInit?: boolean; subscribe?: (key: string, callback: (value: Value) => void) => Unsubscribe; }; declare type AsyncStringStorage = { getItem: (key: string) => Promise; setItem: (key: string, newValue: string) => Promise; removeItem: (key: string) => Promise; }; declare type 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 & { delayInit: true; }): WritableAtom | typeof RESET, Promise>; export declare function atomWithStorage(key: string, initialValue: Value, storage: AsyncStorage): WritableAtom, SetStateAction | typeof RESET, Promise>; export declare function atomWithStorage(key: string, initialValue: Value, storage: SyncStorage): WritableAtom | typeof RESET>; export declare function atomWithStorage(key: string, initialValue: Value): WritableAtom | typeof RESET>; export declare function atomWithHash(key: string, initialValue: Value, options?: { serialize?: (val: Value) => string; deserialize?: (str: string) => Value; delayInit?: boolean; replaceState?: boolean; subscribe?: (callback: () => void) => () => void; }): WritableAtom | typeof RESET>; export {};