1 | import type { Atom, ExtractAtomArgs, ExtractAtomResult, ExtractAtomValue, WritableAtom } from 'jotai/vanilla';
|
2 | import { useAtomValue } from './useAtomValue';
|
3 | type SetAtom<Args extends any[], Result> = (...args: Args) => Result;
|
4 | type Options = Parameters<typeof useAtomValue>[1];
|
5 | export declare function useAtom<Value, Args extends any[], Result>(atom: WritableAtom<Value, Args, Result>, options?: Options): [Awaited<Value>, SetAtom<Args, Result>];
|
6 | export declare function useAtom<Value>(atom: Atom<Value>, options?: Options): [Awaited<Value>, never];
|
7 | export declare function useAtom<AtomType extends WritableAtom<any, any[], any>>(atom: AtomType, options?: Options): [
|
8 | Awaited<ExtractAtomValue<AtomType>>,
|
9 | SetAtom<ExtractAtomArgs<AtomType>, ExtractAtomResult<AtomType>>
|
10 | ];
|
11 | export declare function useAtom<AtomType extends Atom<any>>(atom: AtomType, options?: Options): [Awaited<ExtractAtomValue<AtomType>>, never];
|
12 | export {};
|