import { StoreApi, StateCreator, StoreMutatorIdentifier } from 'zustand'; type onSave = ((pastState: TState, currentState: TState) => void) | undefined; interface _TemporalState { pastStates: Partial[]; futureStates: Partial[]; undo: (steps?: number) => void; redo: (steps?: number) => void; clear: () => void; isTracking: boolean; pause: () => void; resume: () => void; setOnSave: (onSave: onSave) => void; _onSave: onSave; _handleSet: (pastState: TState, replace: Parameters['setState']>[1], currentState: TState, deltaState?: Partial | null) => void; } interface ZundoOptions { partialize?: (state: TState) => PartialTState; limit?: number; equality?: (pastState: PartialTState, currentState: PartialTState) => boolean; diff?: (pastState: Partial, currentState: Partial) => Partial | null; onSave?: onSave; handleSet?: (handleSet: StoreApi['setState']) => (pastState: Parameters['setState']>[0], replace: Parameters['setState']>[1], currentState: PartialTState, deltaState?: Partial | null) => void; pastStates?: Partial[]; futureStates?: Partial[]; wrapTemporal?: (storeInitializer: StateCreator<_TemporalState, [ StoreMutatorIdentifier, unknown ][], [ ]>) => StateCreator<_TemporalState, [ StoreMutatorIdentifier, unknown ][], [ StoreMutatorIdentifier, unknown ][]>; } type Write = Omit & U; type TemporalState = Omit<_TemporalState, '_onSave' | '_handleSet'>; type Zundo = (config: StateCreator, options?: ZundoOptions) => StateCreator>], ...Mcs ]>; declare module 'zustand/vanilla' { interface StoreMutators { temporal: Write; } } declare const temporal: Zundo; export { type TemporalState, type Zundo, type ZundoOptions, temporal };