UNPKG

674 BTypeScriptView Raw
1import { SetAtom, WritableAtom } from './atom';
2import { getScopeContext } from './contexts';
3import { ExtractAtomResult, ExtractAtomUpdate } from './typeUtils';
4type Scope = NonNullable<Parameters<typeof getScopeContext>[0]>;
5export declare function useSetAtom<Value, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value, Update, Result>, scope?: Scope): SetAtom<Update, Result>;
6export declare function useSetAtom<AtomType extends WritableAtom<any, any, void | Promise<void>>>(atom: AtomType, scope?: Scope): SetAtom<ExtractAtomUpdate<AtomType>, ExtractAtomResult<AtomType>>;
7export {};
8declare type Awaited<T> = T extends Promise<infer V> ? V : T;
\No newline at end of file