mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 22:30:56 +00:00
17 lines
467 B
TypeScript
17 lines
467 B
TypeScript
export interface UseStateHistoryHandlers<T> {
|
|
set: (value: T) => void;
|
|
back: (steps?: number) => void;
|
|
forward: (steps?: number) => void;
|
|
reset: () => void;
|
|
}
|
|
export interface UseStateHistoryValue<T> {
|
|
history: T[];
|
|
current: number;
|
|
}
|
|
export type UseStateHistoryReturnValue<T> = [
|
|
T,
|
|
UseStateHistoryHandlers<T>,
|
|
UseStateHistoryValue<T>
|
|
];
|
|
export declare function useStateHistory<T>(initialValue: T): UseStateHistoryReturnValue<T>;
|