@laminapdf/viewer 0.2.0-alpha.4 → 0.2.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +36 -8
  2. package/dist/client.d.ts +28 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +105 -5
  5. package/dist/client.js.map +1 -1
  6. package/dist/first-draw.d.ts +10 -0
  7. package/dist/first-draw.d.ts.map +1 -0
  8. package/dist/first-draw.js +33 -0
  9. package/dist/first-draw.js.map +1 -0
  10. package/dist/history/history.d.ts +65 -0
  11. package/dist/history/history.d.ts.map +1 -0
  12. package/dist/history/history.js +135 -0
  13. package/dist/history/history.js.map +1 -0
  14. package/dist/index.d.ts +7 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/layers/copy.d.ts +26 -0
  19. package/dist/layers/copy.d.ts.map +1 -0
  20. package/dist/layers/copy.js +150 -0
  21. package/dist/layers/copy.js.map +1 -0
  22. package/dist/layers/link-layer.d.ts +68 -0
  23. package/dist/layers/link-layer.d.ts.map +1 -0
  24. package/dist/layers/link-layer.js +279 -0
  25. package/dist/layers/link-layer.js.map +1 -0
  26. package/dist/layers/link-url.d.ts +19 -0
  27. package/dist/layers/link-url.d.ts.map +1 -0
  28. package/dist/layers/link-url.js +47 -0
  29. package/dist/layers/link-url.js.map +1 -0
  30. package/dist/layers/spans.d.ts +0 -6
  31. package/dist/layers/spans.d.ts.map +1 -1
  32. package/dist/layers/spans.js +2 -20
  33. package/dist/layers/spans.js.map +1 -1
  34. package/dist/layers/structure-layer.d.ts.map +1 -1
  35. package/dist/layers/structure-layer.js +3 -0
  36. package/dist/layers/structure-layer.js.map +1 -1
  37. package/dist/layers/text-layer.d.ts +20 -3
  38. package/dist/layers/text-layer.d.ts.map +1 -1
  39. package/dist/layers/text-layer.js +307 -23
  40. package/dist/layers/text-layer.js.map +1 -1
  41. package/dist/protocol.d.ts +79 -5
  42. package/dist/protocol.d.ts.map +1 -1
  43. package/dist/protocol.js +16 -4
  44. package/dist/protocol.js.map +1 -1
  45. package/dist/source/opfs.d.ts +35 -0
  46. package/dist/source/opfs.d.ts.map +1 -0
  47. package/dist/source/opfs.js +178 -0
  48. package/dist/source/opfs.js.map +1 -0
  49. package/dist/thumbnails/strip.d.ts +1 -1
  50. package/dist/thumbnails/strip.d.ts.map +1 -1
  51. package/dist/thumbnails/strip.js +14 -3
  52. package/dist/thumbnails/strip.js.map +1 -1
  53. package/dist/view/user-select.d.ts +3 -0
  54. package/dist/view/user-select.d.ts.map +1 -0
  55. package/dist/view/user-select.js +10 -0
  56. package/dist/view/user-select.js.map +1 -0
  57. package/dist/view/viewer.d.ts +61 -1
  58. package/dist/view/viewer.d.ts.map +1 -1
  59. package/dist/view/viewer.js +248 -40
  60. package/dist/view/viewer.js.map +1 -1
  61. package/dist/worker/document.d.ts +23 -1
  62. package/dist/worker/document.d.ts.map +1 -1
  63. package/dist/worker/document.js +68 -22
  64. package/dist/worker/document.js.map +1 -1
  65. package/dist/worker/find.d.ts.map +1 -1
  66. package/dist/worker/find.js +5 -18
  67. package/dist/worker/find.js.map +1 -1
  68. package/dist/worker/methods.d.ts.map +1 -1
  69. package/dist/worker/methods.js +23 -4
  70. package/dist/worker/methods.js.map +1 -1
  71. package/dist/worker/navigation.d.ts +5 -1
  72. package/dist/worker/navigation.d.ts.map +1 -1
  73. package/dist/worker/navigation.js +22 -4
  74. package/dist/worker/navigation.js.map +1 -1
  75. package/dist/worker/print.d.ts +14 -0
  76. package/dist/worker/print.d.ts.map +1 -0
  77. package/dist/worker/print.js +49 -0
  78. package/dist/worker/print.js.map +1 -0
  79. package/dist/worker/recent-pages.d.ts +14 -0
  80. package/dist/worker/recent-pages.d.ts.map +1 -0
  81. package/dist/worker/recent-pages.js +53 -0
  82. package/dist/worker/recent-pages.js.map +1 -0
  83. package/dist/worker/render.d.ts.map +1 -1
  84. package/dist/worker/render.js +5 -2
  85. package/dist/worker/render.js.map +1 -1
  86. package/dist/worker/text.d.ts +9 -1
  87. package/dist/worker/text.d.ts.map +1 -1
  88. package/dist/worker/text.js +29 -22
  89. package/dist/worker/text.js.map +1 -1
  90. package/package.json +6 -5
package/README.md CHANGED
@@ -35,15 +35,18 @@ The view keeps only the pages near the viewport in the DOM and paints each in tw
35
35
  - **Canvas size on touch devices.** A phone or tablet can't hold the desktop's canvases: iOS Safari reloads a tab whose canvases pass 224–384 MB in all. With a coarse pointer, every canvas holds at most 5 million pixels; on a tablet whose window covers more than 5 million device pixels, the page in view shows its backdrop rather than a detail canvas.
36
36
  - **Memory on touch devices.** The two pools and the bitmap cache together stay under 184 MB by default. On a device that reports 2 GB of memory or less (`navigator.deviceMemory`, in Chromium) the limit is 116 MB, and on one that reports 4 GB or more, 304 MB. `createViewer`'s options override each budget, and `device` gives the hints the budgets are chosen from instead of detecting them.
37
37
  - **Tall documents.** A document taller than 16 million CSS px at the chosen zoom gets its zoom capped, because browsers stop scrolling near that height.
