@sv-use/core
Version:
A collection of Svelte 5 utilities.
13 lines (12 loc) • 567 B
TypeScript
import { type TrackHistoryOptions, type TrackHistoryReturn } from '../track-history/index.svelte.js';
type HistoryStateOptions = TrackHistoryOptions;
type HistoryStateReturn<T> = TrackHistoryReturn<T> & {
current: T;
};
/**
* A reactive state that allows for undo and redo operations by tracking the change history.
* @param initial The initial value of the state.
* @see https://svelte-librarian.github.io/sv-use/docs/core/history-state
*/
export declare function historyState<T>(initial: T, options?: HistoryStateOptions): HistoryStateReturn<T>;
export {};