@resistdesign/voltra
    Preparing search index...

    Type Alias HistoryController

    Shared history controller interface.

    This is intentionally platform-agnostic. Web/native adapters can translate platform events into calls on this interface.

    type HistoryController = {
        back: () => void;
        forward: () => void;
        go: (delta: number) => void;
        index: number;
        length: number;
        listen: (listener: HistoryListener) => () => void;
        location: HistoryLocation;
        push: (
            path: string,
            opts?: { replaceSearch?: boolean; state?: unknown },
        ) => void;
        replace: (
            path: string,
            opts?: { replaceSearch?: boolean; state?: unknown },
        ) => void;
    }
    Index

    Properties

    back: () => void

    Move back one entry.

    forward: () => void

    Move forward one entry.

    go: (delta: number) => void

    Move by delta within the history stack.

    index: number

    Active entry index in the history stack.

    length: number

    Number of entries in the history stack.

    listen: (listener: HistoryListener) => () => void

    Subscribe to location changes.

    location: HistoryLocation

    Current location.

    push: (
        path: string,
        opts?: { replaceSearch?: boolean; state?: unknown },
    ) => void

    Push a new history entry.

    replaceSearch controls behavior when path does not include ?query:

    • false/unset: carry forward current search.
    • true: clear current search.
    replace: (
        path: string,
        opts?: { replaceSearch?: boolean; state?: unknown },
    ) => void

    Replace the current history entry.

    replaceSearch follows the same behavior as push.