@docmentis/udoc-viewer 0.6.27 → 0.6.28

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 (47) hide show
  1. package/README.md +40 -2
  2. package/dist/package.json +1 -1
  3. package/dist/src/UDocClient.js +1 -1
  4. package/dist/src/UDocViewer.d.ts +16 -0
  5. package/dist/src/UDocViewer.d.ts.map +1 -1
  6. package/dist/src/UDocViewer.js +23 -2
  7. package/dist/src/UDocViewer.js.map +1 -1
  8. package/dist/src/ui/viewer/actions.d.ts +7 -0
  9. package/dist/src/ui/viewer/actions.d.ts.map +1 -1
  10. package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +1 -1
  11. package/dist/src/ui/viewer/components/SearchPanel.js +53 -34
  12. package/dist/src/ui/viewer/components/SearchPanel.js.map +1 -1
  13. package/dist/src/ui/viewer/components/Spread.js +1 -1
  14. package/dist/src/ui/viewer/components/Spread.js.map +1 -1
  15. package/dist/src/ui/viewer/components/ThumbnailPanel.js +1 -1
  16. package/dist/src/ui/viewer/components/ThumbnailPanel.js.map +1 -1
  17. package/dist/src/ui/viewer/components/Viewport.d.ts.map +1 -1
  18. package/dist/src/ui/viewer/components/Viewport.js +37 -7
  19. package/dist/src/ui/viewer/components/Viewport.js.map +1 -1
  20. package/dist/src/ui/viewer/effects.d.ts.map +1 -1
  21. package/dist/src/ui/viewer/effects.js +21 -8
  22. package/dist/src/ui/viewer/effects.js.map +1 -1
  23. package/dist/src/ui/viewer/reducer.d.ts.map +1 -1
  24. package/dist/src/ui/viewer/reducer.js +37 -2
  25. package/dist/src/ui/viewer/reducer.js.map +1 -1
  26. package/dist/src/ui/viewer/search/index.d.ts +1 -1
  27. package/dist/src/ui/viewer/search/index.d.ts.map +1 -1
  28. package/dist/src/ui/viewer/search/index.js +1 -1
  29. package/dist/src/ui/viewer/search/index.js.map +1 -1
  30. package/dist/src/ui/viewer/search/search.d.ts +10 -2
  31. package/dist/src/ui/viewer/search/search.d.ts.map +1 -1
  32. package/dist/src/ui/viewer/search/search.js +19 -3
  33. package/dist/src/ui/viewer/search/search.js.map +1 -1
  34. package/dist/src/ui/viewer/state.d.ts +9 -0
  35. package/dist/src/ui/viewer/state.d.ts.map +1 -1
  36. package/dist/src/ui/viewer/state.js +2 -1
  37. package/dist/src/ui/viewer/state.js.map +1 -1
  38. package/dist/src/ui/viewer/text/render.d.ts.map +1 -1
  39. package/dist/src/ui/viewer/text/render.js +46 -39
  40. package/dist/src/ui/viewer/text/render.js.map +1 -1
  41. package/dist/src/wasm/udoc.d.ts +218 -218
  42. package/dist/src/wasm/udoc.js +3 -3
  43. package/dist/src/wasm/udoc_bg.wasm +0 -0
  44. package/dist/src/wasm/udoc_bg.wasm.d.ts +2 -2
  45. package/dist/src/worker/worker-inline.js +1 -1
  46. package/dist/src/worker/worker.js +3 -3
  47. package/package.json +1 -1
@@ -1,5 +1,47 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Rectangle differences for JavaScript serialization.
5
+ */
6
+ export interface JsRectDifferences {
7
+ left: number;
8
+ bottom: number;
9
+ right: number;
10
+ top: number;
11
+ }
12
+
13
+ /**
14
+ * Point for JavaScript serialization.
15
+ */
16
+ export interface JsPoint {
17
+ x: number;
18
+ y: number;
19
+ }
20
+
21
+ /**
22
+ * RGB color for JavaScript serialization (values 0.0-1.0).
23
+ */
24
+ export interface JsColor {
25
+ r: number;
26
+ g: number;
27
+ b: number;
28
+ }
29
+
30
+ /**
31
+ * Quadrilateral for JavaScript serialization (used in text markup annotations).
32
+ */
33
+ export interface JsQuad {
34
+ /**
35
+ * Four corner points: [bottom-left, bottom-right, top-right, top-left]
36
+ */
37
+ points: [JsPoint, JsPoint, JsPoint, JsPoint];
38
+ }
39
+
40
+ /**
41
+ * Link action for JavaScript serialization.
42
+ */
43
+ export type JsLinkAction = { actionType: "goTo"; destination: JsDestination } | { actionType: "uri"; uri: string };
44
+
3
45
  /**
4
46
  * Markup metadata for JavaScript serialization (author, subject, contents, state).
5
47
  */
