travels
    Preparing search index...

    Interface ManualTravelsControls<S, P>

    interface ManualTravelsControls<S, P extends PatchesOption = {}> {
        archive: (metadata?: TravelMetadata) => void;
        back: (amount?: number) => void;
        canArchive: () => boolean;
        canBack: () => boolean;
        canForward: () => boolean;
        forward: (amount?: number) => void;
        getHistory: () => readonly Immutable<S>[];
        getHistorySnapshot: () => S[];
        go: (position: number) => void;
        patches: ReadonlyTravelPatches<P>;
        position: number;
        reset: () => void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    archive: (metadata?: TravelMetadata) => void

    Archive the current state

    back: (amount?: number) => void

    Go back in the history

    canArchive: () => boolean

    Check if it's possible to archive the current state

    canBack: () => boolean

    Check if it's possible to go back

    canForward: () => boolean

    Check if it's possible to go forward

    forward: (amount?: number) => void

    Go forward in the history

    getHistory: () => readonly Immutable<S>[]

    Get the shared history cache.

    The returned array is Travels' shared internal cache. Use getHistorySnapshot when you need an array you can keep or change.

    getHistorySnapshot: () => S[]

    Get fully detached history snapshots that the caller owns.

    go: (position: number) => void

    Go to a specific position in the history

    Shared read-only view of the retained patch history.

    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.

    position: number

    The current position in the history

    reset: () => void

    Reset the history