1 | import { WritableAtom } from 'jotai';
|
2 | import type { NonPromise, NonFunction, SetStateAction, PrimitiveAtom } from './types';
|
3 | export declare const useUpdateAtom: <Value, Update>(anAtom: WritableAtom<Value, Update>) => [Update] extends [never] ? () => void : (update: Update) => void;
|
4 | declare const RESET: unique symbol;
|
5 | export declare const atomWithReset: <Value>(initialValue: NonFunction<NonPromise<Value>>) => WritableAtom<Value, typeof RESET | NonFunction<Value> | ((prev: Value) => NonFunction<Value>)>;
|
6 | export declare const useResetAtom: <Value>(anAtom: WritableAtom<Value, typeof RESET>) => (update: unknown) => void;
|
7 | export declare const useReducerAtom: <Value, Action>(anAtom: WritableAtom<Value, SetStateAction<Value>>, reducer: (v: Value, a: Action) => NonFunction<Value>) => readonly [NonPromise<Value>, (action: Action) => void];
|
8 | export declare const atomWithReducer: <Value, Action>(initialValue: NonFunction<NonPromise<Value>>, reducer: (v: Value, a: Action) => Value) => WritableAtom<Value, Action>;
|
9 | export {};
|