exporttypeUseManualStateHistoryOptions<Raw, Serialized=Raw> = {/** * The capacity of the history records * * @defaultValue Number.POSITIVE_INFINITY */capacity?: number/** * Whether to clone the source state * * @defaultValue false */clone?: boolean | CloneFn<Raw>/** * The throttle options * * @defaultValue undefined */throttle?: number | UseThrottledFnOptions/** * The debounce options * * @defaultValue undefined */debounce?: number | UseDebouncedFnOptions/** * The dump function to serialize the source state * * @defaultValue (v) => v */dump?: (v: Raw) =>Serialized/** * The parse function to deserialize the serialized state * * @defaultValue (v) => v */parse?: (v: Serialized) =>Raw}
UseThrottledFnOptions is th options of useThrottledFn, see useThrottledFn.
UseDebouncedFnOptions is th options of useDebouncedFn, see useDebouncedFn.
exporttypeUseRefHistoryRecord<T> = {/** * The serialized snapshot */snapshot: T/** * The timestamp */timestamp: number}exporttypeUseManualStateHistoryReturns<Raw, Serialized> = {/** * The source state */source: Raw/** * The history records */history: UseRefHistoryRecord<Serialized>[]/** * The last history record */last: UseRefHistoryRecord<Serialized>/** * The undo stack */undoStack: UseRefHistoryRecord<Serialized>[]/** * The redo stack */redoStack: UseRefHistoryRecord<Serialized>[]/** * Whether can undo or redo */canUndo: boolean/** * Whether can redo or undo */canRedo: boolean/** * Undo the last change */undo(): void/** * Redo the last change */redo(): void/** * Clear all history records */clear(): void/** * Commit the current source state to history */commit(): void}