UNPKG

626 BTypeScriptView Raw
1import type { ExtractAtomArgs, ExtractAtomResult, WritableAtom } from 'jotai/vanilla';
2import { useStore } from './Provider';
3type SetAtom<Args extends any[], Result> = (...args: Args) => Result;
4type Store = ReturnType<typeof useStore>;
5type Options = {
6 store?: Store;
7};
8export declare function useSetAtom<Value, Args extends any[], Result>(atom: WritableAtom<Value, Args, Result>, options?: Options): SetAtom<Args, Result>;
9export declare function useSetAtom<AtomType extends WritableAtom<any, any[], any>>(atom: AtomType, options?: Options): SetAtom<ExtractAtomArgs<AtomType>, ExtractAtomResult<AtomType>>;
10export {};