export declare type Getter = { (atom: Atom>): Value; (atom: Atom>): Value; (atom: Atom): Value; }; export declare type Setter = { (atom: WritableAtom): void; (atom: WritableAtom, update: Update): void; }; declare type Read = (get: Getter) => Value | Promise; declare type Write = (get: Getter, set: Setter, update: Update) => void | Promise; declare type WithInitialValue = { init: Value; }; export declare type Scope = symbol | string | number; export declare type SetAtom = undefined extends Update ? (update?: Update) => void | Promise : (update: Update) => void | Promise; declare type OnUnmount = () => void; declare type OnMount = >(setAtom: S) => OnUnmount | void; export declare type Atom = { toString: () => string; debugLabel?: string; scope?: Scope; read: Read; }; export declare type WritableAtom = Atom & { write: Write; onMount?: OnMount; }; declare type SetStateAction = Value | ((prev: Value) => Value); export declare type PrimitiveAtom = WritableAtom>; export declare function atom(read: Read, write: Write): WritableAtom; export declare function atom(initialValue: Value, write: Write): [Value] extends [Function] ? never : WritableAtom & WithInitialValue; export declare function atom(read: Read): Atom; export declare function atom(initialValue: Value): [Value] extends [Function] ? never : PrimitiveAtom & WithInitialValue; export {};