1 | export declare type NonPromise<T> = T extends Promise<unknown> ? never : T;
|
2 | export declare type NonFunction<T> = T extends Function ? never : T;
|
3 | export declare type SetStateAction<Value> = NonFunction<Value> | ((prev: Value) => NonFunction<Value>);
|
4 | export declare type Getter = <Value>(atom: Atom<Value>) => Value;
|
5 | export declare type Setter = <Value, Update>(atom: WritableAtom<Value, Update>, update: Update) => void;
|
6 | export declare type Atom<Value> = {
|
7 | key: string | number;
|
8 | init?: Value;
|
9 | read: (get: Getter) => Value | Promise<Value>;
|
10 | };
|
11 | export declare type WritableAtom<Value, Update> = Atom<Value> & {
|
12 | write: (get: Getter, set: Setter, update: Update) => void | Promise<void>;
|
13 | };
|
14 | export declare type PrimitiveAtom<Value> = WritableAtom<Value, SetStateAction<Value>>;
|
15 | export declare type AnyAtom = Atom<unknown>;
|
16 | export declare type AnyWritableAtom = WritableAtom<unknown, unknown>;
|