ManualTravelsControls<S, P>
Travels 3.0.1. Travels 3 API reference for ManualTravelsControls.
Defined in: src/type.ts:470
Extends
TravelsControls<S,P>
Type Parameters
S
S
P
P extends PatchesOption = { }
Properties
archive()
readonlyarchive: (metadata?) =>void
Defined in: src/type.ts:477
Archive the current state
Parameters
metadata?
Returns
void
back()
readonlyback: (amount?) =>void
Defined in: src/type.ts:432
Go back in the history
Parameters
amount?
number
Returns
void
Inherited from
canArchive()
readonlycanArchive: () =>boolean
Defined in: src/type.ts:481
Check if it's possible to archive the current state
Returns
boolean
canBack()
readonlycanBack: () =>boolean
Defined in: src/type.ts:448
Check if it's possible to go back
Returns
boolean
Inherited from
canForward()
readonlycanForward: () =>boolean
Defined in: src/type.ts:452
Check if it's possible to go forward
Returns
boolean
Inherited from
forward()
readonlyforward: (amount?) =>void
Defined in: src/type.ts:436
Go forward in the history
Parameters
amount?
number
Returns
void
Inherited from
getHistory()
readonlygetHistory: () => readonlyImmutable<S>[]
Defined in: src/type.ts:415
Get the shared history cache.
Returns
readonly Immutable<S>[]
Remarks
The returned array is Travels' shared internal cache. Use getHistorySnapshot when you need an array you can keep or change.
Inherited from
getHistorySnapshot()
readonlygetHistorySnapshot: () =>S[]
Defined in: src/type.ts:419
Get fully detached history snapshots that the caller owns.
Returns
S[]
Inherited from
TravelsControls.getHistorySnapshot
go()
readonlygo: (position) =>void
Defined in: src/type.ts:444
Go to a specific position in the history
Parameters
position
number
Returns
void
Inherited from
patches
readonlypatches:ReadonlyTravelPatches<P>
Defined in: src/type.ts:428
Shared read-only view of the retained patch history.
Remarks
The view is cached and keeps its reference until history changes, so it
is cheap to read during rendering. Use getPatches() on the timeline for
a detached, caller-owned copy.
Inherited from
position
readonlyposition:number
Defined in: src/type.ts:407
The current position in the history
Inherited from
reset()
readonlyreset: () =>void
Defined in: src/type.ts:440
Reset the history
Returns
void