UNPKG

jotai-history

Version:
8 lines • 713 B
import type { Atom, ExtractAtomArgs, ExtractAtomResult, ExtractAtomValue, WritableAtom } from 'jotai/vanilla'; import { REDO, RESET, UNDO } from './actions'; import { History } from './withHistory'; import { type Indicators } from './withUndo'; type WithUndoableHistory<T extends Atom<unknown>> = T extends WritableAtom<any, any[], any> ? WritableAtom<History<ExtractAtomValue<T>> & Indicators, ExtractAtomArgs<T> | [RESET | UNDO | REDO], ExtractAtomResult<T> | void> : WritableAtom<History<ExtractAtomValue<T>>, [RESET], void>; export declare function withUndoableHistory<T extends Atom<unknown>>(targetAtom: T, limit: number): WithUndoableHistory<T>; export {}; //# sourceMappingURL=withUndoableHistory.d.ts.map