UNPKG

459 BTypeScriptView Raw
1import { 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): [
4 Awaited<Value>,
5 SetAtom<Update, Result>
6];
7export declare function useAtom<Value>(atom: Atom<Value>, scope?: Scope): [
8 Awaited<Value>,
9 never
10];
11export {};