ReadonlydocumentFinish the current page; elements with ID are collected and saved with current page-based counter values internally.
Index of the currently laid out spine item
Index of the currently laid out page in its spine item
Forcefully set the page page-based counter to the specified value.
Get (or lazily create) a patchable expression for a counter(page) used inside a named string assigned at the given element offset. The expression reads its value from the assignment-page snapshot so it stays correct after cross-spine repagination shifts page numbers (Issue #1997). The same (offset, counterName) pair always reuses the same expression to avoid unbounded growth across margin-box re-renders.
Return the format function registered for a page-counter expression, or null if it is not a registered page counter (Issue #1997).
Return the page counters captured for the finished page whose element offset range contains the given offset, or null when no such page has been finished yet (Issue #1997).
Returns unresolved references pointing to the specified page.
Restore previously saved page-based counter values.
Restore previously saved references to solve.
Save current page-based counters values and set them to the values passed in. The saved counter values can be restored by popPageCounters method.
Save current references to solve and set them to the values passed in. The saved references can be restored by popReferencesToSolve method.
Resolve a reference with the specified ID.
Save a reference appeared in the current page.
If the reference is already resolved or not.
OptionalchangeTypes: { [key: string]: "set" | "reset" | "increment" }Walk through page-counter DOM nodes in the given page containers and update their text content from the adjusted pageCountersById snapshots. Called after adjustPageCountersOfLaterSpines has shifted the counters.
When available, pass explicit per-page counter snapshots aligned with the given pages so pages without tracked element IDs are also updated.
OptionalpageCountersByPage: CounterValues[]Update the page-based counters with 'counter-reset' and 'counter-increment' properties within the page context. Call before starting layout of the page.
Walk through target-counter DOM nodes in the given page containers and update their text content from the current pageCountersById snapshots.
Adjust page counter snapshots for elements in spines after the specified spine. Called when a preceding spine's page count changes (e.g. TOC expands after target-text resolution), shifting all subsequent pages.