travels
    Preparing search index...

    Interface ManualTravelsControls<S, F, P>

    interface ManualTravelsControls<
        S,
        F extends boolean,
        P extends PatchesOption = {},
    > {
        archive: (metadata?: TravelMetadata) => void;
        back: (amount?: number) => void;
        canArchive: () => boolean;
        canBack: () => boolean;
        canForward: () => boolean;
        forward: (amount?: number) => void;
        getHistory: () => Value<S, F>[];
        getHistorySnapshot: () => Value<S, F>[];
        go: (position: number) => void;
        patches: TravelPatches<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: () => Value<S, F>[]

    Get the shared history cache.

    The returned array is Travels' internal cache and is frozen in development, so treat it and its entries as read-only even though the type does not say so. The signature stays mutable through the 2.x line because it is re-exported into downstream controls types; it becomes readonly in 3.0.0. Use getHistorySnapshot when you need an array you can keep or change.

    getHistorySnapshot: () => Value<S, F>[]

    Get fully detached durable history snapshots.

    go: (position: number) => void

    Go to a specific position in the history

    patches: TravelPatches<P>

    The patches of the history

    position: number

    The current position in the history

    reset: () => void

    Reset the history