UNPKG

524 BTypeScriptView Raw
1import type { Atom, PrimitiveAtom, WritableAtom } from './atom';
2export declare type Getter = Parameters<Atom<unknown>['read']>[0];
3export declare type Setter = Parameters<WritableAtom<unknown, unknown>['write']>[1];
4export declare type ExtractAtomValue<AtomType> = AtomType extends Atom<infer Value> ? Value : never;
5export declare type ExtractAtomUpdate<AtomType> = AtomType extends WritableAtom<unknown, infer Update> ? Update : never;
6export declare type SetStateAction<Value> = ExtractAtomUpdate<PrimitiveAtom<Value>>;