38
+ - **Page appearance.** `setAppearance("sepia" | "dark" | "original")`, or High contrast with two colours (`{ kind: "high-contrast", ink, paper }`), draws the pages in other colours. Images and annotations keep theirs ([`@laminapdf/render`](../render/README.md) says how). The pages in view paint again, a quick pass then sharp tiles, and the scroll position stays where it was. Other mounted pages give their canvas back and paint once they come into view. Until a page's pixels arrive, its shell shows `--lamina-page-paper` (white by default), so set it to the appearance's paper. The thumbnails follow, and `getState().appearance` says which appearance is shown.
38
39
 
39
40
  **API.**
40
41
 
41
42
  | Member | What it does |
42
43
  | --- | --- |
43
- | `createViewer({ client, margin?, gap?, pool?, detailPool?, cacheBytes?, backdropMaxPixels?, canvasMaxPixels?, device?, settleMs?, zoom?, text? })` | Makes a viewer over a `ViewerClient`. `text` is on by default; `false` leaves the text layer out, and an object sets its `outline`, `untaggedLabel` and `onSelection`. |
44
+ | `createViewer({ client, margin?, gap?, pool?, detailPool?, cacheBytes?, backdropMaxPixels?, canvasMaxPixels?, device?, settleMs?, zoom?, text?, links?, history? })` | Makes a viewer over a `ViewerClient`. `text` is on by default; `false` leaves the text layer out, and an object sets its `outline`, `untaggedLabel` and `onSelection`. `links` is on by default too; an object sets its `href`, `onExternal` and `words` (below). `history.max` caps the entries kept (default 100). |
44
45
  | `mount(container)`, `open(document)`, `destroy()` | Puts it on the page, shows a document, takes it down. |
45
46
  | `goToPage(index, { anchor })`, `setZoom(zoom, { anchor })`, `rotate(delta)` | Navigation. `zoom` is a mode or a percentage. |
46
47
  | `goToDestination(target)` | Goes to an outline item's or a named destination's target (below). |
48
+ | `jumpToPage(index)`, `jumpToDestination(target)` | Like `goToPage` and `goToDestination`, but recorded as history jumps, so Back returns to where the view was. |
49
+ | `history` | Back and forward through the jumps (below). |
47
50
  | `getState()`, `subscribe(listener)` | The view state (`currentPage`, `pageCount`, `zoom`, `percent`, `rotation`, `scrollTop`, `visibleRange`), for `useSyncExternalStore`. |
48
51
  | `on("pagechange" \| "zoomchange" \| "renderstats", …)`, `stats()` | Events and counters. `renderstats` counts renders, for measuring performance. |
49
52
  | `addLayer({ name, onMount, onUnmount, onZoom })` | Mounts a layer into each page. |
@@ -51,12 +54,17 @@ The view keeps only the pages near the viewport in the DOM and paints each in tw
51
54
  | `pointAt(x, y)`, `positionOf(point)` | Converts between viewport positions and document points. |
52
55
  | `MIN_ZOOM`, `MAX_ZOOM` | The bounds of a percentage zoom, 10 and 800, for a zoom control's range. |
53
56
 
54
- **Layers.** Each page shell stacks a canvas and three slots above it: `div.lamina-layer-text`, `div.lamina-layer-annot` and `div.lamina-layer-highlight`. The text layer fills the first; find's highlights mount in `highlight`, and links will mount in `annot`, through `addLayer`. A layer with another name gets its own slot on top. Every slot above the text lets the pointer through (`pointer-events: none`), so text stays selectable under it; an element a layer wants clicked, such as a link, sets `pointer-events: auto` on itself.
57
+ **Layers.** Each page shell stacks a canvas and three slots above it: `div.lamina-layer-text`, `div.lamina-layer-annot` and `div.lamina-layer-highlight`. The text layer fills the first, links the second and find highlights the third, through `addLayer`. A layer with another name gets its own slot on top. Every slot above the text lets the pointer through (`pointer-events: none`), so text stays selectable under it; an element a layer wants clicked, such as a link's anchor, sets `pointer-events: auto` on itself.
55
58
 
56
59
  **Text.** The text layer makes every page's text selectable, copyable and readable by screen readers, whichever backend draws the page.
57
60
  - **Spans.** Each text run of Lamina PDF's extraction gets one transparent span, placed from its glyphs' quads, never from the renderer's. A rotated or vertical run gets a rotated span, and a span reads right to left when its first letter does. The spans sit in a box sized in points, which one CSS transform scales and turns to the page, so a zoom or a rotation moves no span.
