Optionalmetadata: TravelMetadataAssert that state, retained patches, and metadata can round-trip through Travels' JSON persistence contract without normalization or data loss.
Go back in the history
Check if it's possible to archive the current state
Check if it's possible to go back
Check if it's possible to go forward
Go forward in the history
Get the controls object
Get the complete history of states
The history array. Reference equality indicates cache hit.
IMPORTANT: Treat the returned array and every state entry as read-only. They are cached internally.
Return fully detached durable snapshots for every visible history state.
Unlike getHistory(), this method never exposes the internal cache. It rejects runtime-only values rather than returning a partially shared clone.
Get the patches history
Get the current position in the history
Get the current state
Go to a specific position in the history
Remove all history and make the current state (including any unarchived temp patches) as the new initial state.
This is a destructive operation that discards all history and overwrites
the internal baseline. Future reset() calls will return to this snapshot.
Record a patch pair that an external authoritative state owner has already committed.
Reset to the initial state
Serialize the current state, patch history, and position for persistence.
Update the state
Optionalmetadata: TravelMetadataStaticdeserializeValidate and normalize a persisted Travels history snapshot.
Optionaloptions: TravelsDeserializeOptions<S, P>
Core Travels class for managing undo/redo history