UNPKG

995 BTypeScriptView Raw
1import { Getter, Setter, Atom, WritableAtom, PrimitiveAtom, NonPromise, NonFunction } from './types';
2export declare function atom<Value, Update>(read: (get: Getter) => NonPromise<Value>, write: (get: Getter, set: Setter, update: Update) => void | Promise<void>): WritableAtom<Value, Update>;
3export declare function atom<Value, Update>(read: NonFunction<NonPromise<Value>>, write: (get: Getter, set: Setter, update: Update) => void | Promise<void>): WritableAtom<Value, Update>;
4export declare function atom<Value, Update>(read: (get: Getter) => Promise<Value>, write: (get: Getter, set: Setter, update: Update) => void | Promise<void>): WritableAtom<Value | Promise<Value>, Update>;
5export declare function atom<Value>(read: (get: Getter) => NonPromise<Value>): Atom<Value>;
6export declare function atom<Value>(read: (get: Getter) => Promise<Value>): Atom<Value | Promise<Value>>;
7export declare function atom<Value>(initialValue: NonFunction<NonPromise<Value>>): PrimitiveAtom<Value>;