58
- - **Selection.** Selection stays inside the viewer, and only spans are selectable. A drag runs from one page into the next and never takes in a canvas or a gap. The pages a selection touches stay mounted while it lasts. Ctrl/⌘+A in the viewer selects the text of the mounted pages only.
59
- - **Copy** writes the extracted text in reading order: a space at a gap, a new line at a new baseline and between pages, soft hyphens dropped. `onSelection` gives the app the selected text, its rects, its pages and the pointer that made it.
61
+ - **Selection.** Only the spans are selectable. A drag runs from one page into the next and never takes in a canvas or a gap. A drag that leaves the viewer also highlights your app's text; set `user-select: none` on text you want to keep out. Copy, the pinned pages and `onSelection` keep to the part inside the viewer either way. Keep `user-select: none` off every ancestor of the viewer: Firefox then stops selecting. The pages a selection touches stay mounted while it lasts. Ctrl/⌘+A in the viewer selects the text of the mounted pages only.
62
+ - **Copy** writes the selected text as plain text and as HTML, in one of two modes:
63
+ - **By paragraph** (the default) follows the reading order Lamina PDF's extraction finds, so a selection across two columns copies the left column, then the right. A paragraph's lines join into one line, hyphenated words at a line's end join again, ligatures become their letters, and a blank line separates paragraphs.
64
+ - **Exact** keeps the layout's lines: a space at a gap, and a new line at each new baseline and between pages. A table's lines keep their breaks in both modes.
65
+ - **`copySelection(mode)`** copies in either mode from a command or a button. Call it from a click or key handler: browsers refuse clipboard writes outside one, and it then resolves `false`.
66
+ - **Column selection:** an Alt/Option-drag selects the text inside a rectangle, such as one column of a page. Setting `columnSelect` makes a plain drag do the same.
67
+ - **Selection events:** `onSelection` and the viewer's `selectionchange` event give the app the selected text, its client rectangles, its pages and the pointer that made it. `settled` is false during a drag and true once the pointer is up, when a toolbar may show; `column` marks a column selection.
60
68
  - **Structure.** For a tagged document, a hidden tree of ARIA elements follows the structure tree. Headings carry their levels, and figures their alternate text; paragraphs, lists and tables keep their roles. Each element owns its text spans through `aria-owns`, matched by page and marked-content ID (the number a tagged PDF gives each piece of a page's content), so a screen reader reads the document in structure order. For a document without a structure tree, a screen reader hears "Untagged document" once (`untaggedLabel`).
61
69
 
62
70
  The document Web Worker reads each page's text at `background` priority, after the tiles in view, and caches the text of the last 24 pages. Text needs the extract module, which the document Web Worker loads once the render backend is ready, so the first page never waits for it. Selection colours are the app's: style `.lamina-text-layer span::selection`, since the viewer adds no style sheet.
@@ -77,6 +85,18 @@ The document Web Worker reads each page's text at `background` priority, after t
77
85
 
78
86
  A left the file leaves out keeps the current horizontal scroll, and a top it leaves out goes to the page's top. A view rotated by `rotate()` turns the point with the page, and a fit always fits the viewport's own width or height, as in pdf.js.
79
87
 
88
+ **Links.** The link layer puts an anchor over each link on a mounted page, from Lamina PDF's reading of the page's link annotations (`ViewerClient.pageLinks(index)`), never the renderer's. Each link does one of three things, and none runs a script or program the file names:
89
+ - **Inside the document.** A link to a destination, or one of the named actions Next page, Previous page, First page and Last page, goes there as a history jump. Make `links.href(page)` return the app's address for that page. It becomes the anchor's `href`, so a middle click or "Open in new tab" opens the same document there.
90
+ - **To the web.** Only `http:`, `https:` and `mailto:` addresses may open, and only after the app confirms. A click, a middle click or Enter calls `links.onExternal(link)`, with the address normalised (an international host in punycode) and split around its host for showing it. The anchor has no `href`, so no browser menu can open it unasked; its title shows the address. `externalLink(uri)` gives the app the same rules.
91
+ - **Everything else does nothing.** A link to another file, an action such as Launch or JavaScript, a refused address (`javascript:`, `file:`, `data:`) or a destination missing from the file gets no `href`, and its title says why.
92
+
93
+ Anchors follow page order, so Tab reaches a page's links in order. Each is named by its `/Contents` or by what it does ("Link to page 3"); `links.words` gives those names in another language. Only the anchors take pointer events, so text beside a link still selects. Style them as `a.lamina-link`; the viewer adds no style sheet.
94
+
95
+ **History.** `viewer.history` records jumps: links, `jumpToPage`, `jumpToDestination`, find's moves and thumbnail clicks. Scrolling alone records nothing. Each jump saves the view it leaves, both scroll position and zoom, so Back returns there, not only to that page.
96
+ - `back()`, `forward()` and `goTo(id)` move the view; `getState()` and `subscribe()` say where Back and Forward go (`back`, `forward`, `current`, each an entry with a page point and a zoom).
97
+ - A jump that lands where the view already is adds nothing, and a new jump drops what Forward held.
98
+ - `onEntry(listener)` hears of each entry added, so an app can keep its own history in step: the web reader writes each jump into the browser's history through the address fragment, and `goTo(id)` answers the browser's Back.
99
+
80
100
  **Thumbnails.** `new ThumbnailStrip(client, viewer, { width?, margin?, cacheBytes?, label?, name? })` makes a list of the pages as small pictures, for a sidebar. `mount(container)` puts it on the page, and `open(document)` shows the document the viewer opened. Size its `element` with CSS; it scrolls inside.
81
101
  - **Like the viewer, it mounts only what is near its view.** It keeps the thumbnails in view and 4 either side. Each borrows a canvas from the strip's own pool, and a thumbnail scrolled away aborts its render.
82
102
  - **Renders wait for the main view.** Thumbnails render at `background` priority, so the pages in view always come first. Bitmaps stay in a cache of their own, 32 MB by default.
@@ -118,6 +138,8 @@ The client starts the Web Worker and talks to it; you call `ViewerClient`'s meth
118
138
  - A queued render is dropped.
119
139
  - A running one finishes, because synchronous WebAssembly can't be interrupted. Its late answer's bitmap is closed unpainted (`onDiscard`).
120
140
  - (`@laminapdf/sdk/worker` itself rejects with a `cancelled` LaminaPdfError; the viewer maps it to `AbortError`.)
141
+ - An open is the exception. A cancel can reach the page after the Web Worker already opened the new file and closed the old one. So after a cancelled open, `open()` asks the Web Worker which document it holds (`currentDocument`). If this open made it, the cancel came too late: `open()` resolves with that document after all, and the page and the Web Worker agree. Otherwise it rejects with `AbortError`, and the old document stays open.
142
+ - Either way, an aborted `open()` settles only once the Web Worker has finished the open it was running. `stop()` ends a stuck one at once.
121
143
  - **Timeouts:** the page keeps the timers, because a Web Worker inside a render can't post anything.
122
144
  - Defaults are `soft` 10 s (`render-slow`) and `hard` 120 s.
123
145
  - At the hard cap the client calls `stop("hard-timeout")`. For a document that needed a password, it emits `render-stuck` instead and waits for the user's `stop()`.
@@ -140,7 +162,7 @@ The client starts the Web Worker and talks to it; you call `ViewerClient`'s meth
140
162
 
141
163
  ## For contributors
142
164
 
143
- The viewer is the web client of [ADR 0009](../../docs/decisions/0009-web-client-architecture.md); it was built in [C3a](../../docs/todos/done/C3a-viewer-worker-rpc.md) (the document worker and its typed RPC) and [C3b](../../docs/todos/done/C3b-viewer-virtualiser-and-zoom.md) (the viewer). [C3c](../../docs/todos/done/C3c-viewer-perf-harness.md) measures the tuning values with `renderstats`. The layers are for [C5a](../../docs/todos/done/C5a-text-layer-and-selection.md) (text), [C5b](../../docs/todos/done/C5b-find-in-document.md) (find) and [C6b](../../docs/todos/ready/C6b-links-and-history.md) (links); C4c will read documents by range through `@laminapdf/sdk`'s `RangeSource`. Cancellation follows ADR 0009 §3.5, and warnings are [ADR 0003](../../docs/decisions/0003-reader-tolerance-and-limits.md)'s.
165
+ The viewer is the web client of [ADR 0009](../../docs/decisions/0009-web-client-architecture.md); it was built in [C3a](../../docs/todos/done/C3a-viewer-worker-rpc.md) (the document worker and its typed RPC) and [C3b](../../docs/todos/done/C3b-viewer-virtualiser-and-zoom.md) (the viewer). [C3c](../../docs/todos/done/C3c-viewer-perf-harness.md) measures the tuning values with `renderstats`. The layers are for [C5a](../../docs/todos/done/C5a-text-layer-and-selection.md) (text), [C5b](../../docs/todos/done/C5b-find-in-document.md) (find) and [C6b](../../docs/todos/done/C6b-links-and-history.md) (links); C4c will read documents by range through `@laminapdf/sdk`'s `RangeSource`. Cancellation follows ADR 0009 §3.5, and warnings are [ADR 0003](../../docs/decisions/0003-reader-tolerance-and-limits.md)'s.
144
166
 
145
167
  ### Architecture
146
168
 
@@ -165,7 +187,8 @@ There is one protocol, not two: the viewer's worker is `@laminapdf/sdk/worker`'s
165
187
  | Method | Params | Result | Priority |
166
188
  | --- | --- | --- | --- |
167
189
  | `initBackend` | `{ backend: "pdfium" \| "hayro", wasm? }` | `{ name, version }` | document. Sent by `create()`, before a file is chosen, so the WebAssembly downloads in parallel with file selection. |
168
- | `openDocument` | `source` (`Blob`, `ArrayBuffer`, `Uint8Array`), `{ password?, limits?, renderLimits? }` | `{ pageCount, pages, needsPassword, backend }` | document |
190
+ | `openDocument` | `source` (`Blob`, `ArrayBuffer`, `Uint8Array`), `{ password?, limits?, renderLimits? }`, `ticket?` (the client's number for this open) | `{ pageCount, pages, needsPassword, backend }` | document |
191
+ | `currentDocument` | — | `{ document, ticket }` of the open document, or `undefined`: `open()` asks after a cancelled open | document |
169
192
  | `closeDocument` | — | — | document |
170
193
  | `pageInfo` | `index` | `PageInfo` (displayed size in points, rotation, ID, label) | document |
171
194
  | `find` | `query`, `FindOptions`, `pages` | `FindPageResult[]`: each page's matches as quads, and whether it has no text | `background` |
@@ -175,6 +198,8 @@ There is one protocol, not two: the viewer's worker is `@laminapdf/sdk/worker`'s
175
198
  | `structure` | — | `StructureData`: whether the document is tagged, and its structure tree | document |
176
199
  | `outline` | — | `OutlineNode[]`: the outline, each item's target in page space | document |
177
200
  | `namedDestination` | `name` | `Target \| undefined` | document |
201
+ | `pageLinks` | `index` | `PageLink[]`: the page's links in page space, by `kind`; the last 24 pages' are cached | document |
202
+ | `reflow` | — | `Reflow`: the document for reader mode, its blocks in the structure tree's order with figures, formulas and tables as crops, or why not | document. `client.reflow()`; the extract module only |
178
203
  | `networkLog` | — | `WorkerNetworkLog`: every request and blocked request since the Web Worker started | document. `client.networkLog()`: what the `network` and `csp-violation` events reported, those sent before anyone listened included; `index` merges the two. |
179
204
 
180
205
  `client.call(method, params, { priority, signal })` is typed by the `Methods` map: an unknown method or wrong params fails `tsc` (`test/types.test.ts`).
@@ -226,7 +251,8 @@ It writes `target/viewer-perf/<browser>.json` and `summary.md`, and never fails
226
251
  | Scenario | Measures | Target |
227
252
  | --- | --- | --- |
228
253
  | Open the 10-page file, warm (after a reload) | time to the first page's first paint | ≤ 700 ms |
229
- | The same, cold, on Chrome DevTools' Fast 4G (Chromium only) | time from navigation to the first page | ≤ 3 s |
254
+ | The same, cold, on Chrome DevTools' Fast 4G (Chromium only), the file on the device | time from navigation to the first page | ≤ 3 s |
255
+ | The same, cold, the file from a link (Range requests, as a `#url=` link reads it) | time from navigation to the first page | ≤ 3 s (reported) |
230
256
  | Scroll the 1,000-page file end to end, twice, with wheel steps every 20 ms; stop at a quarter, a half and three quarters | the longest main-thread task, time to sharp after each stop, peak memory, memory after each pass, cancelled renders that painted | no task > 50 ms; sharp ≤ 300 ms; ≤ 600 MB; second pass ≤ first + 5 %; 0 |
231
257
  | Fling across the 300 image pages, then stop | time to sharp | ≤ 300 ms |
232
258
  | Three ctrl+wheel bursts in and out on the 10-page file | the longest frame, time to sharp after each burst | reported |
@@ -237,7 +263,9 @@ It writes `target/viewer-perf/<browser>.json` and `summary.md`, and never fails
237
263
 
238
264
  **The reference machine.** The official numbers are the nightly lane's, from the Mac that hosts the self-hosted runners, with nothing else running on it. Each report ends with the machine it ran on (CPU, cores, memory, OS). Numbers from other machines, CI containers included, are relative: compare them with each other, not with the targets.
239
265
 
240
- **First measurements and tuning.** The first full run (Chromium 153 on a 4-core Linux container, 2026-11-05) came in under every scrolling and memory target, a first reading until the reference machine's numbers arrive. It had no long task while scrolling, pages were sharp 0–17 ms after a scroll stopped and 33 ms after a fling, memory peaked at 302 MB, the second pass ended 0.5 % above the first, and no cancelled render painted. So the defaults above stay: a margin of 2 pages or one viewport, a pool of 12 canvases and 64 million pixels, a 256 MB bitmap cache, 512 CSS px tiles and a 150 ms settle. It missed one target and found one slow spot, both for [C7c](../../docs/todos/ready/C7c-performance-gates-and-launch.md):
266
+ **First measurements and tuning.** The first full run (Chromium 153 on a 4-core Linux container, 2026-11-05) came in under every scrolling and memory target, a first reading until the reference machine's numbers arrive. It had no long task while scrolling, pages were sharp 0–17 ms after a scroll stopped and 33 ms after a fling, memory peaked at 302 MB, the second pass ended 0.5 % above the first, and no cancelled render painted. So the defaults above stay: a margin of 2 pages or one viewport, a pool of 12 canvases and 64 million pixels, a 256 MB bitmap cache, 512 CSS px tiles and a 150 ms settle. It missed one target and found one slow spot, both for [C7c](../../docs/todos/done/C7c-performance-gates-and-launch.md):
241
267
 
242
268
  - **The cold first page took 4.2 s on Fast 4G (target 3 s).** The download alone takes about 3.7 s at Fast 4G's 1 MB/s: PDFium's WebAssembly (2.2 MB gzipped), Lamina PDF's base module (0.4 MB) and the 1 MB file.
269
+
270
+ **Cold first page (C7d, 2026-11-10).** By then the cold page took 5.2 s, and a trace of the worker's requests showed why. Lamina PDF's base module and PDFium downloaded one after the other; the link layer's first call needed the extract module (710 KB), and the worker answers one call at a time, so the first page's render waited for that download; and the harness fetched the whole 1 MB file over the throttled network, which a file chosen on the device never costs. Now `ViewerClient.create` compiles PDFium on the page while the worker loads its base module, the text, structure, reading-order and link calls wait for the open document's first drawn page (2 s at most), and the extract module loads after it. A file on the device paints its first page in 3.3 s, a linked 1 MB file in 4.75 s (opening reads most of this file, whose page objects are spread through it). The release gate holds the device case to the target plus its margin; the linked case is reported.
243
271
  - **Zooming in took about 1.2 s to sharp, with a 317 ms frame.** Zooming out took about 300 ms. The plan sets no zoom target.
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { RenderRequest } from "@laminapdf/render";
2
2
  import { type WorkerInitOptions, type WorkerWasmSource } from "@laminapdf/sdk/worker";
3
3
  import type { FindOptions } from "./find/fold.js";
4
- import { type BackendInit, type LoadProgress, type MethodName, type NetworkRecord, type OpenedDocument, type Params, type PolicyViolation, type Priority, type RenderedBitmap, type Result, type SourceInit, type ViewerOpenOptions, type WorkerNetworkLog } from "./protocol.js";
4
+ import { type BackendInit, type LoadProgress, type MethodName, type NetworkRecord, type OpenedDocument, type Params, type PolicyViolation, type PrintOptions, type Priority, type RenderedBitmap, type Result, type SourceInit, type ViewerOpenOptions, type WorkerNetworkLog } from "./protocol.js";
5
5
  /** `ViewerClient.create`'s options: the backend, Lamina PDF's WebAssembly, the timeouts, the worker and a signal to stop starting. */
6
6
  export interface ViewerOptions {
7
7
  /** The render engine; PDFium needs its `.wasm` URL from your bundler (`pdfium.wasm?url`). */
@@ -129,6 +129,11 @@ export declare class ViewerClient {
129
129
  * module, loaded by default). At `background` priority unless `options` says otherwise.
130
130
  */
131
131
  pageText(index: number, options?: ViewerCallOptions): Promise<import("./protocol.js").PageTextData>;
132
+ /**
133
+ * Page `index`'s text blocks in reading order (Lamina PDF's extraction), for copy as paragraph.
134
+ * At `background` priority unless `options` says otherwise.
135
+ */
136
+ readingOrder(index: number, options?: ViewerCallOptions): Promise<import("./protocol.js").ReadingBlock[]>;
132
137
  /**
133
138
  * The matches of `query` on each of `pages`, at `background` priority unless `options` says
134
139
  * otherwise, so renders run first. The find controller calls it a few pages at a time.
@@ -136,6 +141,11 @@ export declare class ViewerClient {
136
141
  find(query: string, find: FindOptions, pages: readonly number[], options?: ViewerCallOptions): Promise<import("./protocol.js").FindPageResult[]>;
137
142
  /** Whether the open document says it is tagged, and its structure tree when it has one. */
138
143
  structure(options?: ViewerCallOptions): Promise<import("./protocol.js").StructureData>;
144
+ /**
145
+ * The open document for reader mode: its blocks in the structure tree's order, figures,
146
+ * formulas and tables as crops with their alternate text, or why its tree can't be trusted.
147
+ */
148
+ reflow(options?: ViewerCallOptions): Promise<import("@laminapdf/sdk").Reflow>;
139
149
  /**
140
150
  * The open document's outline (bookmarks): top-level items, each with its children and where
141
151
  * it goes as a page and a page-space view; empty without one. Read when first asked for.
@@ -143,6 +153,23 @@ export declare class ViewerClient {
143
153
  outline(options?: ViewerCallOptions): Promise<import("@laminapdf/wasm/text").OutlineNodeJs[]>;
144
154
  /** Where the named destination `name` goes, or `undefined` when the document has no such name. */
145
155
  namedDestination(name: string, options?: ViewerCallOptions): Promise<import("@laminapdf/wasm/text").TargetJs | undefined>;
156
+ /**
157
+ * What a properties view shows about the open document (`@laminapdf/sdk`'s `properties()`,
158
+ * read in the worker). It reads every object once: ask when the view opens.
159
+ */
160
+ properties(options?: ViewerCallOptions): Promise<import("@laminapdf/wasm/text").PropertiesJs>;
161
+ /**
162
+ * Page `index` drawn for printing at `print.dpi` with annotations as their print flags say, as
163
+ * a PNG, at `background` priority unless `options` says otherwise, so the pages in view draw first.
164
+ */
165
+ printPage(index: number, print: PrintOptions, options?: ViewerCallOptions): Promise<import("./protocol.js").PrintedPage>;
166
+ /**
167
+ * Every byte of the open remote file as it was opened, fetched where the block cache lacks
168
+ * them. A local file's bytes are the page's own: it never asks.
169
+ */
170
+ fileBytes(options?: ViewerCallOptions): Promise<Uint8Array<ArrayBufferLike>>;
171
+ /** Page `index`'s links, in annotation order, each with what following it does (the link layer asks as pages mount). */
172
+ pageLinks(index: number, options?: ViewerCallOptions): Promise<readonly import("@laminapdf/wasm/text").PageLinkJs[]>;
146
173
  /**
147
174
  * Renders `request` as an ImageBitmap (close it when done). Identical requests in flight are
148
175
  * drawn once. An aborted render rejects with `AbortError` and never paints.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,eAAe,EAEpB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,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CAAC,EAAE,iBAAiB,kDAG1C;IAED;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB,4CAEjC;IAED;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,2DAElC;IAED,kGAAkG;IAClG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,gEAEzD;IAED;;;OAGG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,wDAErC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE,iBAAsB,gDAE5E;IAED;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,wCAEpC;IAED,wHAAwH;IAClH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,iEAK7D;IAED;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAiD7F;IAED;;;;OAIG;IACH,IAAI,CAAC,MAAM,GAAE,WAAW,GAAG,cAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAKtE;IAED,gCAAgC;IAChC,SAAS,IAAI,IAAI,CAIhB;CAgCF"}
package/dist/client.js CHANGED
@@ -16,6 +16,7 @@
16
16
  // fires and the caller opens again with the password.
17
17
  import { isLaminaPdfError } from "@laminapdf/sdk";
18
18
  import { connect, Emitter, } from "@laminapdf/sdk/worker";
19
+ import { FirstDraw } from "./first-draw.js";
19
20
  import { PRIORITY, renderKey, } from "./protocol.js";
20
21
  /** Default render timeouts (ADR 0009 §3.7), in ms. */
21
22
  const DEFAULT_TIMEOUTS = Object.freeze({ soft: 10_000, hard: 120_000 });
@@ -25,6 +26,18 @@ function workerFactory() {
25
26
  function abortError(e) {
26
27
  return isLaminaPdfError(e, "cancelled") ? new DOMException("the call was cancelled", "AbortError") : e;
27
28
  }
29
+ /**
30
+ * PDFium's module compiled on the page from its address, while the worker starts (compiling
31
+ * streams on the browser's own threads); the backend as given when it names no address, or when
32
+ * fetching or compiling fails, so the worker loads it as before.
33
+ */
34
+ function compileEarly(backend) {
35
+ const { wasm } = backend;
36
+ if (backend.backend !== "pdfium" || typeof wasm !== "string" || typeof WebAssembly.compileStreaming !== "function") {
37
+ return Promise.resolve(backend);
38
+ }
39
+ return WebAssembly.compileStreaming(fetch(wasm, { credentials: "same-origin" })).then((module) => ({ ...backend, wasm: module }), () => backend);
40
+ }
28
41
  /** One document worker and the typed RPC to it. */
29
42
  export class ViewerClient {
30
43
  #pdf;
@@ -34,8 +47,12 @@ export class ViewerClient {
34
47
  /** What to reopen after a restart: the source and the options without the password. */
35
48
  #reopen;
36
49
  #document;
50
+ /** Opens asked for so far: each open's ticket. */
51
+ #opens = 0;
37
52
  #recovering;
38
53
  #nextRender = 1;
54
+ /** The open document's gate for text and link calls (first-draw.ts); none before a document opens. */
55
+ #firstDraw;
39
56
  /** Each pending render's timers, by coalescing key: started on `render-start`, paused on `render-fetching`. */
40
57
  #timers = new Map();
41
58
  /** The key the worker is drawing now: a render that joins it starts its timers at once. */
@@ -82,6 +99,9 @@ export class ViewerClient {
82
99
  * the user picks a file.
83
100
  */
84
101
  static async create(options) {
102
+ // PDFium downloads and compiles here while the worker starts and loads Lamina PDF's own
103
+ // module, rather than after it: the two downloads overlap.
104
+ const early = compileEarly(options.backend);
85
105
  const pdf = await connect({
86
106
  worker: options.worker ?? workerFactory,
87
107
  // A late answer to an aborted render: its bitmap is closed, never painted.
@@ -95,7 +115,16 @@ export class ViewerClient {
95
115
  });
96
116
  const client = new ViewerClient(pdf, options);
97
117
  try {
98
- await pdf.request("initBackend", [options.backend], { priority: PRIORITY.document });
118
+ const backend = await early;
119
+ try {
120
+ await pdf.request("initBackend", [backend], { priority: PRIORITY.document });
121
+ }
122
+ catch (e) {
123
+ // A browser that can't post a compiled module to a worker: the worker loads its own.
124
+ if (backend === options.backend)
125
+ throw e;
126
+ await pdf.request("initBackend", [options.backend], { priority: PRIORITY.document });
127
+ }
99
128
  }
100
129
  catch (e) {
101
130
  // Nobody will hold this client: end its worker.
@@ -134,11 +163,30 @@ export class ViewerClient {
134
163
  */
135
164
  async open(source, options = {}, call = {}) {
136
165
  const { password: _, ...rest } = options;
137
- const opened = await this.call("openDocument", [source, options], call);
166
+ const ticket = ++this.#opens;
167
+ let opened;
168
+ try {
169
+ opened = await this.call("openDocument", [source, options, ticket], call);
170
+ }
171
+ catch (e) {
172
+ // A cancel can cross the answer of an open the worker had already committed: then the
173
+ // cancel came too late, and this page takes the document the worker now holds.
174
+ const landed = call.signal?.aborted === true ? await this.#committed(ticket) : undefined;
175
+ if (landed === undefined)
176
+ throw e;
177
+ opened = landed;
178
+ }
138
179
  this.#reopen = { source, options: rest };
139
180
  this.#document = opened;
181
+ // Only once it opened: a failed open leaves the shown document's gate as it was.
182
+ this.#firstDraw = new FirstDraw(opened.id);
140
183
  return opened;
141
184
  }
185
+ /** The worker's document, if open `ticket` made it (the worker runs one call at a time, so it answers after that open). */
186
+ async #committed(ticket) {
187
+ const now = await this.call("currentDocument", []).catch(() => undefined);
188
+ return now?.ticket === ticket ? now.document : undefined;
189
+ }
142
190
  /** The open document, if any. */
143
191
  get document() {
144
192
  return this.#document;
@@ -168,10 +216,20 @@ export class ViewerClient {
168
216
  * Page `index`'s text runs and glyph quads, read by Lamina PDF (needs the extract or text
169
217
  * module, loaded by default). At `background` priority unless `options` says otherwise.
170
218
  */
171
- pageText(index, options = {}) {
219
+ async pageText(index, options = {}) {
220
+ await this.#firstDraw?.wait(options.signal);
172
221
  const key = `text:${this.#document?.id ?? 0}:${index}`;
173
222
  return this.call("pageText", [index], { priority: "background", key, ...options });
174
223
  }
224
+ /**
225
+ * Page `index`'s text blocks in reading order (Lamina PDF's extraction), for copy as paragraph.
226
+ * At `background` priority unless `options` says otherwise.
227
+ */
228
+ async readingOrder(index, options = {}) {
229
+ await this.#firstDraw?.wait(options.signal);
230
+ const key = `order:${this.#document?.id ?? 0}:${index}`;
231
+ return this.call("readingOrder", [index], { priority: "background", key, ...options });
232
+ }
175
233
  /**
176
234
  * The matches of `query` on each of `pages`, at `background` priority unless `options` says
177
235
  * otherwise, so renders run first. The find controller calls it a few pages at a time.
@@ -180,9 +238,17 @@ export class ViewerClient {
180
238
  return this.call("find", [query, find, pages], { priority: "background", ...options });
181
239
  }
182
240
  /** Whether the open document says it is tagged, and its structure tree when it has one. */
183
- structure(options) {
241
+ async structure(options) {
242
+ await this.#firstDraw?.wait(options?.signal);
184
243
  return this.call("structure", [], options);
185
244
  }
245
+ /**
246
+ * The open document for reader mode: its blocks in the structure tree's order, figures,
247
+ * formulas and tables as crops with their alternate text, or why its tree can't be trusted.
248
+ */
249
+ reflow(options) {
250
+ return this.call("reflow", [], options);
251
+ }
186
252
  /**
187
253
  * The open document's outline (bookmarks): top-level items, each with its children and where
188
254
  * it goes as a page and a page-space view; empty without one. Read when first asked for.
@@ -194,6 +260,34 @@ export class ViewerClient {
194
260
  namedDestination(name, options) {
195
261
  return this.call("namedDestination", [name], options);
196
262
  }
263
+ /**
264
+ * What a properties view shows about the open document (`@laminapdf/sdk`'s `properties()`,
265
+ * read in the worker). It reads every object once: ask when the view opens.
266
+ */
267
+ properties(options) {
268
+ return this.call("properties", [], options);
269
+ }
270
+ /**
271
+ * Page `index` drawn for printing at `print.dpi` with annotations as their print flags say, as
272
+ * a PNG, at `background` priority unless `options` says otherwise, so the pages in view draw first.
273
+ */
274
+ printPage(index, print, options = {}) {
275
+ return this.call("printPage", [index, print], { priority: "background", ...options });
276
+ }
277
+ /**
278
+ * Every byte of the open remote file as it was opened, fetched where the block cache lacks
279
+ * them. A local file's bytes are the page's own: it never asks.
280
+ */
281
+ fileBytes(options) {
282
+ return this.call("fileBytes", [], options);
283
+ }
284
+ /** Page `index`'s links, in annotation order, each with what following it does (the link layer asks as pages mount). */
285
+ async pageLinks(index, options = {}) {
286
+ // Links read with the extract module: like the text layer, they wait for the first page drawn,
287
+ // and come after renders.
288
+ await this.#firstDraw?.wait(options.signal);
289
+ return this.call("pageLinks", [index], { priority: "background", ...options });
290
+ }
197
291
  /**
198
292
  * Renders `request` as an ImageBitmap (close it when done). Identical requests in flight are
199
293
  * drawn once. An aborted render rejects with `AbortError` and never paints.
@@ -234,7 +328,11 @@ export class ViewerClient {
234
328
  if (this.#drawing === key)
235
329
  start();
236
330
  try {
237
- return await this.call("render", [request, documentId], { ...options, key });
331
+ const drawn = await this.call("render", [request, documentId], { ...options, key });
332
+ // A page has been drawn: text calls may queue now. (A cancelled render doesn't count: the
333
+ // render that replaces it would wait behind them.)
334
+ this.#firstDraw?.drawn(documentId);
335
+ return drawn;
238
336
  }
239
337
  finally {
240
338
  const own = this.#timers.get(key);
@@ -284,6 +382,8 @@ export class ViewerClient {
284
382
  this.#document = (await this.#pdf.request("openDocument", [reopen.source, reopen.options], {
285
383
  priority: PRIORITY.document,
286
384
  }));
385
+ // The restarted worker has no extract module yet: its first page goes first again.
386
+ this.#firstDraw = new FirstDraw(this.#document.id);
287
387
  reopened = true;
288
388
  }
289
389
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,iGAAiG;AACjG,sBAAsB;AACtB,EAAE;AACF,4FAA4F;AAC5F,gGAAgG;AAChG,2DAA2D;AAC3D,kGAAkG;AAClG,iGAAiG;AACjG,8FAA8F;AAC9F,mGAAmG;AACnG,gGAAgG;AAChG,gGAAgG;AAChG,+FAA+F;AAC/F,gGAAgG;AAChG,wDAAwD;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,OAAO,EACP,OAAO,GAIR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAQL,QAAQ,EAIR,SAAS,GAIV,MAAM,eAAe,CAAC;AAEvB,sDAAsD;AACtD,M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, or after `wait` ms, whichever comes first. */
2
+ export declare class FirstDraw {
3
+ #private;
4
+ constructor(id: number, wait?: number);
5
+ /** A render of document `id` answered: a render of an earlier document doesn't count. */
6
+ drawn(id: number): void;
7
+ /** Resolves once the gate is open; rejects with `signal`'s reason if it was aborted meanwhile. */
8
+ wait(signal?: AbortSignal): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=first-draw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-draw.d.ts","sourceRoot":"","sources":["../src/first-draw.ts"],"names":[],"mappings":"AAOA,iGAAiG;AACjG,qBAAa,SAAS;;IAMpB,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,SAAkB,EAO7C;IAED,yFAAyF;IACzF,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAItB;IAED,kGAAkG;IAC5F,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9C;CACF"}
@@ -0,0 +1,33 @@
1
+ // The text calls' gate for one open document. The document worker runs one call at a time, so a
2
+ // text or link call that waits for the extract module to download would hold the first page's
3
+ // render behind it: those calls wait here until the document's first page is drawn.
4
+ /** How long text calls wait for the open document's first render before going ahead anyway, in ms. */
5
+ const FIRST_DRAW_WAIT = 2000;
6
+ /** Open once document `id`'s first render answers, or after `wait` ms, whichever comes first. */
7
+ export class FirstDraw {
8
+ #id;
9
+ #opened;
10
+ #open = () => undefined;
11
+ #timer;
12
+ constructor(id, wait = FIRST_DRAW_WAIT) {
13
+ this.#id = id;
14
+ this.#opened = new Promise((resolve) => {
15
+ this.#open = resolve;
16
+ });
17
+ // One timer per open: a caller that never renders waits once, not on every call.
18
+ this.#timer = setTimeout(() => this.#open(), wait);
19
+ }
20
+ /** A render of document `id` answered: a render of an earlier document doesn't count. */
21
+ drawn(id) {
22
+ if (id !== this.#id)
23
+ return;
24
+ clearTimeout(this.#timer);
25
+ this.#open();
26
+ }
27
+ /** Resolves once the gate is open; rejects with `signal`'s reason if it was aborted meanwhile. */
28
+ async wait(signal) {
29
+ await this.#opened;
30
+ signal?.throwIfAborted();
31
+ }
32
+ }
33
+ //# sourceMappingURL=first-draw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-draw.js","sourceRoot":"","sources":["../src/first-draw.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,8FAA8F;AAC9F,oFAAoF;AAEpF,sGAAsG;AACtG,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,iGAAiG;AACjG,MAAM,OAAO,SAAS;IACX,GAAG,CAAS;IACZ,OAAO,CAAgB;IAChC,KAAK,GAAe,GAAG,EAAE,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAgC;IAE/C,YAAY,EAAU,EAAE,IAAI,GAAG,eAAe;QAC5C,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC3C,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,iFAAiF;QACjF,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,yFAAyF;IACzF,KAAK,CAAC,EAAU;QACd,IAAI,EAAE,KAAK,IAAI,CAAC,GAAG;YAAE,OAAO;QAC5B,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,kGAAkG;IAClG,KAAK,CAAC,IAAI,CAAC,MAAoB;QAC7B,MAAM,IAAI,CAAC,OAAO,CAAC;QACnB,MAAM,EAAE,cAAc,EAAE,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ import type { DocumentPoint, Zoom } from "../zoom/zoom.js";
2
+ /** A place in the document: the point at the viewport's top-left, and the zoom. */
3
+ export interface HistoryPlace {
4
+ readonly point: DocumentPoint;
5
+ readonly zoom: Zoom;
6
+ }
7
+ /** One entry: a place and the id it keeps while it is in the history. */
8
+ export interface HistoryEntry extends HistoryPlace {
9
+ readonly id: number;
10
+ }
11
+ /** What the history shows: whether Back and Forward go anywhere, and the pages they go to. */
12
+ export interface HistoryState {
13
+ /** The entry the view is at. */
14
+ readonly current: HistoryEntry | undefined;
15
+ /** Where Back goes, when it goes anywhere. */
16
+ readonly back: HistoryEntry | undefined;
17
+ /** Where Forward goes, when it goes anywhere. */
18
+ readonly forward: HistoryEntry | undefined;
19
+ }
20
+ /** What the history reads and moves of its viewer. */
21
+ export interface HistoryHost {
22
+ /** Where the view is now; `undefined` without a document. */
23
+ place(): HistoryPlace | undefined;
24
+ /** Puts the view at `place`. */
25
+ show(place: HistoryPlace): void;
26
+ }
27
+ /** The history's options. */
28
+ export interface NavigationHistoryOptions {
29
+ /** The most entries kept; the oldest go first (default 100). */
30
+ readonly max?: number;
31
+ }
32
+ /** One viewer's back and forward history. */
33
+ export declare class NavigationHistory {
34
+ #private;
35
+ constructor(host: HistoryHost, options?: NavigationHistoryOptions);
36
+ /** What Back and Forward do now (a new object after each change). */
37
+ getState(): HistoryState;
38
+ /** Calls `listener` after every change (for `useSyncExternalStore`). */
39
+ subscribe(listener: () => void): () => void;
40
+ /**
41
+ * Calls `listener` when an entry is added: by a jump (`replaced` false), or as the first entry
42
+ * of a document (`replaced` true, as `history.replaceState` would). Back, Forward and `goTo`
43
+ * add nothing, so they never call it.
44
+ */
45
+ onEntry(listener: (entry: HistoryEntry, replaced: boolean) => void): () => void;
46
+ /** Forgets every entry: a new document starts a history of its own. */
47
+ reset(): void;
48
+ /**
49
+ * Runs `go` (which moves the view) as a jump: where the view was is kept for Back, and where it
50
+ * lands is the new current entry, with nothing left for Forward. Landing where it was adds
51
+ * nothing.
52
+ */
53
+ jump(go: () => void): void;
54
+ /** Goes back one entry; `false` when there is none. */
55
+ back(): boolean;
56
+ /** Goes forward one entry; `false` when there is none. */
57
+ forward(): boolean;
58
+ /**
59
+ * Goes to the entry `id` (Back or Forward, by the browser's history or the app's own): the
60
+ * view moves there and the entries stay. `false` when that entry is gone (pushed out, or from
61
+ * another document).
62
+ */
63
+ goTo(id: number): boolean;
64
+ }
65
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/history/history.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE3D,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAC3C,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;CAC5C;AAED,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,KAAK,IAAI,YAAY,GAAG,SAAS,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;CACjC;AAED,6BAA6B;AAC7B,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAQD,6CAA6C;AAC7C,qBAAa,iBAAiB;;IAU5B,YAAY,IAAI,EAAE,WAAW,EAAE,OAAO,GAAE,w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