UNPKG

535 BTypeScriptView Raw
1import type { Atom } from './atom';
2import { getScopeContext } from './contexts';
3import type { 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 {};