HTML Flip Book - v0.0.0-alpha.36
    Preparing search index...

    Interface HistoryMapper

    Optional mapper to sync flip-book page with browser history (pushState on flip, restore on popstate). When provided, the flip-book will pushState when the user flips and restore the page on back/forward.

    interface HistoryMapper {
        pageToRoute: (
            pageIndex: number,
            semantic: FlipPageSemantic | undefined,
        ) => string | null;
        routeToPage: (route: string) => number | null;
    }
    Index

    Properties

    pageToRoute: (
        pageIndex: number,
        semantic: FlipPageSemantic | undefined,
    ) => string | null

    Build a route string from the current page (and optional semantic). Used for pushState/replaceState. Return null to skip the history update for this page (e.g. cover, TOC, or other non-navigable pages).

    routeToPage: (route: string) => number | null

    Parse a route string (e.g. from popstate) and return the page index, or null if invalid.