@@ -24,35 +66,6 @@ export interface JsMarkupMetadata {
24
66
  richContents?: string;
25
67
  }
26
68
 
27
- /**
28
- * Quadrilateral for JavaScript serialization (used in text markup annotations).
29
- */
30
- export interface JsQuad {
31
- /**
32
- * Four corner points: [bottom-left, bottom-right, top-right, top-left]
33
- */
34
- points: [JsPoint, JsPoint, JsPoint, JsPoint];
35
- }
36
-
37
- /**
38
- * Rectangle for JavaScript serialization.
39
- */
40
- export interface JsRect {
41
- x: number;
42
- y: number;
43
- width: number;
44
- height: number;
45
- }
46
-
47
- /**
48
- * RGB color for JavaScript serialization (values 0.0-1.0).
49
- */
50
- export interface JsColor {
51
- r: number;
52
- g: number;
53
- b: number;
54
- }
55
-
56
69
  /**
57
70
  * Annotation for JavaScript serialization.
58
71
  */
@@ -80,36 +93,21 @@ export interface JsAnnotation extends JsAnnotationType {
80
93
  modificationDate?: string;
81
94
  }
82
95
 
83
- /**
84
- * Rectangle differences for JavaScript serialization.
85
- */
86
- export interface JsRectDifferences {
87
- left: number;
88
- bottom: number;
89
- right: number;
90
- top: number;
91
- }
92
-
93
- /**
94
- * Link action for JavaScript serialization.
95
- */
96
- export type JsLinkAction = { actionType: "goTo"; destination: JsDestination } | { actionType: "uri"; uri: string };
97
-
98
96
  /**
99
97
  * Annotation type for JavaScript serialization.
100
98
  */
101
99
  export type JsAnnotationType = { type: "link"; action: JsLinkAction } | { type: "highlight"; quads: JsQuad[]; color?: JsColor; opacity?: number } | { type: "underline"; quads: JsQuad[]; color?: JsColor; opacity?: number } | { type: "strikeOut"; quads: JsQuad[]; color?: JsColor; opacity?: number } | { type: "squiggly"; quads: JsQuad[]; color?: JsColor; opacity?: number } | { type: "text"; icon: string; open: boolean; color?: JsColor; opacity?: number } | { type: "freeText"; contents?: string; justification: string; defaultAppearance?: string; color?: JsColor; borderColor?: JsColor; calloutLine?: JsPoint[]; opacity?: number; defaultStyle?: string; lineEnding?: string; rectDifferences?: JsRectDifferences } | { type: "stamp"; name?: string; hasCustomAppearance: boolean; color?: JsColor; opacity?: number } | { type: "line"; start: JsPoint; end: JsPoint; startEnding: string; endEnding: string; color?: JsColor; interiorColor?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; opacity?: number; leaderLength?: number; leaderExtension?: number; leaderOffset?: number; caption?: boolean; captionPosition?: string; captionOffset?: [number, number] } | { type: "square"; color?: JsColor; interiorColor?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; opacity?: number; rectDifferences?: JsRectDifferences } | { type: "circle"; color?: JsColor; interiorColor?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; opacity?: number; rectDifferences?: JsRectDifferences } | { type: "polygon"; vertices: JsPoint[]; color?: JsColor; interiorColor?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; startEnding: string; endEnding: string; opacity?: number } | { type: "polyLine"; vertices: JsPoint[]; color?: JsColor; interiorColor?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; startEnding: string; endEnding: string; opacity?: number } | { type: "ink"; inkList: JsPoint[][]; color?: JsColor; borderWidth?: number; borderStyle: string; dashPattern?: number[]; opacity?: number } | { type: "caret"; symbol: string; color?: JsColor; opacity?: number; rectDifferences?: JsRectDifferences } | { type: "redact"; quads: JsQuad[]; interiorColor?: JsColor; overlayText?: string; justification: string; repeat: boolean; color?: JsColor; opacity?: number; defaultAppearance?: string };
