UNPKG

433 BTypeScriptView Raw
1import type { Atom, Scope, SetAtom, WritableAtom } from './atom';
2declare type Awaited<T> = T extends Promise<infer V> ? Awaited<V> : T;
3export declare function useAtom<Value, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value, Update, Result>, scope?: Scope): [Awaited<Value>, SetAtom<Update, Result>];
4export declare function useAtom<Value>(atom: Atom<Value>, scope?: Scope): [Awaited<Value>, never];
5export {};