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).
Parse a route string (e.g. from popstate) and return the page index, or null if invalid.
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.