onSelectionChanged: the selection changed (DocumentViewer fires textSelected and redraws the selection)
OptionaldocViewer: DocumentViewerOptionalonSelectionChanged: (pages: number[]) => voidClears the selection; does nothing when nothing is selected.
Text range the engine selects in reading order between two points (unrotated page coordinates), page text indexes [start, end); null when no characters are selected. Used by the 2.x compatibility layer to select text the same way as the 2.x API.
Horizontal position in page coordinates.
Vertical position in page coordinates.
Horizontal position in page coordinates.
Vertical position in page coordinates.
Quads of the selected text, one per line per page
Selected text; with a page number only that page. Pages are joined with \n (pages not cached cannot be read)
OptionalpageNumber: numberReturns the current selection.
Anchor, focus and the selected character ranges per page.
Both ends of the selection in order (caret positions); null without a selection or when it is empty
The later end of the selection.
The earlier end of the selection.
Points the selection end handles point at (page coordinates): the start is the bottom-left of the first line, the end the bottom-right of the last line; mid is the middle of that line (only for pages with cached text and selected characters; null otherwise)
Spot of the end handle: bottom-right of the last selected line.
Spot of the start handle: bottom-left of the first selected line.
Which character the point is on: among lines the point falls into vertically (after extending by tolerance), first the vertically nearest, then the horizontally nearest line; within the line, binary search by x; null when the page text is not cached or no line is nearby
Horizontal position in page coordinates.
Vertical position in page coordinates.
Optionaltolerance: numberDrops the cache of these pages (all when omitted); in-flight results are discarded
OptionalpageNumbers: number[]Loads the text of a page, from the cache when available.
Page number (1-based).
The page text.
Returns cached page text without loading it.
Page number (1-based).
The page text, or undefined when it is not cached.
fire-and-forget, queued at P3
The Worker searches page text page by page and streams results back (in page order, reversed with SEARCH_UP); closing the iterator (break / return) cancels
OptionalpageNumbers: number[]Internal: like search, but one chunk per page (including pages without matches); DocumentViewer reports the end of each page from it
OptionalpageNumbers: number[]Changes the text cache limits and evicts pages that no longer fit.
Limits to change; others keep their current values.
Selection from anchor to focus (charIndex is the caret position: before which character), may span pages and be reversed
Number of cached pages, bytes and in-flight requests
Approximate bytes used by the cache.
Number of cached pages.
Text requests in flight, by priority.
Requests at interactive priority.
Prefetch requests.
Page text cache, text selection state and text hit testing for a document viewer. Coordinates are unrotated page coordinates (top-left origin, PDF points).