UNPKG

594 BTypeScriptView Raw
1import { Atom } from './atom';
2import { getScopeContext } from './contexts';
3import { ExtractAtomValue } from './typeUtils';
4type Scope = NonNullable<Parameters<typeof getScopeContext>[0]>;
5export declare function useAtomValue<Value>(atom: Atom<Promise<Value>>, scope?: Scope): Value;
6export declare function useAtomValue<Value>(atom: Atom<Value>, scope?: Scope): Awaited<Value>;
7export declare function useAtomValue<AtomType extends Atom<any>>(atom: AtomType, scope?: Scope): Awaited<ExtractAtomValue<AtomType>>;
8export {};
9declare type Awaited<T> = T extends Promise<infer V> ? V : T;
\No newline at end of file