@laminapdf/wasm 0.2.0-alpha.2 → 0.2.0-alpha.3
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.
- package/dist/lamina_pdf_base.d.ts +13 -2
- package/dist/lamina_pdf_base.js +225 -84
- package/dist/lamina_pdf_base.wasm +0 -0
- package/dist/lamina_pdf_extract.d.ts +120 -8
- package/dist/lamina_pdf_extract.js +262 -89
- package/dist/lamina_pdf_extract.wasm +0 -0
- package/dist/lamina_pdf_render_hayro.wasm +0 -0
- package/dist/lamina_pdf_text.d.ts +120 -8
- package/dist/lamina_pdf_text.js +283 -98
- package/dist/lamina_pdf_text.wasm +0 -0
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export class WasmBuilder {
|
|
|
14
14
|
free() {
|
|
15
15
|
const ptr = this.__destroy_into_raw();
|
|
16
16
|
wasm.__wbg_wasmbuilder_free(ptr, 0);
|
|
17
|
+
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Attaches a file (`/EmbeddedFiles`, the catalog's `/AF`): `name`, its bytes and its MIME
|
|
@@ -33,7 +34,8 @@ export class WasmBuilder {
|
|
|
33
34
|
const len1 = WASM_VECTOR_LEN;
|
|
34
35
|
const ptr2 = passStringToWasm0(mime, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
35
36
|
const len2 = WASM_VECTOR_LEN;
|
|
36
|
-
|
|
37
|
+
let ret;
|
|
38
|
+
ret = wasm.wasmbuilder_attach(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, options);
|
|
37
39
|
if (ret[1]) {
|
|
38
40
|
throw takeFromExternrefTable0(ret[0]);
|
|
39
41
|
}
|
|
@@ -50,7 +52,8 @@ export class WasmBuilder {
|
|
|
50
52
|
destination(name, index, fit) {
|
|
51
53
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
52
54
|
const len0 = WASM_VECTOR_LEN;
|
|
53
|
-
|
|
55
|
+
let ret;
|
|
56
|
+
ret = wasm.wasmbuilder_destination(this.__wbg_ptr, ptr0, len0, index, fit);
|
|
54
57
|
if (ret[1]) {
|
|
55
58
|
throw takeFromExternrefTable0(ret[0]);
|
|
56
59
|
}
|
|
@@ -65,7 +68,8 @@ export class WasmBuilder {
|
|
|
65
68
|
* @returns {WasmDocument}
|
|
66
69
|
*/
|
|
67
70
|
finish() {
|
|
68
|
-
|
|
71
|
+
let ret;
|
|
72
|
+
ret = wasm.wasmbuilder_finish(this.__wbg_ptr);
|
|
69
73
|
if (ret[2]) {
|
|
70
74
|
throw takeFromExternrefTable0(ret[1]);
|
|
71
75
|
}
|
|
@@ -81,7 +85,8 @@ export class WasmBuilder {
|
|
|
81
85
|
lang(lang) {
|
|
82
86
|
const ptr0 = passStringToWasm0(lang, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
83
87
|
const len0 = WASM_VECTOR_LEN;
|
|
84
|
-
|
|
88
|
+
let ret;
|
|
89
|
+
ret = wasm.wasmbuilder_lang(this.__wbg_ptr, ptr0, len0);
|
|
85
90
|
if (ret[1]) {
|
|
86
91
|
throw takeFromExternrefTable0(ret[0]);
|
|
87
92
|
}
|
|
@@ -94,7 +99,8 @@ export class WasmBuilder {
|
|
|
94
99
|
* @param {MetadataInit} metadata
|
|
95
100
|
*/
|
|
96
101
|
metadata(metadata) {
|
|
97
|
-
|
|
102
|
+
let ret;
|
|
103
|
+
ret = wasm.wasmbuilder_metadata(this.__wbg_ptr, metadata);
|
|
98
104
|
if (ret[1]) {
|
|
99
105
|
throw takeFromExternrefTable0(ret[0]);
|
|
100
106
|
}
|
|
@@ -107,12 +113,14 @@ export class WasmBuilder {
|
|
|
107
113
|
* @param {BuildOptionsInit | undefined} options
|
|
108
114
|
*/
|
|
109
115
|
constructor(options) {
|
|
110
|
-
|
|
116
|
+
let ret;
|
|
117
|
+
ret = wasm.wasmbuilder_new(options);
|
|
111
118
|
if (ret[2]) {
|
|
112
119
|
throw takeFromExternrefTable0(ret[1]);
|
|
113
120
|
}
|
|
114
121
|
this.__wbg_ptr = ret[0];
|
|
115
|
-
|
|
122
|
+
Object.defineProperty(this, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
123
|
+
WasmBuilderFinalization.register(this, { ptr: ret[0], instance: __wbg_instance_id }, this);
|
|
116
124
|
return this;
|
|
117
125
|
}
|
|
118
126
|
/**
|
|
@@ -124,7 +132,8 @@ export class WasmBuilder {
|
|
|
124
132
|
* @returns {string[]}
|
|
125
133
|
*/
|
|
126
134
|
outline(entries) {
|
|
127
|
-
|
|
135
|
+
let ret;
|
|
136
|
+
ret = wasm.wasmbuilder_outline(this.__wbg_ptr, entries);
|
|
128
137
|
if (ret[2]) {
|
|
129
138
|
throw takeFromExternrefTable0(ret[1]);
|
|
130
139
|
}
|
|
@@ -138,7 +147,8 @@ export class WasmBuilder {
|
|
|
138
147
|
* @param {PageLabelInit[]} ranges
|
|
139
148
|
*/
|
|
140
149
|
pageLabels(ranges) {
|
|
141
|
-
|
|
150
|
+
let ret;
|
|
151
|
+
ret = wasm.wasmbuilder_pageLabels(this.__wbg_ptr, ranges);
|
|
142
152
|
if (ret[1]) {
|
|
143
153
|
throw takeFromExternrefTable0(ret[0]);
|
|
144
154
|
}
|
|
@@ -150,7 +160,8 @@ export class WasmBuilder {
|
|
|
150
160
|
* @returns {WasmPageBuilder}
|
|
151
161
|
*/
|
|
152
162
|
page(width, height) {
|
|
153
|
-
|
|
163
|
+
let ret;
|
|
164
|
+
ret = wasm.wasmbuilder_page(this.__wbg_ptr, width, height);
|
|
154
165
|
return WasmPageBuilder.__wrap(ret);
|
|
155
166
|
}
|
|
156
167
|
/**
|
|
@@ -161,7 +172,8 @@ export class WasmBuilder {
|
|
|
161
172
|
* @param {ViewerPreferencesInit} prefs
|
|
162
173
|
*/
|
|
163
174
|
viewerPreferences(prefs) {
|
|
164
|
-
|
|
175
|
+
let ret;
|
|
176
|
+
ret = wasm.wasmbuilder_viewerPreferences(this.__wbg_ptr, prefs);
|
|
165
177
|
if (ret[1]) {
|
|
166
178
|
throw takeFromExternrefTable0(ret[0]);
|
|
167
179
|
}
|
|
@@ -177,7 +189,9 @@ export class WasmDocument {
|
|
|
177
189
|
static __wrap(ptr) {
|
|
178
190
|
const obj = Object.create(WasmDocument.prototype);
|
|
179
191
|
obj.__wbg_ptr = ptr;
|
|
180
|
-
|
|
192
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
193
|
+
|
|
194
|
+
WasmDocumentFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
181
195
|
return obj;
|
|
182
196
|
}
|
|
183
197
|
__destroy_into_raw() {
|
|
@@ -189,6 +203,7 @@ export class WasmDocument {
|
|
|
189
203
|
free() {
|
|
190
204
|
const ptr = this.__destroy_into_raw();
|
|
191
205
|
wasm.__wbg_wasmdocument_free(ptr, 0);
|
|
206
|
+
|
|
192
207
|
}
|
|
193
208
|
/**
|
|
194
209
|
* Applies an op log (`{ "v": 1, "ops": [ … ] }`) as one transaction.
|
|
@@ -201,7 +216,8 @@ export class WasmDocument {
|
|
|
201
216
|
applyLog(json) {
|
|
202
217
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
203
218
|
const len0 = WASM_VECTOR_LEN;
|
|
204
|
-
|
|
219
|
+
let ret;
|
|
220
|
+
ret = wasm.wasmdocument_applyLog(this.__wbg_ptr, ptr0, len0);
|
|
205
221
|
if (ret[2]) {
|
|
206
222
|
throw takeFromExternrefTable0(ret[1]);
|
|
207
223
|
}
|
|
@@ -217,18 +233,49 @@ export class WasmDocument {
|
|
|
217
233
|
* @returns {EditedJs}
|
|
218
234
|
*/
|
|
219
235
|
apply(ops) {
|
|
220
|
-
|
|
236
|
+
let ret;
|
|
237
|
+
ret = wasm.wasmdocument_apply(this.__wbg_ptr, ops);
|
|
221
238
|
if (ret[2]) {
|
|
222
239
|
throw takeFromExternrefTable0(ret[1]);
|
|
223
240
|
}
|
|
224
241
|
return takeFromExternrefTable0(ret[0]);
|
|
225
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* The document's text for retrieval and LLMs, as one string: Markdown, plain text, the
|
|
245
|
+
* `laminapdf.extract/1` JSON, or the chunks as a JSON array (the extract and text modules).
|
|
246
|
+
*
|
|
247
|
+
* # Errors
|
|
248
|
+
* `page-index-out-of-range` for a page in `pages` past the end; `data-pending` and the
|
|
249
|
+
* reading errors; `unknown-option` / `invalid-argument` for bad options.
|
|
250
|
+
* @param {ExtractInit} options
|
|
251
|
+
* @returns {string}
|
|
252
|
+
*/
|
|
253
|
+
extract(options) {
|
|
254
|
+
let deferred2_0;
|
|
255
|
+
let deferred2_1;
|
|
256
|
+
try {
|
|
257
|
+
let ret;
|
|
258
|
+
ret = wasm.wasmdocument_extract(this.__wbg_ptr, options);
|
|
259
|
+
var ptr1 = ret[0];
|
|
260
|
+
var len1 = ret[1];
|
|
261
|
+
if (ret[3]) {
|
|
262
|
+
ptr1 = 0; len1 = 0;
|
|
263
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
264
|
+
}
|
|
265
|
+
deferred2_0 = ptr1;
|
|
266
|
+
deferred2_1 = len1;
|
|
267
|
+
return getStringFromWasm0(ptr1, len1);
|
|
268
|
+
} finally {
|
|
269
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
226
272
|
/**
|
|
227
273
|
* Whether there are changes no save has written yet.
|
|
228
274
|
* @returns {boolean}
|
|
229
275
|
*/
|
|
230
276
|
hasUnsavedChanges() {
|
|
231
|
-
|
|
277
|
+
let ret;
|
|
278
|
+
ret = wasm.wasmdocument_hasUnsavedChanges(this.__wbg_ptr);
|
|
232
279
|
return ret !== 0;
|
|
233
280
|
}
|
|
234
281
|
/**
|
|
@@ -239,7 +286,8 @@ export class WasmDocument {
|
|
|
239
286
|
* @returns {DocumentInfoJs}
|
|
240
287
|
*/
|
|
241
288
|
info() {
|
|
242
|
-
|
|
289
|
+
let ret;
|
|
290
|
+
ret = wasm.wasmdocument_info(this.__wbg_ptr);
|
|
243
291
|
if (ret[2]) {
|
|
244
292
|
throw takeFromExternrefTable0(ret[1]);
|
|
245
293
|
}
|
|
@@ -258,7 +306,8 @@ export class WasmDocument {
|
|
|
258
306
|
static openBytes(bytes, options) {
|
|
259
307
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
260
308
|
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
|
|
309
|
+
let ret;
|
|
310
|
+
ret = wasm.wasmdocument_openBytes(ptr0, len0, options);
|
|
262
311
|
if (ret[2]) {
|
|
263
312
|
throw takeFromExternrefTable0(ret[1]);
|
|
264
313
|
}
|
|
@@ -277,7 +326,8 @@ export class WasmDocument {
|
|
|
277
326
|
*/
|
|
278
327
|
static openSource(source, options) {
|
|
279
328
|
_assertClass(source, WasmSparseSource);
|
|
280
|
-
|
|
329
|
+
let ret;
|
|
330
|
+
ret = wasm.wasmdocument_openSource(source.__wbg_ptr, options);
|
|
281
331
|
if (ret[2]) {
|
|
282
332
|
throw takeFromExternrefTable0(ret[1]);
|
|
283
333
|
}
|
|
@@ -294,7 +344,8 @@ export class WasmDocument {
|
|
|
294
344
|
pageById(id) {
|
|
295
345
|
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
346
|
const len0 = WASM_VECTOR_LEN;
|
|
297
|
-
|
|
347
|
+
let ret;
|
|
348
|
+
ret = wasm.wasmdocument_pageById(this.__wbg_ptr, ptr0, len0);
|
|
298
349
|
if (ret[2]) {
|
|
299
350
|
throw takeFromExternrefTable0(ret[1]);
|
|
300
351
|
}
|
|
@@ -308,7 +359,8 @@ export class WasmDocument {
|
|
|
308
359
|
* @returns {number}
|
|
309
360
|
*/
|
|
310
361
|
pageCount() {
|
|
311
|
-
|
|
362
|
+
let ret;
|
|
363
|
+
ret = wasm.wasmdocument_pageCount(this.__wbg_ptr);
|
|
312
364
|
if (ret[2]) {
|
|
313
365
|
throw takeFromExternrefTable0(ret[1]);
|
|
314
366
|
}
|
|
@@ -323,7 +375,8 @@ export class WasmDocument {
|
|
|
323
375
|
* @returns {PageInfoJs}
|
|
324
376
|
*/
|
|
325
377
|
pageInfo(index) {
|
|
326
|
-
|
|
378
|
+
let ret;
|
|
379
|
+
ret = wasm.wasmdocument_pageInfo(this.__wbg_ptr, index);
|
|
327
380
|
if (ret[2]) {
|
|
328
381
|
throw takeFromExternrefTable0(ret[1]);
|
|
329
382
|
}
|
|
@@ -337,7 +390,8 @@ export class WasmDocument {
|
|
|
337
390
|
* @returns {PageInfoJs[]}
|
|
338
391
|
*/
|
|
339
392
|
pageInfos() {
|
|
340
|
-
|
|
393
|
+
let ret;
|
|
394
|
+
ret = wasm.wasmdocument_pageInfos(this.__wbg_ptr);
|
|
341
395
|
if (ret[2]) {
|
|
342
396
|
throw takeFromExternrefTable0(ret[1]);
|
|
343
397
|
}
|
|
@@ -352,7 +406,8 @@ export class WasmDocument {
|
|
|
352
406
|
* @returns {WasmPage}
|
|
353
407
|
*/
|
|
354
408
|
page(index) {
|
|
355
|
-
|
|
409
|
+
let ret;
|
|
410
|
+
ret = wasm.wasmdocument_page(this.__wbg_ptr, index);
|
|
356
411
|
if (ret[2]) {
|
|
357
412
|
throw takeFromExternrefTable0(ret[1]);
|
|
358
413
|
}
|
|
@@ -368,7 +423,8 @@ export class WasmDocument {
|
|
|
368
423
|
rebase(bytes) {
|
|
369
424
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
370
425
|
const len0 = WASM_VECTOR_LEN;
|
|
371
|
-
|
|
426
|
+
let ret;
|
|
427
|
+
ret = wasm.wasmdocument_rebase(this.__wbg_ptr, ptr0, len0);
|
|
372
428
|
if (ret[1]) {
|
|
373
429
|
throw takeFromExternrefTable0(ret[0]);
|
|
374
430
|
}
|
|
@@ -381,7 +437,8 @@ export class WasmDocument {
|
|
|
381
437
|
* @returns {UndoOutcomeJs | undefined}
|
|
382
438
|
*/
|
|
383
439
|
redo() {
|
|
384
|
-
|
|
440
|
+
let ret;
|
|
441
|
+
ret = wasm.wasmdocument_redo(this.__wbg_ptr);
|
|
385
442
|
if (ret[2]) {
|
|
386
443
|
throw takeFromExternrefTable0(ret[1]);
|
|
387
444
|
}
|
|
@@ -396,7 +453,8 @@ export class WasmDocument {
|
|
|
396
453
|
* @returns {WasmSaveJob}
|
|
397
454
|
*/
|
|
398
455
|
saveJob(options) {
|
|
399
|
-
|
|
456
|
+
let ret;
|
|
457
|
+
ret = wasm.wasmdocument_saveJob(this.__wbg_ptr, options);
|
|
400
458
|
if (ret[2]) {
|
|
401
459
|
throw takeFromExternrefTable0(ret[1]);
|
|
402
460
|
}
|
|
@@ -411,7 +469,8 @@ export class WasmDocument {
|
|
|
411
469
|
* @returns {{ bytes: Uint8Array<ArrayBuffer>; report: SaveReportJs }}
|
|
412
470
|
*/
|
|
413
471
|
save(options) {
|
|
414
|
-
|
|
472
|
+
let ret;
|
|
473
|
+
ret = wasm.wasmdocument_save(this.__wbg_ptr, options);
|
|
415
474
|
if (ret[2]) {
|
|
416
475
|
throw takeFromExternrefTable0(ret[1]);
|
|
417
476
|
}
|
|
@@ -425,7 +484,8 @@ export class WasmDocument {
|
|
|
425
484
|
* @returns {UndoOutcomeJs | undefined}
|
|
426
485
|
*/
|
|
427
486
|
undo() {
|
|
428
|
-
|
|
487
|
+
let ret;
|
|
488
|
+
ret = wasm.wasmdocument_undo(this.__wbg_ptr);
|
|
429
489
|
if (ret[2]) {
|
|
430
490
|
throw takeFromExternrefTable0(ret[1]);
|
|
431
491
|
}
|
|
@@ -436,7 +496,8 @@ export class WasmDocument {
|
|
|
436
496
|
* @returns {WasmWarningCursor}
|
|
437
497
|
*/
|
|
438
498
|
warnings() {
|
|
439
|
-
|
|
499
|
+
let ret;
|
|
500
|
+
ret = wasm.wasmdocument_warnings(this.__wbg_ptr);
|
|
440
501
|
return WasmWarningCursor.__wrap(ret);
|
|
441
502
|
}
|
|
442
503
|
}
|
|
@@ -449,7 +510,9 @@ export class WasmImage {
|
|
|
449
510
|
static __wrap(ptr) {
|
|
450
511
|
const obj = Object.create(WasmImage.prototype);
|
|
451
512
|
obj.__wbg_ptr = ptr;
|
|
452
|
-
|
|
513
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
514
|
+
|
|
515
|
+
WasmImageFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
453
516
|
return obj;
|
|
454
517
|
}
|
|
455
518
|
__destroy_into_raw() {
|
|
@@ -461,13 +524,15 @@ export class WasmImage {
|
|
|
461
524
|
free() {
|
|
462
525
|
const ptr = this.__destroy_into_raw();
|
|
463
526
|
wasm.__wbg_wasmimage_free(ptr, 0);
|
|
527
|
+
|
|
464
528
|
}
|
|
465
529
|
/**
|
|
466
530
|
* Height in pixels.
|
|
467
531
|
* @returns {number}
|
|
468
532
|
*/
|
|
469
533
|
get height() {
|
|
470
|
-
|
|
534
|
+
let ret;
|
|
535
|
+
ret = wasm.wasmimage_height(this.__wbg_ptr);
|
|
471
536
|
return ret >>> 0;
|
|
472
537
|
}
|
|
473
538
|
/**
|
|
@@ -481,7 +546,8 @@ export class WasmImage {
|
|
|
481
546
|
static jpeg(bytes) {
|
|
482
547
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
483
548
|
const len0 = WASM_VECTOR_LEN;
|
|
484
|
-
|
|
549
|
+
let ret;
|
|
550
|
+
ret = wasm.wasmimage_jpeg(ptr0, len0);
|
|
485
551
|
if (ret[2]) {
|
|
486
552
|
throw takeFromExternrefTable0(ret[1]);
|
|
487
553
|
}
|
|
@@ -498,7 +564,8 @@ export class WasmImage {
|
|
|
498
564
|
static png(bytes) {
|
|
499
565
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
500
566
|
const len0 = WASM_VECTOR_LEN;
|
|
501
|
-
|
|
567
|
+
let ret;
|
|
568
|
+
ret = wasm.wasmimage_png(ptr0, len0);
|
|
502
569
|
if (ret[2]) {
|
|
503
570
|
throw takeFromExternrefTable0(ret[1]);
|
|
504
571
|
}
|
|
@@ -517,7 +584,8 @@ export class WasmImage {
|
|
|
517
584
|
static rgba(width, height, rgba) {
|
|
518
585
|
const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
|
|
519
586
|
const len0 = WASM_VECTOR_LEN;
|
|
520
|
-
|
|
587
|
+
let ret;
|
|
588
|
+
ret = wasm.wasmimage_rgba(width, height, ptr0, len0);
|
|
521
589
|
if (ret[2]) {
|
|
522
590
|
throw takeFromExternrefTable0(ret[1]);
|
|
523
591
|
}
|
|
@@ -528,7 +596,8 @@ export class WasmImage {
|
|
|
528
596
|
* @returns {number}
|
|
529
597
|
*/
|
|
530
598
|
get width() {
|
|
531
|
-
|
|
599
|
+
let ret;
|
|
600
|
+
ret = wasm.wasmimage_width(this.__wbg_ptr);
|
|
532
601
|
return ret >>> 0;
|
|
533
602
|
}
|
|
534
603
|
}
|
|
@@ -541,7 +610,9 @@ export class WasmPage {
|
|
|
541
610
|
static __wrap(ptr) {
|
|
542
611
|
const obj = Object.create(WasmPage.prototype);
|
|
543
612
|
obj.__wbg_ptr = ptr;
|
|
544
|
-
|
|
613
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
614
|
+
|
|
615
|
+
WasmPageFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
545
616
|
return obj;
|
|
546
617
|
}
|
|
547
618
|
__destroy_into_raw() {
|
|
@@ -553,6 +624,7 @@ export class WasmPage {
|
|
|
553
624
|
free() {
|
|
554
625
|
const ptr = this.__destroy_into_raw();
|
|
555
626
|
wasm.__wbg_wasmpage_free(ptr, 0);
|
|
627
|
+
|
|
556
628
|
}
|
|
557
629
|
/**
|
|
558
630
|
* The page's stable ID (`p12.0`).
|
|
@@ -562,7 +634,8 @@ export class WasmPage {
|
|
|
562
634
|
let deferred1_0;
|
|
563
635
|
let deferred1_1;
|
|
564
636
|
try {
|
|
565
|
-
|
|
637
|
+
let ret;
|
|
638
|
+
ret = wasm.wasmpage_id(this.__wbg_ptr);
|
|
566
639
|
deferred1_0 = ret[0];
|
|
567
640
|
deferred1_1 = ret[1];
|
|
568
641
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -574,11 +647,13 @@ export class WasmPage {
|
|
|
574
647
|
* The page's current 0-based index.
|
|
575
648
|
*
|
|
576
649
|
* # Errors
|
|
577
|
-
* `unknown-page` when the page is gone; reading
|
|
650
|
+
* `unknown-page` when the page is gone; `disposed` when its document is freed; reading
|
|
651
|
+
* errors.
|
|
578
652
|
* @returns {number}
|
|
579
653
|
*/
|
|
580
654
|
index() {
|
|
581
|
-
|
|
655
|
+
let ret;
|
|
656
|
+
ret = wasm.wasmpage_index(this.__wbg_ptr);
|
|
582
657
|
if (ret[2]) {
|
|
583
658
|
throw takeFromExternrefTable0(ret[1]);
|
|
584
659
|
}
|
|
@@ -592,24 +667,26 @@ export class WasmPage {
|
|
|
592
667
|
* @returns {PageInfoJs}
|
|
593
668
|
*/
|
|
594
669
|
info() {
|
|
595
|
-
|
|
670
|
+
let ret;
|
|
671
|
+
ret = wasm.wasmpage_info(this.__wbg_ptr);
|
|
596
672
|
if (ret[2]) {
|
|
597
673
|
throw takeFromExternrefTable0(ret[1]);
|
|
598
674
|
}
|
|
599
675
|
return takeFromExternrefTable0(ret[0]);
|
|
600
676
|
}
|
|
601
677
|
/**
|
|
602
|
-
* The page's text: lines, runs, glyph quads and glyph text (
|
|
603
|
-
* modules).
|
|
678
|
+
* The page's text: lines, runs, glyph quads and glyph text (the extract and text modules).
|
|
604
679
|
*
|
|
605
680
|
* # Errors
|
|
606
|
-
* `unknown-page` when the page is gone; `
|
|
607
|
-
* `unknown-option` / `invalid-argument` for bad
|
|
681
|
+
* `unknown-page` when the page is gone; `disposed` when its document is freed;
|
|
682
|
+
* `data-pending` and the reading errors; `unknown-option` / `invalid-argument` for bad
|
|
683
|
+
* options.
|
|
608
684
|
* @param {TextOptionsInit | undefined} options
|
|
609
685
|
* @returns {PageTextJs}
|
|
610
686
|
*/
|
|
611
687
|
text(options) {
|
|
612
|
-
|
|
688
|
+
let ret;
|
|
689
|
+
ret = wasm.wasmpage_text(this.__wbg_ptr, options);
|
|
613
690
|
if (ret[2]) {
|
|
614
691
|
throw takeFromExternrefTable0(ret[1]);
|
|
615
692
|
}
|
|
@@ -626,7 +703,9 @@ export class WasmPageBuilder {
|
|
|
626
703
|
static __wrap(ptr) {
|
|
627
704
|
const obj = Object.create(WasmPageBuilder.prototype);
|
|
628
705
|
obj.__wbg_ptr = ptr;
|
|
629
|
-
|
|
706
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
707
|
+
|
|
708
|
+
WasmPageBuilderFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
630
709
|
return obj;
|
|
631
710
|
}
|
|
632
711
|
__destroy_into_raw() {
|
|
@@ -638,6 +717,7 @@ export class WasmPageBuilder {
|
|
|
638
717
|
free() {
|
|
639
718
|
const ptr = this.__destroy_into_raw();
|
|
640
719
|
wasm.__wbg_wasmpagebuilder_free(ptr, 0);
|
|
720
|
+
|
|
641
721
|
}
|
|
642
722
|
/**
|
|
643
723
|
* Opens an artifact until the matching `endTag`: `kind` is `layout`, `page`, `pagination`
|
|
@@ -650,7 +730,8 @@ export class WasmPageBuilder {
|
|
|
650
730
|
beginArtifact(kind) {
|
|
651
731
|
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
652
732
|
const len0 = WASM_VECTOR_LEN;
|
|
653
|
-
|
|
733
|
+
let ret;
|
|
734
|
+
ret = wasm.wasmpagebuilder_beginArtifact(this.__wbg_ptr, ptr0, len0);
|
|
654
735
|
if (ret[1]) {
|
|
655
736
|
throw takeFromExternrefTable0(ret[0]);
|
|
656
737
|
}
|
|
@@ -687,7 +768,8 @@ export class WasmPageBuilder {
|
|
|
687
768
|
var len5 = WASM_VECTOR_LEN;
|
|
688
769
|
var ptr6 = isLikeNone(scope) ? 0 : passStringToWasm0(scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
689
770
|
var len6 = WASM_VECTOR_LEN;
|
|
690
|
-
|
|
771
|
+
let ret;
|
|
772
|
+
ret = wasm.wasmpagebuilder_beginTag(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
691
773
|
if (ret[1]) {
|
|
692
774
|
throw takeFromExternrefTable0(ret[0]);
|
|
693
775
|
}
|
|
@@ -702,7 +784,8 @@ export class WasmPageBuilder {
|
|
|
702
784
|
blendMode(mode) {
|
|
703
785
|
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
704
786
|
const len0 = WASM_VECTOR_LEN;
|
|
705
|
-
|
|
787
|
+
let ret;
|
|
788
|
+
ret = wasm.wasmpagebuilder_blendMode(this.__wbg_ptr, ptr0, len0);
|
|
706
789
|
if (ret[1]) {
|
|
707
790
|
throw takeFromExternrefTable0(ret[0]);
|
|
708
791
|
}
|
|
@@ -720,7 +803,8 @@ export class WasmPageBuilder {
|
|
|
720
803
|
const len0 = WASM_VECTOR_LEN;
|
|
721
804
|
const ptr1 = passStringToWasm0(rule, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
722
805
|
const len1 = WASM_VECTOR_LEN;
|
|
723
|
-
|
|
806
|
+
let ret;
|
|
807
|
+
ret = wasm.wasmpagebuilder_clipPath(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
724
808
|
if (ret[1]) {
|
|
725
809
|
throw takeFromExternrefTable0(ret[0]);
|
|
726
810
|
}
|
|
@@ -732,7 +816,8 @@ export class WasmPageBuilder {
|
|
|
732
816
|
* `builder-finished`.
|
|
733
817
|
*/
|
|
734
818
|
endTag() {
|
|
735
|
-
|
|
819
|
+
let ret;
|
|
820
|
+
ret = wasm.wasmpagebuilder_endTag(this.__wbg_ptr);
|
|
736
821
|
if (ret[1]) {
|
|
737
822
|
throw takeFromExternrefTable0(ret[0]);
|
|
738
823
|
}
|
|
@@ -747,7 +832,8 @@ export class WasmPageBuilder {
|
|
|
747
832
|
fillColorHex(hex) {
|
|
748
833
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
749
834
|
const len0 = WASM_VECTOR_LEN;
|
|
750
|
-
|
|
835
|
+
let ret;
|
|
836
|
+
ret = wasm.wasmpagebuilder_fillColorHex(this.__wbg_ptr, ptr0, len0);
|
|
751
837
|
if (ret[1]) {
|
|
752
838
|
throw takeFromExternrefTable0(ret[0]);
|
|
753
839
|
}
|
|
@@ -762,7 +848,8 @@ export class WasmPageBuilder {
|
|
|
762
848
|
fillColor(components) {
|
|
763
849
|
const ptr0 = passArrayF64ToWasm0(components, wasm.__wbindgen_malloc);
|
|
764
850
|
const len0 = WASM_VECTOR_LEN;
|
|
765
|
-
|
|
851
|
+
let ret;
|
|
852
|
+
ret = wasm.wasmpagebuilder_fillColor(this.__wbg_ptr, ptr0, len0);
|
|
766
853
|
if (ret[1]) {
|
|
767
854
|
throw takeFromExternrefTable0(ret[0]);
|
|
768
855
|
}
|
|
@@ -780,7 +867,8 @@ export class WasmPageBuilder {
|
|
|
780
867
|
const len0 = WASM_VECTOR_LEN;
|
|
781
868
|
const ptr1 = passStringToWasm0(rule, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
782
869
|
const len1 = WASM_VECTOR_LEN;
|
|
783
|
-
|
|
870
|
+
let ret;
|
|
871
|
+
ret = wasm.wasmpagebuilder_fillPath(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
784
872
|
if (ret[1]) {
|
|
785
873
|
throw takeFromExternrefTable0(ret[0]);
|
|
786
874
|
}
|
|
@@ -798,7 +886,8 @@ export class WasmPageBuilder {
|
|
|
798
886
|
const len0 = WASM_VECTOR_LEN;
|
|
799
887
|
const ptr1 = passStringToWasm0(rule, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
800
888
|
const len1 = WASM_VECTOR_LEN;
|
|
801
|
-
|
|
889
|
+
let ret;
|
|
890
|
+
ret = wasm.wasmpagebuilder_fillStrokePath(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
802
891
|
if (ret[1]) {
|
|
803
892
|
throw takeFromExternrefTable0(ret[0]);
|
|
804
893
|
}
|
|
@@ -817,7 +906,8 @@ export class WasmPageBuilder {
|
|
|
817
906
|
let deferred2_0;
|
|
818
907
|
let deferred2_1;
|
|
819
908
|
try {
|
|
820
|
-
|
|
909
|
+
let ret;
|
|
910
|
+
ret = wasm.wasmpagebuilder_finish(this.__wbg_ptr);
|
|
821
911
|
var ptr1 = ret[0];
|
|
822
912
|
var len1 = ret[1];
|
|
823
913
|
if (ret[3]) {
|
|
@@ -844,7 +934,8 @@ export class WasmPageBuilder {
|
|
|
844
934
|
*/
|
|
845
935
|
image(image, x, y, width, height) {
|
|
846
936
|
_assertClass(image, WasmImage);
|
|
847
|
-
|
|
937
|
+
let ret;
|
|
938
|
+
ret = wasm.wasmpagebuilder_image(this.__wbg_ptr, image.__wbg_ptr, x, y, width, height);
|
|
848
939
|
if (ret[1]) {
|
|
849
940
|
throw takeFromExternrefTable0(ret[0]);
|
|
850
941
|
}
|
|
@@ -864,7 +955,8 @@ export class WasmPageBuilder {
|
|
|
864
955
|
link(x, y, width, height, target, contents) {
|
|
865
956
|
var ptr0 = isLikeNone(contents) ? 0 : passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
866
957
|
var len0 = WASM_VECTOR_LEN;
|
|
867
|
-
|
|
958
|
+
let ret;
|
|
959
|
+
ret = wasm.wasmpagebuilder_link(this.__wbg_ptr, x, y, width, height, target, ptr0, len0);
|
|
868
960
|
if (ret[1]) {
|
|
869
961
|
throw takeFromExternrefTable0(ret[0]);
|
|
870
962
|
}
|
|
@@ -878,7 +970,8 @@ export class WasmPageBuilder {
|
|
|
878
970
|
* @param {number} stroke
|
|
879
971
|
*/
|
|
880
972
|
opacity(fill, stroke) {
|
|
881
|
-
|
|
973
|
+
let ret;
|
|
974
|
+
ret = wasm.wasmpagebuilder_opacity(this.__wbg_ptr, fill, stroke);
|
|
882
975
|
if (ret[1]) {
|
|
883
976
|
throw takeFromExternrefTable0(ret[0]);
|
|
884
977
|
}
|
|
@@ -890,7 +983,8 @@ export class WasmPageBuilder {
|
|
|
890
983
|
* `builder-finished`.
|
|
891
984
|
*/
|
|
892
985
|
restore() {
|
|
893
|
-
|
|
986
|
+
let ret;
|
|
987
|
+
ret = wasm.wasmpagebuilder_restore(this.__wbg_ptr);
|
|
894
988
|
if (ret[1]) {
|
|
895
989
|
throw takeFromExternrefTable0(ret[0]);
|
|
896
990
|
}
|
|
@@ -903,7 +997,8 @@ export class WasmPageBuilder {
|
|
|
903
997
|
* @param {number} degrees
|
|
904
998
|
*/
|
|
905
999
|
rotate(degrees) {
|
|
906
|
-
|
|
1000
|
+
let ret;
|
|
1001
|
+
ret = wasm.wasmpagebuilder_rotate(this.__wbg_ptr, degrees);
|
|
907
1002
|
if (ret[1]) {
|
|
908
1003
|
throw takeFromExternrefTable0(ret[0]);
|
|
909
1004
|
}
|
|
@@ -915,7 +1010,8 @@ export class WasmPageBuilder {
|
|
|
915
1010
|
* `builder-finished` after [`WasmPageBuilder::finish`] (so does every drawing method).
|
|
916
1011
|
*/
|
|
917
1012
|
save() {
|
|
918
|
-
|
|
1013
|
+
let ret;
|
|
1014
|
+
ret = wasm.wasmpagebuilder_save(this.__wbg_ptr);
|
|
919
1015
|
if (ret[1]) {
|
|
920
1016
|
throw takeFromExternrefTable0(ret[0]);
|
|
921
1017
|
}
|
|
@@ -935,7 +1031,8 @@ export class WasmPageBuilder {
|
|
|
935
1031
|
setBox(kind, x, y, width, height) {
|
|
936
1032
|
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
937
1033
|
const len0 = WASM_VECTOR_LEN;
|
|
938
|
-
|
|
1034
|
+
let ret;
|
|
1035
|
+
ret = wasm.wasmpagebuilder_setBox(this.__wbg_ptr, ptr0, len0, x, y, width, height);
|
|
939
1036
|
if (ret[1]) {
|
|
940
1037
|
throw takeFromExternrefTable0(ret[0]);
|
|
941
1038
|
}
|
|
@@ -950,7 +1047,8 @@ export class WasmPageBuilder {
|
|
|
950
1047
|
strokeColorHex(hex) {
|
|
951
1048
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
952
1049
|
const len0 = WASM_VECTOR_LEN;
|
|
953
|
-
|
|
1050
|
+
let ret;
|
|
1051
|
+
ret = wasm.wasmpagebuilder_strokeColorHex(this.__wbg_ptr, ptr0, len0);
|
|
954
1052
|
if (ret[1]) {
|
|
955
1053
|
throw takeFromExternrefTable0(ret[0]);
|
|
956
1054
|
}
|
|
@@ -965,7 +1063,8 @@ export class WasmPageBuilder {
|
|
|
965
1063
|
strokeColor(components) {
|
|
966
1064
|
const ptr0 = passArrayF64ToWasm0(components, wasm.__wbindgen_malloc);
|
|
967
1065
|
const len0 = WASM_VECTOR_LEN;
|
|
968
|
-
|
|
1066
|
+
let ret;
|
|
1067
|
+
ret = wasm.wasmpagebuilder_strokeColor(this.__wbg_ptr, ptr0, len0);
|
|
969
1068
|
if (ret[1]) {
|
|
970
1069
|
throw takeFromExternrefTable0(ret[0]);
|
|
971
1070
|
}
|
|
@@ -980,7 +1079,8 @@ export class WasmPageBuilder {
|
|
|
980
1079
|
strokePath(path) {
|
|
981
1080
|
const ptr0 = passArrayF64ToWasm0(path, wasm.__wbindgen_malloc);
|
|
982
1081
|
const len0 = WASM_VECTOR_LEN;
|
|
983
|
-
|
|
1082
|
+
let ret;
|
|
1083
|
+
ret = wasm.wasmpagebuilder_strokePath(this.__wbg_ptr, ptr0, len0);
|
|
984
1084
|
if (ret[1]) {
|
|
985
1085
|
throw takeFromExternrefTable0(ret[0]);
|
|
986
1086
|
}
|
|
@@ -1005,7 +1105,8 @@ export class WasmPageBuilder {
|
|
|
1005
1105
|
const len1 = WASM_VECTOR_LEN;
|
|
1006
1106
|
const ptr2 = passArrayF64ToWasm0(dash, wasm.__wbindgen_malloc);
|
|
1007
1107
|
const len2 = WASM_VECTOR_LEN;
|
|
1008
|
-
|
|
1108
|
+
let ret;
|
|
1109
|
+
ret = wasm.wasmpagebuilder_strokeStyle(this.__wbg_ptr, width, ptr0, len0, ptr1, len1, miterLimit, ptr2, len2, dashPhase);
|
|
1009
1110
|
if (ret[1]) {
|
|
1010
1111
|
throw takeFromExternrefTable0(ret[0]);
|
|
1011
1112
|
}
|
|
@@ -1020,7 +1121,8 @@ export class WasmPageBuilder {
|
|
|
1020
1121
|
transform(m) {
|
|
1021
1122
|
const ptr0 = passArrayF64ToWasm0(m, wasm.__wbindgen_malloc);
|
|
1022
1123
|
const len0 = WASM_VECTOR_LEN;
|
|
1023
|
-
|
|
1124
|
+
let ret;
|
|
1125
|
+
ret = wasm.wasmpagebuilder_transform(this.__wbg_ptr, ptr0, len0);
|
|
1024
1126
|
if (ret[1]) {
|
|
1025
1127
|
throw takeFromExternrefTable0(ret[0]);
|
|
1026
1128
|
}
|
|
@@ -1043,7 +1145,9 @@ export class WasmSaveJob {
|
|
|
1043
1145
|
static __wrap(ptr) {
|
|
1044
1146
|
const obj = Object.create(WasmSaveJob.prototype);
|
|
1045
1147
|
obj.__wbg_ptr = ptr;
|
|
1046
|
-
|
|
1148
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
1149
|
+
|
|
1150
|
+
WasmSaveJobFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
1047
1151
|
return obj;
|
|
1048
1152
|
}
|
|
1049
1153
|
__destroy_into_raw() {
|
|
@@ -1055,6 +1159,7 @@ export class WasmSaveJob {
|
|
|
1055
1159
|
free() {
|
|
1056
1160
|
const ptr = this.__destroy_into_raw();
|
|
1057
1161
|
wasm.__wbg_wasmsavejob_free(ptr, 0);
|
|
1162
|
+
|
|
1058
1163
|
}
|
|
1059
1164
|
/**
|
|
1060
1165
|
* Stops the job: its next step fails with `cancelled`.
|
|
@@ -1067,12 +1172,14 @@ export class WasmSaveJob {
|
|
|
1067
1172
|
* `{ state: "done", bytes, report }`.
|
|
1068
1173
|
*
|
|
1069
1174
|
* # Errors
|
|
1070
|
-
* `cancelled`, `document-changed`, `job-finished`,
|
|
1175
|
+
* `cancelled`, `document-changed`, `job-finished`, `disposed` when the document is freed,
|
|
1176
|
+
* or the save's own errors.
|
|
1071
1177
|
* @param {number} budget
|
|
1072
1178
|
* @returns {({ state: "progress" } & ProgressJs) | { state: "done"; bytes: Uint8Array<ArrayBuffer>; report: SaveReportJs }}
|
|
1073
1179
|
*/
|
|
1074
1180
|
step(budget) {
|
|
1075
|
-
|
|
1181
|
+
let ret;
|
|
1182
|
+
ret = wasm.wasmsavejob_step(this.__wbg_ptr, budget);
|
|
1076
1183
|
if (ret[2]) {
|
|
1077
1184
|
throw takeFromExternrefTable0(ret[1]);
|
|
1078
1185
|
}
|
|
@@ -1095,6 +1202,7 @@ export class WasmSparseSource {
|
|
|
1095
1202
|
free() {
|
|
1096
1203
|
const ptr = this.__destroy_into_raw();
|
|
1097
1204
|
wasm.__wbg_wasmsparsesource_free(ptr, 0);
|
|
1205
|
+
|
|
1098
1206
|
}
|
|
1099
1207
|
/**
|
|
1100
1208
|
* An empty source of `size` bytes holding at most `budget` bytes (no limit when omitted).
|
|
@@ -1105,12 +1213,14 @@ export class WasmSparseSource {
|
|
|
1105
1213
|
* @param {number | null} [budget]
|
|
1106
1214
|
*/
|
|
1107
1215
|
constructor(size, budget) {
|
|
1108
|
-
|
|
1216
|
+
let ret;
|
|
1217
|
+
ret = wasm.wasmsparsesource_new(size, !isLikeNone(budget), isLikeNone(budget) ? 0 : budget);
|
|
1109
1218
|
if (ret[2]) {
|
|
1110
1219
|
throw takeFromExternrefTable0(ret[1]);
|
|
1111
1220
|
}
|
|
1112
1221
|
this.__wbg_ptr = ret[0];
|
|
1113
|
-
|
|
1222
|
+
Object.defineProperty(this, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
1223
|
+
WasmSparseSourceFinalization.register(this, { ptr: ret[0], instance: __wbg_instance_id }, this);
|
|
1114
1224
|
return this;
|
|
1115
1225
|
}
|
|
1116
1226
|
/**
|
|
@@ -1118,7 +1228,8 @@ export class WasmSparseSource {
|
|
|
1118
1228
|
* @returns {number}
|
|
1119
1229
|
*/
|
|
1120
1230
|
get size() {
|
|
1121
|
-
|
|
1231
|
+
let ret;
|
|
1232
|
+
ret = wasm.wasmsparsesource_size(this.__wbg_ptr);
|
|
1122
1233
|
return ret;
|
|
1123
1234
|
}
|
|
1124
1235
|
/**
|
|
@@ -1132,7 +1243,8 @@ export class WasmSparseSource {
|
|
|
1132
1243
|
supply(offset, bytes) {
|
|
1133
1244
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
1134
1245
|
const len0 = WASM_VECTOR_LEN;
|
|
1135
|
-
|
|
1246
|
+
let ret;
|
|
1247
|
+
ret = wasm.wasmsparsesource_supply(this.__wbg_ptr, offset, ptr0, len0);
|
|
1136
1248
|
if (ret[1]) {
|
|
1137
1249
|
throw takeFromExternrefTable0(ret[0]);
|
|
1138
1250
|
}
|
|
@@ -1153,7 +1265,8 @@ export class WasmSparseSource {
|
|
|
1153
1265
|
toFetch(asked, block, readahead) {
|
|
1154
1266
|
const ptr0 = passArrayF64ToWasm0(asked, wasm.__wbindgen_malloc);
|
|
1155
1267
|
const len0 = WASM_VECTOR_LEN;
|
|
1156
|
-
|
|
1268
|
+
let ret;
|
|
1269
|
+
ret = wasm.wasmsparsesource_toFetch(this.__wbg_ptr, ptr0, len0, block, readahead);
|
|
1157
1270
|
if (ret[2]) {
|
|
1158
1271
|
throw takeFromExternrefTable0(ret[1]);
|
|
1159
1272
|
}
|
|
@@ -1169,7 +1282,9 @@ export class WasmWarningCursor {
|
|
|
1169
1282
|
static __wrap(ptr) {
|
|
1170
1283
|
const obj = Object.create(WasmWarningCursor.prototype);
|
|
1171
1284
|
obj.__wbg_ptr = ptr;
|
|
1172
|
-
|
|
1285
|
+
Object.defineProperty(obj, '__wbg_inst', { value: __wbg_instance_id, writable: true });
|
|
1286
|
+
|
|
1287
|
+
WasmWarningCursorFinalization.register(obj, { ptr, instance: __wbg_instance_id }, obj);
|
|
1173
1288
|
return obj;
|
|
1174
1289
|
}
|
|
1175
1290
|
__destroy_into_raw() {
|
|
@@ -1181,6 +1296,7 @@ export class WasmWarningCursor {
|
|
|
1181
1296
|
free() {
|
|
1182
1297
|
const ptr = this.__destroy_into_raw();
|
|
1183
1298
|
wasm.__wbg_wasmwarningcursor_free(ptr, 0);
|
|
1299
|
+
|
|
1184
1300
|
}
|
|
1185
1301
|
/**
|
|
1186
1302
|
* Up to `max` more warnings, each as the ADR 0026 §1 object; empty at the end.
|
|
@@ -1188,7 +1304,8 @@ export class WasmWarningCursor {
|
|
|
1188
1304
|
* @returns {Diagnostic[]}
|
|
1189
1305
|
*/
|
|
1190
1306
|
nextBatch(max) {
|
|
1191
|
-
|
|
1307
|
+
let ret;
|
|
1308
|
+
ret = wasm.wasmwarningcursor_nextBatch(this.__wbg_ptr, max);
|
|
1192
1309
|
return ret;
|
|
1193
1310
|
}
|
|
1194
1311
|
/**
|
|
@@ -1196,18 +1313,46 @@ export class WasmWarningCursor {
|
|
|
1196
1313
|
* @returns {number}
|
|
1197
1314
|
*/
|
|
1198
1315
|
remaining() {
|
|
1199
|
-
|
|
1316
|
+
let ret;
|
|
1317
|
+
ret = wasm.wasmwarningcursor_remaining(this.__wbg_ptr);
|
|
1200
1318
|
return ret >>> 0;
|
|
1201
1319
|
}
|
|
1202
1320
|
}
|
|
1203
1321
|
if (Symbol.dispose) WasmWarningCursor.prototype[Symbol.dispose] = WasmWarningCursor.prototype.free;
|
|
1204
1322
|
|
|
1323
|
+
export function __wbg_reset_state () {
|
|
1324
|
+
__wbg_instance_id++;
|
|
1325
|
+
cachedDataViewMemory0 = null;
|
|
1326
|
+
cachedFloat32ArrayMemory0 = null;
|
|
1327
|
+
cachedFloat64ArrayMemory0 = null;
|
|
1328
|
+
cachedUint32ArrayMemory0 = null;
|
|
1329
|
+
cachedUint8ArrayMemory0 = null;
|
|
1330
|
+
if (typeof numBytesDecoded !== 'undefined') numBytesDecoded = 0;
|
|
1331
|
+
if (typeof WASM_VECTOR_LEN !== 'undefined') WASM_VECTOR_LEN = 0;
|
|
1332
|
+
__wbg_reinit_scheduled = false;
|
|
1333
|
+
wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
1334
|
+
wasm = wasmInstance.exports;
|
|
1335
|
+
wasm.__wbindgen_start();
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Whether the most recent allocation failed: after a trap, `true` means the module ran out of
|
|
1340
|
+
* memory.
|
|
1341
|
+
* @returns {boolean}
|
|
1342
|
+
*/
|
|
1343
|
+
export function allocationFailed() {
|
|
1344
|
+
let ret;
|
|
1345
|
+
ret = wasm.allocationFailed();
|
|
1346
|
+
return ret !== 0;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1205
1349
|
/**
|
|
1206
1350
|
* Whether this module is the text module (fonts, `text`, `textBox`).
|
|
1207
1351
|
* @returns {boolean}
|
|
1208
1352
|
*/
|
|
1209
1353
|
export function hasText() {
|
|
1210
|
-
|
|
1354
|
+
let ret;
|
|
1355
|
+
ret = wasm.hasText();
|
|
1211
1356
|
return ret !== 0;
|
|
1212
1357
|
}
|
|
1213
1358
|
|
|
@@ -1219,7 +1364,8 @@ export function version() {
|
|
|
1219
1364
|
let deferred1_0;
|
|
1220
1365
|
let deferred1_1;
|
|
1221
1366
|
try {
|
|
1222
|
-
|
|
1367
|
+
let ret;
|
|
1368
|
+
ret = wasm.version();
|
|
1223
1369
|
deferred1_0 = ret[0];
|
|
1224
1370
|
deferred1_1 = ret[1];
|
|
1225
1371
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1323,30 +1469,55 @@ function __wbg_get_imports() {
|
|
|
1323
1469
|
};
|
|
1324
1470
|
}
|
|
1325
1471
|
|
|
1472
|
+
function __wbg_call_guard() {
|
|
1473
|
+
if (__wbg_reinit_scheduled) {
|
|
1474
|
+
__wbg_reset_state();
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
let __wbg_instance_id = 0;
|
|
1326
1481
|
const WasmBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1327
1482
|
? { register: () => {}, unregister: () => {} }
|
|
1328
|
-
: new FinalizationRegistry(
|
|
1483
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1484
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmbuilder_free(ptr, 1);
|
|
1485
|
+
});
|
|
1329
1486
|
const WasmDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1330
1487
|
? { register: () => {}, unregister: () => {} }
|
|
1331
|
-
: new FinalizationRegistry(
|
|
1488
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1489
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmdocument_free(ptr, 1);
|
|
1490
|
+
});
|
|
1332
1491
|
const WasmImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1333
1492
|
? { register: () => {}, unregister: () => {} }
|
|
1334
|
-
: new FinalizationRegistry(
|
|
1493
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1494
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmimage_free(ptr, 1);
|
|
1495
|
+
});
|
|
1335
1496
|
const WasmPageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1336
1497
|
? { register: () => {}, unregister: () => {} }
|
|
1337
|
-
: new FinalizationRegistry(
|
|
1498
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1499
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmpage_free(ptr, 1);
|
|
1500
|
+
});
|
|
1338
1501
|
const WasmPageBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1339
1502
|
? { register: () => {}, unregister: () => {} }
|
|
1340
|
-
: new FinalizationRegistry(
|
|
1503
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1504
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmpagebuilder_free(ptr, 1);
|
|
1505
|
+
});
|
|
1341
1506
|
const WasmSaveJobFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1342
1507
|
? { register: () => {}, unregister: () => {} }
|
|
1343
|
-
: new FinalizationRegistry(
|
|
1508
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1509
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmsavejob_free(ptr, 1);
|
|
1510
|
+
});
|
|
1344
1511
|
const WasmSparseSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1345
1512
|
? { register: () => {}, unregister: () => {} }
|
|
1346
|
-
: new FinalizationRegistry(
|
|
1513
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1514
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmsparsesource_free(ptr, 1);
|
|
1515
|
+
});
|
|
1347
1516
|
const WasmWarningCursorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1348
1517
|
? { register: () => {}, unregister: () => {} }
|
|
1349
|
-
: new FinalizationRegistry(
|
|
1518
|
+
: new FinalizationRegistry(({ ptr, instance }) => {
|
|
1519
|
+
if (instance === __wbg_instance_id) wasm.__wbg_wasmwarningcursor_free(ptr, 1);
|
|
1520
|
+
});
|
|
1350
1521
|
|
|
1351
1522
|
function addToExternrefTable0(obj) {
|
|
1352
1523
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -1498,6 +1669,8 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
1498
1669
|
return ptr;
|
|
1499
1670
|
}
|
|
1500
1671
|
|
|
1672
|
+
let __wbg_reinit_scheduled = false;
|
|
1673
|
+
|
|
1501
1674
|
function takeFromExternrefTable0(idx) {
|
|
1502
1675
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1503
1676
|
wasm.__externref_table_dealloc(idx);
|