UNPKG

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