102
100
 
103
101
  /**
104
- * Point for JavaScript serialization.
102
+ * Rectangle for JavaScript serialization.
105
103
  */
106
- export interface JsPoint {
104
+ export interface JsRect {
107
105
  x: number;
108
106
  y: number;
107
+ width: number;
108
+ height: number;
109
109
  }
110
110
 
111
- export type JsViewerScrollMode = "spread" | "continuous";
112
-
113
111
  export interface JsViewerPreferences {
114
112
  layoutMode?: JsViewerLayoutMode;
115
113
  scrollMode?: JsViewerScrollMode;
@@ -117,35 +115,7 @@ export interface JsViewerPreferences {
117
115
 
118
116
  export type JsViewerLayoutMode = "single-page" | "double-page-odd-right" | "double-page-odd-left";
119
117
 
120
- /**
121
- * Nested `Vec<Vec<T>>` can\'t cross the WASM boundary directly, so we use a
122
- * transparent Tsify wrapper.
123
- */
124
- export type JsCompositions = JsPick[][];
125
-
126
- export type JsSideDirection = "left" | "right" | "up" | "down";
127
-
128
- export type JsCornerDirection = "leftUp" | "rightUp" | "leftDown" | "rightDown";
129
-
130
- /**
131
- * Font source for JavaScript serialization.
132
- */
133
- export type JsFontSource = "embedded" | "standard" | "googleFonts" | "url" | "local" | { custom: string };
134
-
135
- /**
136
- * Font spec for JavaScript serialization.
137
- */
138
- export type JsFontSpec = { typeface: string; bold: boolean; italic: boolean } | { fontId: string };
139
-
140
- /**
141
- * Extracted font info for JavaScript.
142
- */
143
- export interface JsExtractedFont {
144
- name: string;
145
- fontType: string;
146
- extension: string;
147
- data: number[];
148
- }
118
+ export type JsViewerScrollMode = "spread" | "continuous";
149
119
 
150
120
  /**
151
121
  * A pick specification from JavaScript.
@@ -165,60 +135,41 @@ export interface JsPick {
165
135
  rotation: number | undefined;
166
136
  }
167
137
 
138
+ export type JsShredPattern = "strip" | "rectangle";
139
+
168
140
  /**
169
- * Transition effect as a discriminated union (tagged by `type`).
141
+ * Font spec for JavaScript serialization.
170
142
  */
171
- export type JsTransitionEffect = { type: "blinds"; orientation: JsOrientation } | { type: "checker"; orientation: JsOrientation } | { type: "circle" } | { type: "dissolve" } | { type: "comb"; orientation: JsOrientation } | { type: "cover"; direction: JsEightDirection } | { type: "cut"; throughBlack: boolean } | { type: "diamond" } | { type: "fade"; throughBlack: boolean } | { type: "newsflash" } | { type: "plus" } | { type: "pull"; direction: JsEightDirection } | { type: "push"; direction: JsSideDirection } | { type: "random" } | { type: "randomBar"; orientation: JsOrientation } | { type: "split"; orientation: JsOrientation; inOut: JsInOutDirection } | { type: "strips"; direction: JsCornerDirection } | { type: "wedge" } | { type: "wheel"; spokes: number } | { type: "wipe"; direction: JsSideDirection } | { type: "zoom"; inOut: JsInOutDirection } | { type: "box"; inOut: JsInOutDirection } | { type: "glitter"; direction: JsSideDirection; pattern: JsGlitterPattern } | { type: "fly"; direction: JsSideDirection } | { type: "uncover"; direction: JsEightDirection } | { type: "replace" } | { type: "vortex"; direction: JsSideDirection } | { type: "switch"; direction: JsSideDirection } | { type: "flip"; direction: JsSideDirection } | { type: "ripple"; direction: JsRippleDirection } | { type: "honeycomb" } | { type: "prism"; direction: JsSideDirection; isContent: boolean; isInverted: boolean } | { type: "doors"; orientation: JsOrientation } | { type: "window"; orientation: JsOrientation } | { type: "ferris"; direction: JsSideDirection } | { type: "gallery"; direction: JsSideDirection } | { type: "conveyor"; direction: JsSideDirection } | { type: "pan"; direction: JsSideDirection } | { type: "warp"; inOut: JsInOutDirection } | { type: "flythrough"; inOut: JsInOutDirection; hasBounce: boolean } | { type: "flash" } | { type: "shred"; pattern: JsShredPattern; inOut: JsInOutDirection } | { type: "reveal"; throughBlack: boolean; direction: JsSideDirection } | { type: "wheelReverse"; spokes: number } | { type: "morph"; option: JsMorphOption };
143
+ export type JsFontSpec = { typeface: string; bold: boolean; italic: boolean } | { fontId: string };
172
144
 
173
145
  /**
174
- * Page transition info for serialization to JavaScript.
175
- *
176
- * The `effect` field is a discriminated union tagged by `type`, e.g.:
177
- * `{ effect: { type: \"fade\", throughBlack: true }, durationMs: 500 }`
146
+ * Visibility group info for serialization to JavaScript.
178
147
  */
179
- export interface JsPageTransition {
180
- /**
181
- * The visual transition effect (discriminated union tagged by `type`).
182
- */
183
- effect: JsTransitionEffect;
184
- /**
185
- * Duration of the transition animation in milliseconds.
186
- */
187
- durationMs?: number;
188
- /**
189
- * Whether clicking advances to the next page.
190
- */
191
- advanceOnClick?: boolean;
192
- /**
193
- * Auto-advance after this many milliseconds.
194
- */
195
- advanceAfterMs?: number;
148
+ export interface JsVisibilityGroup {
149
+ id: string;
150
+ name: string;
151
+ visible: boolean;
152
+ locked: boolean;
196
153
  }
197
154
 
198
- export type JsInOutDirection = "in" | "out";
199
-
200
155
  /**
201
- * Font registration entry from JavaScript.
156
+ * Result from pdf_split_by_outline.
202
157
  */
203
- export interface JsFontRegistration {
204
- typeface: string;
205
- bold: boolean;
206
- italic: boolean;
207
- url: string;
158
+ export interface JsSplitByOutlineResult {
159
+ documentIds: string[];
160
+ sections: JsOutlineSection[];
208
161
  }
209
162
 
210
163
  /**
211
- * Font usage entry for JavaScript serialization.
164
+ * Annotations grouped by page index (as string keys).
212
165
  */
213
- export interface JsFontUsageEntry {
214
- spec: JsFontSpec;
215
- resolved: JsResolvedFontInfo;
216
- fallbacks: JsResolvedFontInfo[];
217
- }
166
+ export type JsAnnotationsByPage = Record<string, JsAnnotation[]>;
218
167
 
219
- export type JsShredPattern = "strip" | "rectangle";
168
+ export type JsEightDirection = "left" | "right" | "up" | "down" | "leftUp" | "rightUp" | "leftDown" | "rightDown";
220
169
 
221
- export type JsGlitterPattern = "diamond" | "hexagon";
170
+ export type JsCornerDirection = "leftUp" | "rightUp" | "leftDown" | "rightDown";
171
+
172
+ export type JsOrientation = "horizontal" | "vertical";
222
173
 
223
174
  /**
224
175
  * Outline section info for split_by_outline results.
@@ -228,27 +179,6 @@ export interface JsOutlineSection {
228
179
  index: number;
229
180
  }
230
181
 
231
- /**
232
- * Resolved font info for JavaScript serialization.
233
- */
234
- export interface JsResolvedFontInfo {
235
- familyName: string;
236
- postscriptName?: string;
237
- source: JsFontSource;
238
- bold: boolean;
239
- italic: boolean;
240
- }
241
-
242
- /**
243
- * Visibility group info for serialization to JavaScript.
244
- */
245
- export interface JsVisibilityGroup {
246
- id: string;
247
- name: string;
248
- visible: boolean;
249
- locked: boolean;
250
- }
251
-
252
182
  /**
253
183
  * Tile position in a 2D page grid.
254
184
  */
@@ -258,18 +188,27 @@ export interface JsTilePos {
258
188
  }
259
189
 
260
190
  /**
261
- * Annotations grouped by page index (as string keys).
191
+ * Font info returned by `parseFontInfo`.
262
192
  */
263
- export type JsAnnotationsByPage = Record<string, JsAnnotation[]>;
193
+ export interface JsParsedFontInfo {
194
+ typeface: string;
195
+ bold: boolean;
196
+ italic: boolean;
197
+ }
264
198
 
265
- export type JsEightDirection = "left" | "right" | "up" | "down" | "leftUp" | "rightUp" | "leftDown" | "rightDown";
199
+ export type JsInOutDirection = "in" | "out";
200
+
201
+ export type JsSideDirection = "left" | "right" | "up" | "down";
266
202
 
267
203
  /**
268
- * Result from pdf_split_by_outline.
204
+ * Resolved font info for JavaScript serialization.
269
205
  */
270
- export interface JsSplitByOutlineResult {
271
- documentIds: string[];
272
- sections: JsOutlineSection[];
206
+ export interface JsResolvedFontInfo {
207
+ familyName: string;
208
+ postscriptName?: string;
209
+ source: JsFontSource;
210
+ bold: boolean;
211
+ italic: boolean;
273
212
  }
274
213
 
275
214
  /**
@@ -282,7 +221,32 @@ export interface JsRect {
282
221
  height: number;
283
222
  }
284
223
 
285
- export type JsRippleDirection = "center" | "leftUp" | "rightUp" | "leftDown" | "rightDown";
224
+ /**
225
+ * Page transition info for serialization to JavaScript.
226
+ *
227
+ * The `effect` field is a discriminated union tagged by `type`, e.g.:
228
+ * `{ effect: { type: \"fade\", throughBlack: true }, durationMs: 500 }`
229
+ */
230
+ export interface JsPageTransition {
231
+ /**
232
+ * The visual transition effect (discriminated union tagged by `type`).
233
+ */
234
+ effect: JsTransitionEffect;
235
+ /**
236
+ * Duration of the transition animation in milliseconds.
237
+ */
238
+ durationMs?: number;
239
+ /**
240
+ * Whether clicking advances to the next page.
241
+ */
242
+ advanceOnClick?: boolean;
243
+ /**
244
+ * Auto-advance after this many milliseconds.
245
+ */
246
+ advanceAfterMs?: number;
247
+ }
248
+
249
+ export type JsMorphOption = "byObject" | "byWord" | "byChar";
286
250
 
287
251
  /**
288
252
  * Extracted image info for JavaScript.
@@ -295,19 +259,39 @@ export interface JsExtractedImage {
295
259
  data: number[];
296
260
  }
297
261
 
298
- export type JsMorphOption = "byObject" | "byWord" | "byChar";
262
+ /**
263
+ * Nested `Vec<Vec<T>>` can\'t cross the WASM boundary directly, so we use a
264
+ * transparent Tsify wrapper.
265
+ */
266
+ export type JsCompositions = JsPick[][];
299
267
 
300
- export type JsOrientation = "horizontal" | "vertical";
268
+ /**
269
+ * Font source for JavaScript serialization.
270
+ */
271
+ export type JsFontSource = "embedded" | "standard" | "googleFonts" | "url" | "local" | { custom: string };
301
272
 
302
273
  /**
303
- * Font info returned by `parseFontInfo`.
274
+ * Font registration entry from JavaScript.
304
275
  */
305
- export interface JsParsedFontInfo {
276
+ export interface JsFontRegistration {
306
277
  typeface: string;
307
278
  bold: boolean;
308
279
  italic: boolean;
280
+ url: string;
309
281
  }
310
282
 
283
+ /**
284
+ * Extracted font info for JavaScript.
285
+ */
286
+ export interface JsExtractedFont {
287
+ name: string;
288
+ fontType: string;
289
+ extension: string;
290
+ data: number[];
291
+ }
292
+
293
+ export type JsGlitterPattern = "diamond" | "hexagon";
294
+
311
295
  /**
312
296
  * Page info for serialization to JavaScript.
313
297
  */
@@ -334,6 +318,32 @@ export interface JsPageInfo {
334
318
  tilePos?: JsTilePos;
335
319
  }
336
320
 
321
+ /**
322
+ * Font usage entry for JavaScript serialization.
323
+ */
324
+ export interface JsFontUsageEntry {
325
+ spec: JsFontSpec;
326
+ resolved: JsResolvedFontInfo;
327
+ fallbacks: JsResolvedFontInfo[];
328
+ }
329
+
330
+ export type JsRippleDirection = "center" | "leftUp" | "rightUp" | "leftDown" | "rightDown";
331
+
332
+ /**
333
+ * Transition effect as a discriminated union (tagged by `type`).
334
+ */
335
+ export type JsTransitionEffect = { type: "blinds"; orientation: JsOrientation } | { type: "checker"; orientation: JsOrientation } | { type: "circle" } | { type: "dissolve" } | { type: "comb"; orientation: JsOrientation } | { type: "cover"; direction: JsEightDirection } | { type: "cut"; throughBlack: boolean } | { type: "diamond" } | { type: "fade"; throughBlack: boolean } | { type: "newsflash" } | { type: "plus" } | { type: "pull"; direction: JsEightDirection } | { type: "push"; direction: JsSideDirection } | { type: "random" } | { type: "randomBar"; orientation: JsOrientation } | { type: "split"; orientation: JsOrientation; inOut: JsInOutDirection } | { type: "strips"; direction: JsCornerDirection } | { type: "wedge" } | { type: "wheel"; spokes: number } | { type: "wipe"; direction: JsSideDirection } | { type: "zoom"; inOut: JsInOutDirection } | { type: "box"; inOut: JsInOutDirection } | { type: "glitter"; direction: JsSideDirection; pattern: JsGlitterPattern } | { type: "fly"; direction: JsSideDirection } | { type: "uncover"; direction: JsEightDirection } | { type: "replace" } | { type: "vortex"; direction: JsSideDirection } | { type: "switch"; direction: JsSideDirection } | { type: "flip"; direction: JsSideDirection } | { type: "ripple"; direction: JsRippleDirection } | { type: "honeycomb" } | { type: "prism"; direction: JsSideDirection; isContent: boolean; isInverted: boolean } | { type: "doors"; orientation: JsOrientation } | { type: "window"; orientation: JsOrientation } | { type: "ferris"; direction: JsSideDirection } | { type: "gallery"; direction: JsSideDirection } | { type: "conveyor"; direction: JsSideDirection } | { type: "pan"; direction: JsSideDirection } | { type: "warp"; inOut: JsInOutDirection } | { type: "flythrough"; inOut: JsInOutDirection; hasBounce: boolean } | { type: "flash" } | { type: "shred"; pattern: JsShredPattern; inOut: JsInOutDirection } | { type: "reveal"; throughBlack: boolean; direction: JsSideDirection } | { type: "wheelReverse"; spokes: number } | { type: "morph"; option: JsMorphOption };
336
+
337
+ export interface JsLayoutGlyph {
338
+ x: number;
339
+ y: number;
340
+ advance: number;
341
+ /**
342
+ * Byte offset of this glyph\'s source character relative to the parent run\'s text.
343
+ */
344
+ offset: number;
345
+ }
346
+
337
347
  export interface JsLayoutTableCell {
338
348
  colIndex: number;
339
349
  colSpan: number;
@@ -345,43 +355,59 @@ export interface JsLayoutTableCell {
345
355
  parcel?: JsLayoutParcel;
346
356
  }
347
357
 
348
- export interface JsLayoutLine {
358
+ export interface JsLayoutParcel {
359
+ x: number;
349
360
  y: number;
350
361
  width: number;
351
362
  height: number;
352
- spaceBefore: number;
353
- spaceAfter: number;
354
- isFirstLineOfPara: boolean;
355
- isLastLineOfPara: boolean;
356
- content: JsLayoutLineContent;
363
+ lines: JsLayoutLine[];
357
364
  }
358
365
 
359
- export interface JsLayoutRun {
360
- x: number;
366
+ export interface JsLayoutTableRow {
367
+ y: number;
368
+ height: number;
369
+ cells: JsLayoutTableCell[];
370
+ }
371
+
372
+ export type JsLayoutRunContent = { type: "glyphs"; text: string; fontSize: number; ascent: number; descent: number; glyphs: JsLayoutGlyph[] } | { type: "space"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "tab"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "paragraphEnd"; advance: number } | { type: "break" } | { type: "inlineDrawing"; width: number; height: number };
373
+
374
+ export type JsLayoutLineContent = ({ type: "runList" } & JsLayoutRunList) | ({ type: "table" } & JsLayoutTable);
375
+
376
+ export interface JsLayoutTable {
361
377
  width: number;
362
- transform: JsTransform;
363
- content: JsLayoutRunContent;
378
+ height: number;
379
+ columns: JsLayoutTableColumn[];
380
+ rows: JsLayoutTableRow[];
364
381
  }
365
382
 
366
- export interface JsLayoutParcel {
383
+ export interface JsLayoutGridCell {
384
+ colIndex: number;
367
385
  x: number;
368
386
  y: number;
369
387
  width: number;
370
388
  height: number;
371
- lines: JsLayoutLine[];
389
+ parcel?: JsLayoutParcel;
372
390
  }
373
391
 
374
- export interface JsLayoutGridRow {
392
+ export interface JsLayoutLine {
375
393
  y: number;
394
+ width: number;
376
395
  height: number;
377
- cells: JsLayoutGridCell[];
396
+ spaceBefore: number;
397
+ spaceAfter: number;
398
+ isFirstLineOfPara: boolean;
399
+ isLastLineOfPara: boolean;
400
+ content: JsLayoutLineContent;
378
401
  }
379
402
 
380
- export interface JsLayoutPage {
403
+ export interface JsLayoutFrame {
404
+ transform: JsTransform;
405
+ parcel?: JsLayoutParcel;
406
+ }
407
+
408
+ export interface JsLayoutTableColumn {
409
+ x: number;
381
410
  width: number;
382
- height: number;
383
- frames: JsLayoutFrame[];
384
- grid?: JsLayoutGrid;
385
411
  }
386
412
 
387
413
  export interface JsLayoutRunList {
@@ -391,19 +417,13 @@ export interface JsLayoutRunList {
391
417
  runs: JsLayoutRun[];
392
418
  }
393
419
 
394
- export interface JsLayoutTable {
395
- width: number;
396
- height: number;
397
- columns: JsLayoutTableColumn[];
398
- rows: JsLayoutTableRow[];
399
- }
400
-
401
- export type JsLayoutRunContent = { type: "glyphs"; text: string; fontSize: number; ascent: number; descent: number; glyphs: JsLayoutGlyph[] } | { type: "space"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "tab"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "paragraphEnd"; advance: number } | { type: "break" } | { type: "inlineDrawing"; width: number; height: number };
402
-
403
- export interface JsLayoutTableRow {
404
- y: number;
405
- height: number;
406
- cells: JsLayoutTableCell[];
420
+ export interface JsTransform {
421
+ scaleX: number;
422
+ skewY: number;
423
+ skewX: number;
424
+ scaleY: number;
425
+ translateX: number;
426
+ translateY: number;
407
427
  }
408
428
 
409
429
  export interface JsLayoutGrid {
@@ -416,51 +436,31 @@ export interface JsLayoutGrid {
416
436
  rows: JsLayoutGridRow[];
417
437
  }
418
438
 
419
- export interface JsLayoutGridCell {
420
- colIndex: number;
439
+ export interface JsLayoutGridColumn {
421
440
  x: number;
422
- y: number;
423
441
  width: number;
424
- height: number;
425
- parcel?: JsLayoutParcel;
426
442
  }
427
443
 
428
- export interface JsLayoutGridColumn {
444
+ export interface JsLayoutRun {
429
445
  x: number;
430
446
  width: number;
447
+ transform: JsTransform;
448
+ content: JsLayoutRunContent;
431
449
  }
432
450
 
433
- export interface JsLayoutGlyph {
434
- x: number;
451
+ export interface JsLayoutGridRow {
435
452
  y: number;
436
- advance: number;
437
- /**
438
- * Byte offset of this glyph\'s source character relative to the parent run\'s text.
439
- */
440
- offset: number;
441
- }
442
-
443
- export interface JsLayoutFrame {
444
- transform: JsTransform;
445
- parcel?: JsLayoutParcel;
453
+ height: number;
454
+ cells: JsLayoutGridCell[];
446
455
  }
447
456
 
448
- export interface JsLayoutTableColumn {
449
- x: number;
457
+ export interface JsLayoutPage {
450
458
  width: number;
459
+ height: number;
460
+ frames: JsLayoutFrame[];
461
+ grid?: JsLayoutGrid;
451
462
  }
452
463
 
453
- export interface JsTransform {
454
- scaleX: number;
455
- skewY: number;
456
- skewX: number;
457
- scaleY: number;
458
- translateX: number;
459
- translateY: number;
460
- }
461
-
462
- export type JsLayoutLineContent = ({ type: "runList" } & JsLayoutRunList) | ({ type: "table" } & JsLayoutTable);
463
-
464
464
  /**
465
465
  * Result returned to JavaScript after license validation.
466
466
  */
@@ -491,11 +491,6 @@ export interface LicenseResult {
491
491
  expiresAt?: number;
492
492
  }
493
493
 
494
- /**
495
- * Destination display parameters for JavaScript serialization.
496
- */
497
- export type JsDestinationDisplay = { type: "xyz"; left: number | undefined; top: number | undefined; zoom: number | undefined } | { type: "fit" } | { type: "fitH"; top: number | undefined } | { type: "fitV"; left: number | undefined } | { type: "fitR"; left: number; top: number; right: number; bottom: number } | { type: "fitB" } | { type: "fitBH"; top: number | undefined } | { type: "fitBV"; left: number | undefined };
498
-
499
494
  /**
500
495
  * Destination for JavaScript serialization.
501
496
  */
@@ -504,6 +499,11 @@ export interface JsDestination {
504
499
  display: JsDestinationDisplay;
505
500
  }
506
501
 
502
+ /**
503
+ * Destination display parameters for JavaScript serialization.
504
+ */
505
+ export type JsDestinationDisplay = { type: "xyz"; left: number | undefined; top: number | undefined; zoom: number | undefined } | { type: "fit" } | { type: "fitH"; top: number | undefined } | { type: "fitV"; left: number | undefined } | { type: "fitR"; left: number; top: number; right: number; bottom: number } | { type: "fitB" } | { type: "fitBH"; top: number | undefined } | { type: "fitBV"; left: number | undefined };
506
+
507
507
  /**
508
508
  * Outline item for JavaScript serialization.
509
509
  */
@@ -1093,8 +1093,8 @@ export interface InitOutput {
1093
1093
  readonly wasm_set_visibility_group_visible: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1094
1094
  readonly wasm_setup_telemetry: (a: number, b: number, c: number) => void;
1095
1095
  readonly wasm_viewer_preferences: (a: number, b: number, c: number, d: number) => void;
1096
- readonly __wasm_bindgen_func_elem_4167: (a: number, b: number, c: number) => void;
1097
- readonly __wasm_bindgen_func_elem_4151: (a: number, b: number) => void;
1096
+ readonly __wasm_bindgen_func_elem_4169: (a: number, b: number, c: number) => void;
1097
+ readonly __wasm_bindgen_func_elem_4153: (a: number, b: number) => void;
1098
1098
  readonly __wasm_bindgen_func_elem_22364: (a: number, b: number, c: number, d: number) => void;
1099
1099
  readonly __wbindgen_export: (a: number, b: number) => number;
1100
1100
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
@@ -269,8 +269,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
269
269
 
270
270
  let WASM_VECTOR_LEN = 0;
271
271
 
272
- function __wasm_bindgen_func_elem_4167(arg0, arg1, arg2) {
273
- wasm.__wasm_bindgen_func_elem_4167(arg0, arg1, addHeapObject(arg2));
272
+ function __wasm_bindgen_func_elem_4169(arg0, arg1, arg2) {
273
+ wasm.__wasm_bindgen_func_elem_4169(arg0, arg1, addHeapObject(arg2));
274
274
  }
275
275
 
276
276
  function __wasm_bindgen_func_elem_22364(arg0, arg1, arg2, arg3) {
@@ -2558,7 +2558,7 @@ function __wbg_get_imports() {
2558
2558
  };
2559
2559
  imports.wbg.__wbindgen_cast_e95d7a09ad75920b = function(arg0, arg1) {
2560
2560
  // Cast intrinsic for `Closure(Closure { dtor_idx: 259, function: Function { arguments: [Externref], shim_idx: 260, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2561
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4151, __wasm_bindgen_func_elem_4167);
2561
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4153, __wasm_bindgen_func_elem_4169);
2562
2562
  return addHeapObject(ret);
2563
2563
  };
2564
2564
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
Binary file
@@ -49,8 +49,8 @@ export const wasm_set_license: (a: number, b: number, c: number) => number;
49
49
  export const wasm_set_visibility_group_visible: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
50
50
  export const wasm_setup_telemetry: (a: number, b: number, c: number) => void;
51
51
  export const wasm_viewer_preferences: (a: number, b: number, c: number, d: number) => void;
52
- export const __wasm_bindgen_func_elem_4167: (a: number, b: number, c: number) => void;
53
- export const __wasm_bindgen_func_elem_4151: (a: number, b: number) => void;
52
+ export const __wasm_bindgen_func_elem_4169: (a: number, b: number, c: number) => void;
53
+ export const __wasm_bindgen_func_elem_4153: (a: number, b: number) => void;
54
54
  export const __wasm_bindgen_func_elem_22364: (a: number, b: number, c: number, d: number) => void;
55
55
  export const __wbindgen_export: (a: number, b: number) => number;
56
56
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;