pdf-oxide-wasm 0.3.38 → 0.3.40
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/bundler/pdf_oxide.d.ts +290 -5
- package/bundler/pdf_oxide.js +1 -1
- package/bundler/pdf_oxide_bg.js +1178 -99
- package/bundler/pdf_oxide_bg.wasm +0 -0
- package/bundler/pdf_oxide_bg.wasm.d.ts +49 -1
- package/nodejs/pdf_oxide.d.ts +290 -5
- package/nodejs/pdf_oxide.js +1181 -99
- package/nodejs/pdf_oxide_bg.wasm +0 -0
- package/nodejs/pdf_oxide_bg.wasm.d.ts +49 -1
- package/package.json +1 -1
- package/web/pdf_oxide.d.ts +339 -6
- package/web/pdf_oxide.js +1178 -99
- package/web/pdf_oxide_bg.wasm +0 -0
- package/web/pdf_oxide_bg.wasm.d.ts +49 -1
package/bundler/pdf_oxide_bg.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Horizontal-alignment enum shared by `textInRect`, buffered `table`, and
|
|
3
|
+
* `streamingTable`. Maps 1:1 onto [`crate::writer::TextAlign`] /
|
|
4
|
+
* [`crate::writer::CellAlign`]. Exported to JS as `Align` via `js_name`.
|
|
5
|
+
* @enum {0 | 1 | 2}
|
|
6
|
+
*/
|
|
7
|
+
export const Align = Object.freeze({
|
|
8
|
+
/**
|
|
9
|
+
* Align to the left edge.
|
|
10
|
+
*/
|
|
11
|
+
Left: 0, "0": "Left",
|
|
12
|
+
/**
|
|
13
|
+
* Center horizontally.
|
|
14
|
+
*/
|
|
15
|
+
Center: 1, "1": "Center",
|
|
16
|
+
/**
|
|
17
|
+
* Align to the right edge.
|
|
18
|
+
*/
|
|
19
|
+
Right: 2, "2": "Right",
|
|
20
|
+
});
|
|
21
|
+
|
|
1
22
|
/**
|
|
2
23
|
* Style configuration for header/footer text.
|
|
3
24
|
*/
|
|
@@ -65,6 +86,128 @@ export class ArtifactStyle {
|
|
|
65
86
|
}
|
|
66
87
|
if (Symbol.dispose) ArtifactStyle.prototype[Symbol.dispose] = ArtifactStyle.prototype.free;
|
|
67
88
|
|
|
89
|
+
/**
|
|
90
|
+
* WASM handle to a streaming-table building session. Created by
|
|
91
|
+
* `FluentPageBuilder.streamingTable()`; rows are pushed via `pushRow`,
|
|
92
|
+
* and the session is sealed with `finish()`.
|
|
93
|
+
*
|
|
94
|
+
* Single-use: `finish()` twice throws, and `pushRow` after `finish()`
|
|
95
|
+
* throws. The rows are buffered and replayed against the real Rust
|
|
96
|
+
* `StreamingTable` at `WasmFluentPageBuilder.done()` commit time —
|
|
97
|
+
* preserving the FluentPageBuilder borrow-lifetime invariant that can't
|
|
98
|
+
* cross the wasm-bindgen boundary.
|
|
99
|
+
*/
|
|
100
|
+
export class StreamingTable {
|
|
101
|
+
static __wrap(ptr) {
|
|
102
|
+
ptr = ptr >>> 0;
|
|
103
|
+
const obj = Object.create(StreamingTable.prototype);
|
|
104
|
+
obj.__wbg_ptr = ptr;
|
|
105
|
+
StreamingTableFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
106
|
+
return obj;
|
|
107
|
+
}
|
|
108
|
+
__destroy_into_raw() {
|
|
109
|
+
const ptr = this.__wbg_ptr;
|
|
110
|
+
this.__wbg_ptr = 0;
|
|
111
|
+
StreamingTableFinalization.unregister(this);
|
|
112
|
+
return ptr;
|
|
113
|
+
}
|
|
114
|
+
free() {
|
|
115
|
+
const ptr = this.__destroy_into_raw();
|
|
116
|
+
wasm.__wbg_streamingtable_free(ptr, 0);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Number of fully-completed batches waiting for finish().
|
|
120
|
+
* @returns {number}
|
|
121
|
+
*/
|
|
122
|
+
batchCount() {
|
|
123
|
+
const ret = wasm.streamingtable_batchCount(this.__wbg_ptr);
|
|
124
|
+
return ret >>> 0;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Number of columns configured on this streaming table.
|
|
128
|
+
* @returns {number}
|
|
129
|
+
*/
|
|
130
|
+
columnCount() {
|
|
131
|
+
const ret = wasm.streamingtable_columnCount(this.__wbg_ptr);
|
|
132
|
+
return ret >>> 0;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Seal the streaming table — the buffered rows are flushed onto the
|
|
136
|
+
* parent page's op queue, to be replayed against the real Rust
|
|
137
|
+
* `StreamingTable` at `done()` commit time. Calling `finish()` twice
|
|
138
|
+
* throws.
|
|
139
|
+
*/
|
|
140
|
+
finish() {
|
|
141
|
+
try {
|
|
142
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
143
|
+
wasm.streamingtable_finish(retptr, this.__wbg_ptr);
|
|
144
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
145
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
146
|
+
if (r1) {
|
|
147
|
+
throw takeObject(r0);
|
|
148
|
+
}
|
|
149
|
+
} finally {
|
|
150
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Explicitly flush the current batch to `completed_batches`.
|
|
155
|
+
* Called automatically when `batch_size` rows accumulate.
|
|
156
|
+
*/
|
|
157
|
+
flush() {
|
|
158
|
+
wasm.streamingtable_flush(this.__wbg_ptr);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Number of rows in the current (not-yet-flushed) batch.
|
|
162
|
+
* @returns {number}
|
|
163
|
+
*/
|
|
164
|
+
pendingRowCount() {
|
|
165
|
+
const ret = wasm.streamingtable_pendingRowCount(this.__wbg_ptr);
|
|
166
|
+
return ret >>> 0;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Push one row as an array of cell strings (all rowspan=1). Returns an
|
|
170
|
+
* error if the table has already been finished or if the row's cell count
|
|
171
|
+
* does not match the column count. Auto-flushes the batch when full.
|
|
172
|
+
* @param {string[]} cells
|
|
173
|
+
*/
|
|
174
|
+
pushRow(cells) {
|
|
175
|
+
try {
|
|
176
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
177
|
+
const ptr0 = passArrayJsValueToWasm0(cells, wasm.__wbindgen_export);
|
|
178
|
+
const len0 = WASM_VECTOR_LEN;
|
|
179
|
+
wasm.streamingtable_pushRow(retptr, this.__wbg_ptr, ptr0, len0);
|
|
180
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
181
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
182
|
+
if (r1) {
|
|
183
|
+
throw takeObject(r0);
|
|
184
|
+
}
|
|
185
|
+
} finally {
|
|
186
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Push one row with per-cell rowspan values. `cells` is a JS array of
|
|
191
|
+
* `[text, rowspan]` two-element arrays. `rowspan == 1` is a normal cell.
|
|
192
|
+
* Auto-flushes the batch when full.
|
|
193
|
+
* @param {any} cells
|
|
194
|
+
*/
|
|
195
|
+
pushRowSpan(cells) {
|
|
196
|
+
try {
|
|
197
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
198
|
+
wasm.streamingtable_pushRowSpan(retptr, this.__wbg_ptr, addHeapObject(cells));
|
|
199
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
200
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
201
|
+
if (r1) {
|
|
202
|
+
throw takeObject(r0);
|
|
203
|
+
}
|
|
204
|
+
} finally {
|
|
205
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (Symbol.dispose) StreamingTable.prototype[Symbol.dispose] = StreamingTable.prototype.free;
|
|
210
|
+
|
|
68
211
|
/**
|
|
69
212
|
* A header or footer artifact definition.
|
|
70
213
|
*/
|
|
@@ -246,6 +389,59 @@ export class WasmCertificate {
|
|
|
246
389
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
247
390
|
}
|
|
248
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Load a signer certificate + private key from PEM strings.
|
|
394
|
+
* `certPem` must begin `-----BEGIN CERTIFICATE-----`.
|
|
395
|
+
* `keyPem` must begin `-----BEGIN PRIVATE KEY-----` or `-----BEGIN RSA PRIVATE KEY-----`.
|
|
396
|
+
* @param {string} cert_pem
|
|
397
|
+
* @param {string} key_pem
|
|
398
|
+
* @returns {WasmCertificate}
|
|
399
|
+
*/
|
|
400
|
+
static loadPem(cert_pem, key_pem) {
|
|
401
|
+
try {
|
|
402
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
403
|
+
const ptr0 = passStringToWasm0(cert_pem, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
404
|
+
const len0 = WASM_VECTOR_LEN;
|
|
405
|
+
const ptr1 = passStringToWasm0(key_pem, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
406
|
+
const len1 = WASM_VECTOR_LEN;
|
|
407
|
+
wasm.wasmcertificate_loadPem(retptr, ptr0, len0, ptr1, len1);
|
|
408
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
409
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
410
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
411
|
+
if (r2) {
|
|
412
|
+
throw takeObject(r1);
|
|
413
|
+
}
|
|
414
|
+
return WasmCertificate.__wrap(r0);
|
|
415
|
+
} finally {
|
|
416
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Load a signer certificate + private key from a PKCS#12 (.p12/.pfx) blob.
|
|
421
|
+
* `password` is the passphrase protecting the key bag.
|
|
422
|
+
* @param {Uint8Array} data
|
|
423
|
+
* @param {string} password
|
|
424
|
+
* @returns {WasmCertificate}
|
|
425
|
+
*/
|
|
426
|
+
static loadPkcs12(data, password) {
|
|
427
|
+
try {
|
|
428
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
429
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
430
|
+
const len0 = WASM_VECTOR_LEN;
|
|
431
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
432
|
+
const len1 = WASM_VECTOR_LEN;
|
|
433
|
+
wasm.wasmcertificate_loadPkcs12(retptr, ptr0, len0, ptr1, len1);
|
|
434
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
435
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
436
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
437
|
+
if (r2) {
|
|
438
|
+
throw takeObject(r1);
|
|
439
|
+
}
|
|
440
|
+
return WasmCertificate.__wrap(r0);
|
|
441
|
+
} finally {
|
|
442
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
249
445
|
/**
|
|
250
446
|
* Serial number as a hex string (no `0x` prefix).
|
|
251
447
|
* @returns {string}
|
|
@@ -474,6 +670,27 @@ export class WasmDocumentBuilder {
|
|
|
474
670
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
475
671
|
}
|
|
476
672
|
}
|
|
673
|
+
/**
|
|
674
|
+
* Set the document's natural language tag (e.g. `"en-US"`).
|
|
675
|
+
*
|
|
676
|
+
* Emitted as `/Lang` in the catalog when `taggedPdfUa1()` is set.
|
|
677
|
+
* @param {string} lang
|
|
678
|
+
*/
|
|
679
|
+
language(lang) {
|
|
680
|
+
try {
|
|
681
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
682
|
+
const ptr0 = passStringToWasm0(lang, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
683
|
+
const len0 = WASM_VECTOR_LEN;
|
|
684
|
+
wasm.wasmdocumentbuilder_language(retptr, this.__wbg_ptr, ptr0, len0);
|
|
685
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
686
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
687
|
+
if (r1) {
|
|
688
|
+
throw takeObject(r0);
|
|
689
|
+
}
|
|
690
|
+
} finally {
|
|
691
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
477
694
|
/**
|
|
478
695
|
* Start a new US Letter page.
|
|
479
696
|
* @returns {WasmFluentPageBuilder}
|
|
@@ -504,6 +721,25 @@ export class WasmDocumentBuilder {
|
|
|
504
721
|
WasmDocumentBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
505
722
|
return this;
|
|
506
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* Run a JavaScript script when the document is opened (`/OpenAction`).
|
|
726
|
+
* @param {string} script
|
|
727
|
+
*/
|
|
728
|
+
onOpen(script) {
|
|
729
|
+
try {
|
|
730
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
731
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
732
|
+
const len0 = WASM_VECTOR_LEN;
|
|
733
|
+
wasm.wasmdocumentbuilder_onOpen(retptr, this.__wbg_ptr, ptr0, len0);
|
|
734
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
735
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
736
|
+
if (r1) {
|
|
737
|
+
throw takeObject(r0);
|
|
738
|
+
}
|
|
739
|
+
} finally {
|
|
740
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
507
743
|
/**
|
|
508
744
|
* Start a new page with custom dimensions in PDF points
|
|
509
745
|
* (72 pt = 1 inch).
|
|
@@ -548,6 +784,31 @@ export class WasmDocumentBuilder {
|
|
|
548
784
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
549
785
|
}
|
|
550
786
|
}
|
|
787
|
+
/**
|
|
788
|
+
* Add a role-map entry: custom structure type → standard PDF structure type.
|
|
789
|
+
*
|
|
790
|
+
* Emitted in `/RoleMap` inside the StructTreeRoot when `taggedPdfUa1()`
|
|
791
|
+
* is set. Multiple calls accumulate entries.
|
|
792
|
+
* @param {string} custom
|
|
793
|
+
* @param {string} standard
|
|
794
|
+
*/
|
|
795
|
+
roleMap(custom, standard) {
|
|
796
|
+
try {
|
|
797
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
798
|
+
const ptr0 = passStringToWasm0(custom, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
799
|
+
const len0 = WASM_VECTOR_LEN;
|
|
800
|
+
const ptr1 = passStringToWasm0(standard, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
801
|
+
const len1 = WASM_VECTOR_LEN;
|
|
802
|
+
wasm.wasmdocumentbuilder_roleMap(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
803
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
804
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
805
|
+
if (r1) {
|
|
806
|
+
throw takeObject(r0);
|
|
807
|
+
}
|
|
808
|
+
} finally {
|
|
809
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
551
812
|
/**
|
|
552
813
|
* Set document subject.
|
|
553
814
|
* @param {string} subject
|
|
@@ -567,6 +828,25 @@ export class WasmDocumentBuilder {
|
|
|
567
828
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
568
829
|
}
|
|
569
830
|
}
|
|
831
|
+
/**
|
|
832
|
+
* Enable PDF/UA-1 tagged PDF mode.
|
|
833
|
+
*
|
|
834
|
+
* When enabled, `build()` emits `/MarkInfo`, `/StructTreeRoot`, `/Lang`,
|
|
835
|
+
* and `/ViewerPreferences` in the catalog. Opt-in — no effect unless called.
|
|
836
|
+
*/
|
|
837
|
+
taggedPdfUa1() {
|
|
838
|
+
try {
|
|
839
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
840
|
+
wasm.wasmdocumentbuilder_taggedPdfUa1(retptr, this.__wbg_ptr);
|
|
841
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
842
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
843
|
+
if (r1) {
|
|
844
|
+
throw takeObject(r0);
|
|
845
|
+
}
|
|
846
|
+
} finally {
|
|
847
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
570
850
|
/**
|
|
571
851
|
* Set document title.
|
|
572
852
|
* @param {string} title
|
|
@@ -731,6 +1011,54 @@ export class WasmFluentPageBuilder {
|
|
|
731
1011
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
732
1012
|
}
|
|
733
1013
|
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Place a 1-D barcode image at `(x, y, w, h)` on the page.
|
|
1016
|
+
* `barcodeType`: 0=Code128 1=Code39 2=EAN13 3=EAN8 4=UPCA 5=ITF
|
|
1017
|
+
* 6=Code93 7=Codabar.
|
|
1018
|
+
* @param {number} barcode_type
|
|
1019
|
+
* @param {string} data
|
|
1020
|
+
* @param {number} x
|
|
1021
|
+
* @param {number} y
|
|
1022
|
+
* @param {number} w
|
|
1023
|
+
* @param {number} h
|
|
1024
|
+
*/
|
|
1025
|
+
barcode1d(barcode_type, data, x, y, w, h) {
|
|
1026
|
+
try {
|
|
1027
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1028
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1029
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1030
|
+
wasm.wasmfluentpagebuilder_barcode1d(retptr, this.__wbg_ptr, barcode_type, ptr0, len0, x, y, w, h);
|
|
1031
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1032
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1033
|
+
if (r1) {
|
|
1034
|
+
throw takeObject(r0);
|
|
1035
|
+
}
|
|
1036
|
+
} finally {
|
|
1037
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Place a QR-code image at `(x, y, size, size)` on the page.
|
|
1042
|
+
* @param {string} data
|
|
1043
|
+
* @param {number} x
|
|
1044
|
+
* @param {number} y
|
|
1045
|
+
* @param {number} size
|
|
1046
|
+
*/
|
|
1047
|
+
barcodeQr(data, x, y, size) {
|
|
1048
|
+
try {
|
|
1049
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1050
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1051
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1052
|
+
wasm.wasmfluentpagebuilder_barcodeQr(retptr, this.__wbg_ptr, ptr0, len0, x, y, size);
|
|
1053
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1054
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1055
|
+
if (r1) {
|
|
1056
|
+
throw takeObject(r0);
|
|
1057
|
+
}
|
|
1058
|
+
} finally {
|
|
1059
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
734
1062
|
/**
|
|
735
1063
|
* @param {string} name
|
|
736
1064
|
* @param {number} x
|
|
@@ -754,6 +1082,28 @@ export class WasmFluentPageBuilder {
|
|
|
754
1082
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
755
1083
|
}
|
|
756
1084
|
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Lay out `text` as balanced multi-column flow (`columnCount` columns,
|
|
1087
|
+
* `gapPt` points between columns). Paragraphs in `text` are separated by `"\n\n"`.
|
|
1088
|
+
* @param {number} column_count
|
|
1089
|
+
* @param {number} gap_pt
|
|
1090
|
+
* @param {string} text
|
|
1091
|
+
*/
|
|
1092
|
+
columns(column_count, gap_pt, text) {
|
|
1093
|
+
try {
|
|
1094
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1095
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1096
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1097
|
+
wasm.wasmfluentpagebuilder_columns(retptr, this.__wbg_ptr, column_count, gap_pt, ptr0, len0);
|
|
1098
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1099
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1100
|
+
if (r1) {
|
|
1101
|
+
throw takeObject(r0);
|
|
1102
|
+
}
|
|
1103
|
+
} finally {
|
|
1104
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
757
1107
|
/**
|
|
758
1108
|
* Add a dropdown combo-box.
|
|
759
1109
|
* @param {string} name
|
|
@@ -810,19 +1160,14 @@ export class WasmFluentPageBuilder {
|
|
|
810
1160
|
}
|
|
811
1161
|
}
|
|
812
1162
|
/**
|
|
813
|
-
*
|
|
814
|
-
* @param {number} x
|
|
815
|
-
* @param {number} y
|
|
816
|
-
* @param {number} w
|
|
817
|
-
* @param {number} h
|
|
818
|
-
* @param {number} r
|
|
819
|
-
* @param {number} g
|
|
820
|
-
* @param {number} b
|
|
1163
|
+
* @param {string} script
|
|
821
1164
|
*/
|
|
822
|
-
|
|
1165
|
+
fieldCalculate(script) {
|
|
823
1166
|
try {
|
|
824
1167
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
825
|
-
|
|
1168
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1169
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1170
|
+
wasm.wasmfluentpagebuilder_fieldCalculate(retptr, this.__wbg_ptr, ptr0, len0);
|
|
826
1171
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
827
1172
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
828
1173
|
if (r1) {
|
|
@@ -833,15 +1178,14 @@ export class WasmFluentPageBuilder {
|
|
|
833
1178
|
}
|
|
834
1179
|
}
|
|
835
1180
|
/**
|
|
836
|
-
* @param {string}
|
|
837
|
-
* @param {number} size
|
|
1181
|
+
* @param {string} script
|
|
838
1182
|
*/
|
|
839
|
-
|
|
1183
|
+
fieldFormat(script) {
|
|
840
1184
|
try {
|
|
841
1185
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
842
|
-
const ptr0 = passStringToWasm0(
|
|
1186
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
843
1187
|
const len0 = WASM_VECTOR_LEN;
|
|
844
|
-
wasm.
|
|
1188
|
+
wasm.wasmfluentpagebuilder_fieldFormat(retptr, this.__wbg_ptr, ptr0, len0);
|
|
845
1189
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
846
1190
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
847
1191
|
if (r1) {
|
|
@@ -852,13 +1196,114 @@ export class WasmFluentPageBuilder {
|
|
|
852
1196
|
}
|
|
853
1197
|
}
|
|
854
1198
|
/**
|
|
855
|
-
* @param {
|
|
856
|
-
* @param {number} y
|
|
857
|
-
* @param {number} w
|
|
858
|
-
* @param {number} h
|
|
859
|
-
* @param {string} text
|
|
1199
|
+
* @param {string} script
|
|
860
1200
|
*/
|
|
861
|
-
|
|
1201
|
+
fieldKeystroke(script) {
|
|
1202
|
+
try {
|
|
1203
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1204
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1205
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1206
|
+
wasm.wasmfluentpagebuilder_fieldKeystroke(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1207
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1208
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1209
|
+
if (r1) {
|
|
1210
|
+
throw takeObject(r0);
|
|
1211
|
+
}
|
|
1212
|
+
} finally {
|
|
1213
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* @param {string} script
|
|
1218
|
+
*/
|
|
1219
|
+
fieldValidate(script) {
|
|
1220
|
+
try {
|
|
1221
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1222
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1223
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1224
|
+
wasm.wasmfluentpagebuilder_fieldValidate(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1225
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1226
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1227
|
+
if (r1) {
|
|
1228
|
+
throw takeObject(r0);
|
|
1229
|
+
}
|
|
1230
|
+
} finally {
|
|
1231
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Draw a filled rectangle. RGB channels in 0.0-1.0.
|
|
1236
|
+
* @param {number} x
|
|
1237
|
+
* @param {number} y
|
|
1238
|
+
* @param {number} w
|
|
1239
|
+
* @param {number} h
|
|
1240
|
+
* @param {number} r
|
|
1241
|
+
* @param {number} g
|
|
1242
|
+
* @param {number} b
|
|
1243
|
+
*/
|
|
1244
|
+
filledRect(x, y, w, h, r, g, b) {
|
|
1245
|
+
try {
|
|
1246
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1247
|
+
wasm.wasmfluentpagebuilder_filledRect(retptr, this.__wbg_ptr, x, y, w, h, r, g, b);
|
|
1248
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1249
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1250
|
+
if (r1) {
|
|
1251
|
+
throw takeObject(r0);
|
|
1252
|
+
}
|
|
1253
|
+
} finally {
|
|
1254
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* @param {string} name
|
|
1259
|
+
* @param {number} size
|
|
1260
|
+
*/
|
|
1261
|
+
font(name, size) {
|
|
1262
|
+
try {
|
|
1263
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1264
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1265
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1266
|
+
wasm.wasmfluentpagebuilder_font(retptr, this.__wbg_ptr, ptr0, len0, size);
|
|
1267
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1268
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1269
|
+
if (r1) {
|
|
1270
|
+
throw takeObject(r0);
|
|
1271
|
+
}
|
|
1272
|
+
} finally {
|
|
1273
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Add a footnote: inline `refMark` at the cursor and `noteText` body
|
|
1278
|
+
* near the page bottom with a separator artifact line.
|
|
1279
|
+
* @param {string} ref_mark
|
|
1280
|
+
* @param {string} note_text
|
|
1281
|
+
*/
|
|
1282
|
+
footnote(ref_mark, note_text) {
|
|
1283
|
+
try {
|
|
1284
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1285
|
+
const ptr0 = passStringToWasm0(ref_mark, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1286
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1287
|
+
const ptr1 = passStringToWasm0(note_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1288
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1289
|
+
wasm.wasmfluentpagebuilder_footnote(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1290
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1291
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1292
|
+
if (r1) {
|
|
1293
|
+
throw takeObject(r0);
|
|
1294
|
+
}
|
|
1295
|
+
} finally {
|
|
1296
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* @param {number} x
|
|
1301
|
+
* @param {number} y
|
|
1302
|
+
* @param {number} w
|
|
1303
|
+
* @param {number} h
|
|
1304
|
+
* @param {string} text
|
|
1305
|
+
*/
|
|
1306
|
+
freeText(x, y, w, h, text) {
|
|
862
1307
|
try {
|
|
863
1308
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
864
1309
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -923,6 +1368,134 @@ export class WasmFluentPageBuilder {
|
|
|
923
1368
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
924
1369
|
}
|
|
925
1370
|
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Embed a decorative image (JPEG/PNG/WebP bytes) as an /Artifact (no alt text).
|
|
1373
|
+
* @param {Uint8Array} bytes
|
|
1374
|
+
* @param {number} x
|
|
1375
|
+
* @param {number} y
|
|
1376
|
+
* @param {number} w
|
|
1377
|
+
* @param {number} h
|
|
1378
|
+
*/
|
|
1379
|
+
imageArtifact(bytes, x, y, w, h) {
|
|
1380
|
+
try {
|
|
1381
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1382
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1383
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1384
|
+
wasm.wasmfluentpagebuilder_imageArtifact(retptr, this.__wbg_ptr, ptr0, len0, x, y, w, h);
|
|
1385
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1386
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1387
|
+
if (r1) {
|
|
1388
|
+
throw takeObject(r0);
|
|
1389
|
+
}
|
|
1390
|
+
} finally {
|
|
1391
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Embed an image (JPEG/PNG/WebP bytes) with an accessibility alt text.
|
|
1396
|
+
* @param {Uint8Array} bytes
|
|
1397
|
+
* @param {number} x
|
|
1398
|
+
* @param {number} y
|
|
1399
|
+
* @param {number} w
|
|
1400
|
+
* @param {number} h
|
|
1401
|
+
* @param {string} alt_text
|
|
1402
|
+
*/
|
|
1403
|
+
imageWithAlt(bytes, x, y, w, h, alt_text) {
|
|
1404
|
+
try {
|
|
1405
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1406
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1407
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1408
|
+
const ptr1 = passStringToWasm0(alt_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1409
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1410
|
+
wasm.wasmfluentpagebuilder_imageWithAlt(retptr, this.__wbg_ptr, ptr0, len0, x, y, w, h, ptr1, len1);
|
|
1411
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1412
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1413
|
+
if (r1) {
|
|
1414
|
+
throw takeObject(r0);
|
|
1415
|
+
}
|
|
1416
|
+
} finally {
|
|
1417
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Emit `text` inline (advances cursorX only, not cursorY).
|
|
1422
|
+
* @param {string} text
|
|
1423
|
+
*/
|
|
1424
|
+
inline(text) {
|
|
1425
|
+
try {
|
|
1426
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1427
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1428
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1429
|
+
wasm.wasmfluentpagebuilder_inline(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1430
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1431
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1432
|
+
if (r1) {
|
|
1433
|
+
throw takeObject(r0);
|
|
1434
|
+
}
|
|
1435
|
+
} finally {
|
|
1436
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Inline bold run.
|
|
1441
|
+
* @param {string} text
|
|
1442
|
+
*/
|
|
1443
|
+
inlineBold(text) {
|
|
1444
|
+
try {
|
|
1445
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1446
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1447
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1448
|
+
wasm.wasmfluentpagebuilder_inlineBold(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1449
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1450
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1451
|
+
if (r1) {
|
|
1452
|
+
throw takeObject(r0);
|
|
1453
|
+
}
|
|
1454
|
+
} finally {
|
|
1455
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Inline colored run (RGB 0.0–1.0).
|
|
1460
|
+
* @param {number} r
|
|
1461
|
+
* @param {number} g
|
|
1462
|
+
* @param {number} b
|
|
1463
|
+
* @param {string} text
|
|
1464
|
+
*/
|
|
1465
|
+
inlineColor(r, g, b, text) {
|
|
1466
|
+
try {
|
|
1467
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1468
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1469
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1470
|
+
wasm.wasmfluentpagebuilder_inlineColor(retptr, this.__wbg_ptr, r, g, b, ptr0, len0);
|
|
1471
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1472
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1473
|
+
if (r1) {
|
|
1474
|
+
throw takeObject(r0);
|
|
1475
|
+
}
|
|
1476
|
+
} finally {
|
|
1477
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Inline italic run.
|
|
1482
|
+
* @param {string} text
|
|
1483
|
+
*/
|
|
1484
|
+
inlineItalic(text) {
|
|
1485
|
+
try {
|
|
1486
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1487
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1488
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1489
|
+
wasm.wasmfluentpagebuilder_inlineItalic(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1490
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1491
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1492
|
+
if (r1) {
|
|
1493
|
+
throw takeObject(r0);
|
|
1494
|
+
}
|
|
1495
|
+
} finally {
|
|
1496
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
926
1499
|
/**
|
|
927
1500
|
* Draw a line from (x1, y1) to (x2, y2) with 1pt black stroke.
|
|
928
1501
|
* @param {number} x1
|
|
@@ -943,6 +1516,24 @@ export class WasmFluentPageBuilder {
|
|
|
943
1516
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
944
1517
|
}
|
|
945
1518
|
}
|
|
1519
|
+
/**
|
|
1520
|
+
* @param {string} script
|
|
1521
|
+
*/
|
|
1522
|
+
linkJavascript(script) {
|
|
1523
|
+
try {
|
|
1524
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1525
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1527
|
+
wasm.wasmfluentpagebuilder_linkJavascript(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1528
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1529
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1530
|
+
if (r1) {
|
|
1531
|
+
throw takeObject(r0);
|
|
1532
|
+
}
|
|
1533
|
+
} finally {
|
|
1534
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
946
1537
|
/**
|
|
947
1538
|
* @param {string} destination
|
|
948
1539
|
*/
|
|
@@ -996,14 +1587,272 @@ export class WasmFluentPageBuilder {
|
|
|
996
1587
|
}
|
|
997
1588
|
}
|
|
998
1589
|
/**
|
|
999
|
-
*
|
|
1590
|
+
* Measure the rendered width of `text` in the builder's current font
|
|
1591
|
+
* and size, in PDF points. Pure query — does not mutate state.
|
|
1592
|
+
*
|
|
1593
|
+
* Thin JS view over [`crate::writer::FluentPageBuilder::measure`]. The
|
|
1594
|
+
* WASM class tracks the current font/size independently of the
|
|
1595
|
+
* buffered ops so this query is served without a live builder.
|
|
1596
|
+
* @param {string} text
|
|
1597
|
+
* @returns {number}
|
|
1598
|
+
*/
|
|
1599
|
+
measure(text) {
|
|
1600
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1601
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1602
|
+
const ret = wasm.wasmfluentpagebuilder_measure(this.__wbg_ptr, ptr0, len0);
|
|
1603
|
+
return ret;
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Finish the current page and start a new one with the same page
|
|
1607
|
+
* size. Cursor resets to the top-left margin (72, height-72). The
|
|
1608
|
+
* builder's font carries over.
|
|
1609
|
+
*/
|
|
1610
|
+
newPageSameSize() {
|
|
1611
|
+
try {
|
|
1612
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1613
|
+
wasm.wasmfluentpagebuilder_newPageSameSize(retptr, this.__wbg_ptr);
|
|
1614
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1615
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1616
|
+
if (r1) {
|
|
1617
|
+
throw takeObject(r0);
|
|
1618
|
+
}
|
|
1619
|
+
} finally {
|
|
1620
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Advance cursorY by one line-height and reset cursorX to 72 pt.
|
|
1625
|
+
*/
|
|
1626
|
+
newline() {
|
|
1627
|
+
try {
|
|
1628
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1629
|
+
wasm.wasmfluentpagebuilder_newline(retptr, this.__wbg_ptr);
|
|
1630
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1631
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1632
|
+
if (r1) {
|
|
1633
|
+
throw takeObject(r0);
|
|
1634
|
+
}
|
|
1635
|
+
} finally {
|
|
1636
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* @param {string} script
|
|
1641
|
+
*/
|
|
1642
|
+
onClose(script) {
|
|
1643
|
+
try {
|
|
1644
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1645
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1646
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1647
|
+
wasm.wasmfluentpagebuilder_onClose(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1648
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1649
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1650
|
+
if (r1) {
|
|
1651
|
+
throw takeObject(r0);
|
|
1652
|
+
}
|
|
1653
|
+
} finally {
|
|
1654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* @param {string} script
|
|
1659
|
+
*/
|
|
1660
|
+
onOpen(script) {
|
|
1661
|
+
try {
|
|
1662
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1663
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1664
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1665
|
+
wasm.wasmfluentpagebuilder_onOpen(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1666
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1667
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1668
|
+
if (r1) {
|
|
1669
|
+
throw takeObject(r0);
|
|
1670
|
+
}
|
|
1671
|
+
} finally {
|
|
1672
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* @param {string} text
|
|
1677
|
+
*/
|
|
1678
|
+
paragraph(text) {
|
|
1679
|
+
try {
|
|
1680
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1681
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1682
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1683
|
+
wasm.wasmfluentpagebuilder_paragraph(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1684
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1685
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1686
|
+
if (r1) {
|
|
1687
|
+
throw takeObject(r0);
|
|
1688
|
+
}
|
|
1689
|
+
} finally {
|
|
1690
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* Add a clickable push button with a visible caption.
|
|
1695
|
+
* @param {string} name
|
|
1696
|
+
* @param {number} x
|
|
1697
|
+
* @param {number} y
|
|
1698
|
+
* @param {number} w
|
|
1699
|
+
* @param {number} h
|
|
1700
|
+
* @param {string} caption
|
|
1701
|
+
*/
|
|
1702
|
+
pushButton(name, x, y, w, h, caption) {
|
|
1703
|
+
try {
|
|
1704
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1705
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1706
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1707
|
+
const ptr1 = passStringToWasm0(caption, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1708
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1709
|
+
wasm.wasmfluentpagebuilder_pushButton(retptr, this.__wbg_ptr, ptr0, len0, x, y, w, h, ptr1, len1);
|
|
1710
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1711
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1712
|
+
if (r1) {
|
|
1713
|
+
throw takeObject(r0);
|
|
1714
|
+
}
|
|
1715
|
+
} finally {
|
|
1716
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Add a radio-button group. `values`, `xs`, `ys`, `ws`, `hs` are
|
|
1721
|
+
* parallel arrays of length N describing each option's export
|
|
1722
|
+
* value and rectangle. `selected` picks the initial value.
|
|
1723
|
+
* @param {string} name
|
|
1724
|
+
* @param {string[]} values
|
|
1725
|
+
* @param {Float32Array} xs
|
|
1726
|
+
* @param {Float32Array} ys
|
|
1727
|
+
* @param {Float32Array} ws
|
|
1728
|
+
* @param {Float32Array} hs
|
|
1729
|
+
* @param {string | null} [selected]
|
|
1730
|
+
*/
|
|
1731
|
+
radioGroup(name, values, xs, ys, ws, hs, selected) {
|
|
1732
|
+
try {
|
|
1733
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1734
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1735
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1736
|
+
const ptr1 = passArrayJsValueToWasm0(values, wasm.__wbindgen_export);
|
|
1737
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1738
|
+
const ptr2 = passArrayF32ToWasm0(xs, wasm.__wbindgen_export);
|
|
1739
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1740
|
+
const ptr3 = passArrayF32ToWasm0(ys, wasm.__wbindgen_export);
|
|
1741
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1742
|
+
const ptr4 = passArrayF32ToWasm0(ws, wasm.__wbindgen_export);
|
|
1743
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1744
|
+
const ptr5 = passArrayF32ToWasm0(hs, wasm.__wbindgen_export);
|
|
1745
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1746
|
+
var ptr6 = isLikeNone(selected) ? 0 : passStringToWasm0(selected, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1747
|
+
var len6 = WASM_VECTOR_LEN;
|
|
1748
|
+
wasm.wasmfluentpagebuilder_radioGroup(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1749
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1750
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1751
|
+
if (r1) {
|
|
1752
|
+
throw takeObject(r0);
|
|
1753
|
+
}
|
|
1754
|
+
} finally {
|
|
1755
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* Draw a stroked rectangle outline (1pt black).
|
|
1760
|
+
* @param {number} x
|
|
1761
|
+
* @param {number} y
|
|
1762
|
+
* @param {number} w
|
|
1763
|
+
* @param {number} h
|
|
1764
|
+
*/
|
|
1765
|
+
rect(x, y, w, h) {
|
|
1766
|
+
try {
|
|
1767
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1768
|
+
wasm.wasmfluentpagebuilder_rect(retptr, this.__wbg_ptr, x, y, w, h);
|
|
1769
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1770
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1771
|
+
if (r1) {
|
|
1772
|
+
throw takeObject(r0);
|
|
1773
|
+
}
|
|
1774
|
+
} finally {
|
|
1775
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Points remaining on the current page below the cursor (down to the
|
|
1780
|
+
* 72 pt bottom margin). Mirrors
|
|
1781
|
+
* [`crate::writer::FluentPageBuilder::remaining_space`] using the WASM
|
|
1782
|
+
* class's independently-tracked cursor — accurate after `at`, `text`,
|
|
1783
|
+
* `space`, `newPageSameSize`, `textInRect` and the table helpers.
|
|
1784
|
+
* @returns {number}
|
|
1785
|
+
*/
|
|
1786
|
+
remainingSpace() {
|
|
1787
|
+
const ret = wasm.wasmfluentpagebuilder_remainingSpace(this.__wbg_ptr);
|
|
1788
|
+
return ret;
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Add an unsigned signature placeholder field at the given bounds.
|
|
1792
|
+
* @param {string} name
|
|
1793
|
+
* @param {number} x
|
|
1794
|
+
* @param {number} y
|
|
1795
|
+
* @param {number} w
|
|
1796
|
+
* @param {number} h
|
|
1797
|
+
*/
|
|
1798
|
+
signatureField(name, x, y, w, h) {
|
|
1799
|
+
try {
|
|
1800
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1801
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1802
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1803
|
+
wasm.wasmfluentpagebuilder_signatureField(retptr, this.__wbg_ptr, ptr0, len0, x, y, w, h);
|
|
1804
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1805
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1806
|
+
if (r1) {
|
|
1807
|
+
throw takeObject(r0);
|
|
1808
|
+
}
|
|
1809
|
+
} finally {
|
|
1810
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* @param {number} points
|
|
1815
|
+
*/
|
|
1816
|
+
space(points) {
|
|
1817
|
+
try {
|
|
1818
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1819
|
+
wasm.wasmfluentpagebuilder_space(retptr, this.__wbg_ptr, points);
|
|
1820
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1821
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1822
|
+
if (r1) {
|
|
1823
|
+
throw takeObject(r0);
|
|
1824
|
+
}
|
|
1825
|
+
} finally {
|
|
1826
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* @param {number} r
|
|
1831
|
+
* @param {number} g
|
|
1832
|
+
* @param {number} b
|
|
1833
|
+
*/
|
|
1834
|
+
squiggly(r, g, b) {
|
|
1835
|
+
try {
|
|
1836
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1837
|
+
wasm.wasmfluentpagebuilder_squiggly(retptr, this.__wbg_ptr, r, g, b);
|
|
1838
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1839
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1840
|
+
if (r1) {
|
|
1841
|
+
throw takeObject(r0);
|
|
1842
|
+
}
|
|
1843
|
+
} finally {
|
|
1844
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* @param {string} name
|
|
1000
1849
|
*/
|
|
1001
|
-
|
|
1850
|
+
stamp(name) {
|
|
1002
1851
|
try {
|
|
1003
1852
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1004
|
-
const ptr0 = passStringToWasm0(
|
|
1853
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1005
1854
|
const len0 = WASM_VECTOR_LEN;
|
|
1006
|
-
wasm.
|
|
1855
|
+
wasm.wasmfluentpagebuilder_stamp(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1007
1856
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1008
1857
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1009
1858
|
if (r1) {
|
|
@@ -1014,22 +1863,14 @@ export class WasmFluentPageBuilder {
|
|
|
1014
1863
|
}
|
|
1015
1864
|
}
|
|
1016
1865
|
/**
|
|
1017
|
-
*
|
|
1018
|
-
* @param {string} name
|
|
1019
|
-
* @param {number} x
|
|
1020
|
-
* @param {number} y
|
|
1021
|
-
* @param {number} w
|
|
1022
|
-
* @param {number} h
|
|
1023
|
-
* @param {string} caption
|
|
1866
|
+
* @param {string} text
|
|
1024
1867
|
*/
|
|
1025
|
-
|
|
1868
|
+
stickyNote(text) {
|
|
1026
1869
|
try {
|
|
1027
1870
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1028
|
-
const ptr0 = passStringToWasm0(
|
|
1871
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1029
1872
|
const len0 = WASM_VECTOR_LEN;
|
|
1030
|
-
|
|
1031
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1032
|
-
wasm.wasmfluentpagebuilder_pushButton(retptr, this.__wbg_ptr, ptr0, len0, x, y, w, h, ptr1, len1);
|
|
1873
|
+
wasm.wasmfluentpagebuilder_stickyNote(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1033
1874
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1034
1875
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1035
1876
|
if (r1) {
|
|
@@ -1040,35 +1881,16 @@ export class WasmFluentPageBuilder {
|
|
|
1040
1881
|
}
|
|
1041
1882
|
}
|
|
1042
1883
|
/**
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1046
|
-
* @param {string} name
|
|
1047
|
-
* @param {string[]} values
|
|
1048
|
-
* @param {Float32Array} xs
|
|
1049
|
-
* @param {Float32Array} ys
|
|
1050
|
-
* @param {Float32Array} ws
|
|
1051
|
-
* @param {Float32Array} hs
|
|
1052
|
-
* @param {string | null} [selected]
|
|
1884
|
+
* @param {number} x
|
|
1885
|
+
* @param {number} y
|
|
1886
|
+
* @param {string} text
|
|
1053
1887
|
*/
|
|
1054
|
-
|
|
1888
|
+
stickyNoteAt(x, y, text) {
|
|
1055
1889
|
try {
|
|
1056
1890
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1057
|
-
const ptr0 = passStringToWasm0(
|
|
1891
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1058
1892
|
const len0 = WASM_VECTOR_LEN;
|
|
1059
|
-
|
|
1060
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1061
|
-
const ptr2 = passArrayF32ToWasm0(xs, wasm.__wbindgen_export);
|
|
1062
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1063
|
-
const ptr3 = passArrayF32ToWasm0(ys, wasm.__wbindgen_export);
|
|
1064
|
-
const len3 = WASM_VECTOR_LEN;
|
|
1065
|
-
const ptr4 = passArrayF32ToWasm0(ws, wasm.__wbindgen_export);
|
|
1066
|
-
const len4 = WASM_VECTOR_LEN;
|
|
1067
|
-
const ptr5 = passArrayF32ToWasm0(hs, wasm.__wbindgen_export);
|
|
1068
|
-
const len5 = WASM_VECTOR_LEN;
|
|
1069
|
-
var ptr6 = isLikeNone(selected) ? 0 : passStringToWasm0(selected, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1070
|
-
var len6 = WASM_VECTOR_LEN;
|
|
1071
|
-
wasm.wasmfluentpagebuilder_radioGroup(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1893
|
+
wasm.wasmfluentpagebuilder_stickyNoteAt(retptr, this.__wbg_ptr, x, y, ptr0, len0);
|
|
1072
1894
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1073
1895
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1074
1896
|
if (r1) {
|
|
@@ -1079,32 +1901,39 @@ export class WasmFluentPageBuilder {
|
|
|
1079
1901
|
}
|
|
1080
1902
|
}
|
|
1081
1903
|
/**
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1904
|
+
* Open a streaming table. Returns a `StreamingTable` handle the caller
|
|
1905
|
+
* pushes rows into; call `finish()` when done. The streamed rows are
|
|
1906
|
+
* buffered per-table and replayed against the real Rust
|
|
1907
|
+
* `StreamingTable` at `done()` commit time — avoiding the
|
|
1908
|
+
* FluentPageBuilder-lifetime problem that otherwise can't cross the
|
|
1909
|
+
* wasm-bindgen boundary.
|
|
1910
|
+
* @param {any} spec
|
|
1911
|
+
* @returns {StreamingTable}
|
|
1087
1912
|
*/
|
|
1088
|
-
|
|
1913
|
+
streamingTable(spec) {
|
|
1089
1914
|
try {
|
|
1090
1915
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1091
|
-
wasm.
|
|
1916
|
+
wasm.wasmfluentpagebuilder_streamingTable(retptr, this.__wbg_ptr, addHeapObject(spec));
|
|
1092
1917
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1093
1918
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1094
|
-
|
|
1095
|
-
|
|
1919
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1920
|
+
if (r2) {
|
|
1921
|
+
throw takeObject(r1);
|
|
1096
1922
|
}
|
|
1923
|
+
return StreamingTable.__wrap(r0);
|
|
1097
1924
|
} finally {
|
|
1098
1925
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1099
1926
|
}
|
|
1100
1927
|
}
|
|
1101
1928
|
/**
|
|
1102
|
-
* @param {number}
|
|
1929
|
+
* @param {number} r
|
|
1930
|
+
* @param {number} g
|
|
1931
|
+
* @param {number} b
|
|
1103
1932
|
*/
|
|
1104
|
-
|
|
1933
|
+
strikeout(r, g, b) {
|
|
1105
1934
|
try {
|
|
1106
1935
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1107
|
-
wasm.
|
|
1936
|
+
wasm.wasmfluentpagebuilder_strikeout(retptr, this.__wbg_ptr, r, g, b);
|
|
1108
1937
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1109
1938
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1110
1939
|
if (r1) {
|
|
@@ -1115,14 +1944,20 @@ export class WasmFluentPageBuilder {
|
|
|
1115
1944
|
}
|
|
1116
1945
|
}
|
|
1117
1946
|
/**
|
|
1947
|
+
* Draw a straight line with explicit stroke width and RGB colour.
|
|
1948
|
+
* @param {number} x1
|
|
1949
|
+
* @param {number} y1
|
|
1950
|
+
* @param {number} x2
|
|
1951
|
+
* @param {number} y2
|
|
1952
|
+
* @param {number} width
|
|
1118
1953
|
* @param {number} r
|
|
1119
1954
|
* @param {number} g
|
|
1120
1955
|
* @param {number} b
|
|
1121
1956
|
*/
|
|
1122
|
-
|
|
1957
|
+
strokeLine(x1, y1, x2, y2, width, r, g, b) {
|
|
1123
1958
|
try {
|
|
1124
1959
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1125
|
-
wasm.
|
|
1960
|
+
wasm.wasmfluentpagebuilder_strokeLine(retptr, this.__wbg_ptr, x1, y1, x2, y2, width, r, g, b);
|
|
1126
1961
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1127
1962
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1128
1963
|
if (r1) {
|
|
@@ -1133,14 +1968,24 @@ export class WasmFluentPageBuilder {
|
|
|
1133
1968
|
}
|
|
1134
1969
|
}
|
|
1135
1970
|
/**
|
|
1136
|
-
*
|
|
1971
|
+
* Draw a dashed line. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
|
|
1972
|
+
* @param {number} x1
|
|
1973
|
+
* @param {number} y1
|
|
1974
|
+
* @param {number} x2
|
|
1975
|
+
* @param {number} y2
|
|
1976
|
+
* @param {number} width
|
|
1977
|
+
* @param {number} r
|
|
1978
|
+
* @param {number} g
|
|
1979
|
+
* @param {number} b
|
|
1980
|
+
* @param {Float32Array} dash
|
|
1981
|
+
* @param {number} phase
|
|
1137
1982
|
*/
|
|
1138
|
-
|
|
1983
|
+
strokeLineDashed(x1, y1, x2, y2, width, r, g, b, dash, phase) {
|
|
1139
1984
|
try {
|
|
1140
1985
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1141
|
-
const ptr0 =
|
|
1986
|
+
const ptr0 = passArrayF32ToWasm0(dash, wasm.__wbindgen_export);
|
|
1142
1987
|
const len0 = WASM_VECTOR_LEN;
|
|
1143
|
-
wasm.
|
|
1988
|
+
wasm.wasmfluentpagebuilder_strokeLineDashed(retptr, this.__wbg_ptr, x1, y1, x2, y2, width, r, g, b, ptr0, len0, phase);
|
|
1144
1989
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1145
1990
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1146
1991
|
if (r1) {
|
|
@@ -1151,14 +1996,20 @@ export class WasmFluentPageBuilder {
|
|
|
1151
1996
|
}
|
|
1152
1997
|
}
|
|
1153
1998
|
/**
|
|
1154
|
-
*
|
|
1999
|
+
* Draw a stroked rectangle with explicit stroke width and RGB colour.
|
|
2000
|
+
* @param {number} x
|
|
2001
|
+
* @param {number} y
|
|
2002
|
+
* @param {number} w
|
|
2003
|
+
* @param {number} h
|
|
2004
|
+
* @param {number} width
|
|
2005
|
+
* @param {number} r
|
|
2006
|
+
* @param {number} g
|
|
2007
|
+
* @param {number} b
|
|
1155
2008
|
*/
|
|
1156
|
-
|
|
2009
|
+
strokeRect(x, y, w, h, width, r, g, b) {
|
|
1157
2010
|
try {
|
|
1158
2011
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1159
|
-
|
|
1160
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1161
|
-
wasm.wasmfluentpagebuilder_stickyNote(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2012
|
+
wasm.wasmfluentpagebuilder_strokeRect(retptr, this.__wbg_ptr, x, y, w, h, width, r, g, b);
|
|
1162
2013
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1163
2014
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1164
2015
|
if (r1) {
|
|
@@ -1169,16 +2020,24 @@ export class WasmFluentPageBuilder {
|
|
|
1169
2020
|
}
|
|
1170
2021
|
}
|
|
1171
2022
|
/**
|
|
2023
|
+
* Draw a dashed rectangle border. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
|
|
1172
2024
|
* @param {number} x
|
|
1173
2025
|
* @param {number} y
|
|
1174
|
-
* @param {
|
|
2026
|
+
* @param {number} w
|
|
2027
|
+
* @param {number} h
|
|
2028
|
+
* @param {number} width
|
|
2029
|
+
* @param {number} r
|
|
2030
|
+
* @param {number} g
|
|
2031
|
+
* @param {number} b
|
|
2032
|
+
* @param {Float32Array} dash
|
|
2033
|
+
* @param {number} phase
|
|
1175
2034
|
*/
|
|
1176
|
-
|
|
2035
|
+
strokeRectDashed(x, y, w, h, width, r, g, b, dash, phase) {
|
|
1177
2036
|
try {
|
|
1178
2037
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1179
|
-
const ptr0 =
|
|
2038
|
+
const ptr0 = passArrayF32ToWasm0(dash, wasm.__wbindgen_export);
|
|
1180
2039
|
const len0 = WASM_VECTOR_LEN;
|
|
1181
|
-
wasm.
|
|
2040
|
+
wasm.wasmfluentpagebuilder_strokeRectDashed(retptr, this.__wbg_ptr, x, y, w, h, width, r, g, b, ptr0, len0, phase);
|
|
1182
2041
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1183
2042
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1184
2043
|
if (r1) {
|
|
@@ -1189,14 +2048,27 @@ export class WasmFluentPageBuilder {
|
|
|
1189
2048
|
}
|
|
1190
2049
|
}
|
|
1191
2050
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
2051
|
+
* Render a buffered table from a JS object:
|
|
2052
|
+
*
|
|
2053
|
+
* ```javascript
|
|
2054
|
+
* page.table({
|
|
2055
|
+
* columns: [
|
|
2056
|
+
* { header: "SKU", width: 100, align: Align.Left },
|
|
2057
|
+
* { header: "Qty", width: 60, align: Align.Right },
|
|
2058
|
+
* ],
|
|
2059
|
+
* rows: [["A-1","12"], ["B-2","3"]],
|
|
2060
|
+
* hasHeader: true,
|
|
2061
|
+
* });
|
|
2062
|
+
* ```
|
|
2063
|
+
*
|
|
2064
|
+
* Uses `serde-wasm-bindgen` for deserialisation. Replays against the
|
|
2065
|
+
* Rust `Table` builder at `done()` commit time.
|
|
2066
|
+
* @param {any} spec
|
|
1195
2067
|
*/
|
|
1196
|
-
|
|
2068
|
+
table(spec) {
|
|
1197
2069
|
try {
|
|
1198
2070
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1199
|
-
wasm.
|
|
2071
|
+
wasm.wasmfluentpagebuilder_table(retptr, this.__wbg_ptr, addHeapObject(spec));
|
|
1200
2072
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1201
2073
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1202
2074
|
if (r1) {
|
|
@@ -1249,6 +2121,32 @@ export class WasmFluentPageBuilder {
|
|
|
1249
2121
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1250
2122
|
}
|
|
1251
2123
|
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Place wrapped text inside a rectangle with horizontal alignment.
|
|
2126
|
+
* `align` is the `Align` enum (0 = Left, 1 = Center, 2 = Right) — also
|
|
2127
|
+
* accepts a raw integer for JS callers that pre-date the enum import.
|
|
2128
|
+
* @param {number} x
|
|
2129
|
+
* @param {number} y
|
|
2130
|
+
* @param {number} w
|
|
2131
|
+
* @param {number} h
|
|
2132
|
+
* @param {string} text
|
|
2133
|
+
* @param {number} align
|
|
2134
|
+
*/
|
|
2135
|
+
textInRect(x, y, w, h, text, align) {
|
|
2136
|
+
try {
|
|
2137
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2138
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2139
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2140
|
+
wasm.wasmfluentpagebuilder_textInRect(retptr, this.__wbg_ptr, x, y, w, h, ptr0, len0, align);
|
|
2141
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2142
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2143
|
+
if (r1) {
|
|
2144
|
+
throw takeObject(r0);
|
|
2145
|
+
}
|
|
2146
|
+
} finally {
|
|
2147
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
1252
2150
|
/**
|
|
1253
2151
|
* @param {number} r
|
|
1254
2152
|
* @param {number} g
|
|
@@ -2721,6 +3619,53 @@ export class WasmPdfDocument {
|
|
|
2721
3619
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2722
3620
|
}
|
|
2723
3621
|
}
|
|
3622
|
+
/**
|
|
3623
|
+
* Create a flattened PDF where each page is rendered as an image.
|
|
3624
|
+
* Burns in all annotations, form fields, and overlays.
|
|
3625
|
+
* Returns the flattened PDF as bytes.
|
|
3626
|
+
* @param {number | null} [dpi]
|
|
3627
|
+
* @returns {Uint8Array}
|
|
3628
|
+
*/
|
|
3629
|
+
flattenToImages(dpi) {
|
|
3630
|
+
try {
|
|
3631
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3632
|
+
wasm.wasmpdfdocument_flattenToImages(retptr, this.__wbg_ptr, isLikeNone(dpi) ? 0x100000001 : (dpi) >>> 0);
|
|
3633
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3634
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3635
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3636
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3637
|
+
if (r3) {
|
|
3638
|
+
throw takeObject(r2);
|
|
3639
|
+
}
|
|
3640
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3641
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3642
|
+
return v1;
|
|
3643
|
+
} finally {
|
|
3644
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
/**
|
|
3648
|
+
* Return warnings collected during the last form-flattening save.
|
|
3649
|
+
*
|
|
3650
|
+
* Each entry names a widget field that had no `/AP` appearance stream;
|
|
3651
|
+
* flattening such a field produces a blank rectangle.
|
|
3652
|
+
*
|
|
3653
|
+
* @returns Array of warning strings
|
|
3654
|
+
* @returns {string[]}
|
|
3655
|
+
*/
|
|
3656
|
+
flattenWarnings() {
|
|
3657
|
+
try {
|
|
3658
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3659
|
+
wasm.wasmpdfdocument_flattenWarnings(retptr, this.__wbg_ptr);
|
|
3660
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3661
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3662
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
3663
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3664
|
+
return v1;
|
|
3665
|
+
} finally {
|
|
3666
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
2724
3669
|
/**
|
|
2725
3670
|
* Get annotations from a page.
|
|
2726
3671
|
*
|
|
@@ -3137,6 +4082,36 @@ export class WasmPdfDocument {
|
|
|
3137
4082
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3138
4083
|
}
|
|
3139
4084
|
}
|
|
4085
|
+
/**
|
|
4086
|
+
* Render a page to an image (PNG).
|
|
4087
|
+
*
|
|
4088
|
+
* Requires the `rendering` feature.
|
|
4089
|
+
*
|
|
4090
|
+
* @param page_index - Zero-based page number
|
|
4091
|
+
* @param dpi - Dots per inch (default: 150)
|
|
4092
|
+
* @returns Uint8Array containing the PNG image data
|
|
4093
|
+
* @param {number} page_index
|
|
4094
|
+
* @param {number | null} [dpi]
|
|
4095
|
+
* @returns {Uint8Array}
|
|
4096
|
+
*/
|
|
4097
|
+
renderPage(page_index, dpi) {
|
|
4098
|
+
try {
|
|
4099
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4100
|
+
wasm.wasmpdfdocument_renderPage(retptr, this.__wbg_ptr, page_index, isLikeNone(dpi) ? 0x100000001 : (dpi) >>> 0);
|
|
4101
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4102
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4103
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
4104
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
4105
|
+
if (r3) {
|
|
4106
|
+
throw takeObject(r2);
|
|
4107
|
+
}
|
|
4108
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
4109
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
4110
|
+
return v1;
|
|
4111
|
+
} finally {
|
|
4112
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
3140
4115
|
/**
|
|
3141
4116
|
* Reposition an image on a page.
|
|
3142
4117
|
* @param {number} page_index
|
|
@@ -3297,6 +4272,37 @@ export class WasmPdfDocument {
|
|
|
3297
4272
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3298
4273
|
}
|
|
3299
4274
|
}
|
|
4275
|
+
/**
|
|
4276
|
+
* Save with options (compress, garbage_collect, linearize) and return bytes.
|
|
4277
|
+
*
|
|
4278
|
+
* @param {Object} [options] - Optional save options.
|
|
4279
|
+
* @param {boolean} [options.compress=true] - Compress raw streams with FlateDecode.
|
|
4280
|
+
* @param {boolean} [options.garbageCollect=true] - Remove unreachable objects.
|
|
4281
|
+
* @param {boolean} [options.linearize=false] - Linearize (reserved, no-op).
|
|
4282
|
+
* @returns Uint8Array containing the modified PDF
|
|
4283
|
+
* @param {boolean | null} [compress]
|
|
4284
|
+
* @param {boolean | null} [garbage_collect]
|
|
4285
|
+
* @param {boolean | null} [linearize]
|
|
4286
|
+
* @returns {Uint8Array}
|
|
4287
|
+
*/
|
|
4288
|
+
saveWithOptions(compress, garbage_collect, linearize) {
|
|
4289
|
+
try {
|
|
4290
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4291
|
+
wasm.wasmpdfdocument_saveWithOptions(retptr, this.__wbg_ptr, isLikeNone(compress) ? 0xFFFFFF : compress ? 1 : 0, isLikeNone(garbage_collect) ? 0xFFFFFF : garbage_collect ? 1 : 0, isLikeNone(linearize) ? 0xFFFFFF : linearize ? 1 : 0);
|
|
4292
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4293
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4294
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
4295
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
4296
|
+
if (r3) {
|
|
4297
|
+
throw takeObject(r2);
|
|
4298
|
+
}
|
|
4299
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
4300
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
4301
|
+
return v1;
|
|
4302
|
+
} finally {
|
|
4303
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
3300
4306
|
/**
|
|
3301
4307
|
* Search for text across all pages.
|
|
3302
4308
|
*
|
|
@@ -4154,10 +5160,9 @@ if (Symbol.dispose) WasmPdfPageRegion.prototype[Symbol.dispose] = WasmPdfPageReg
|
|
|
4154
5160
|
|
|
4155
5161
|
/**
|
|
4156
5162
|
* A single existing PDF signature surfaced by
|
|
4157
|
-
* `WasmPdfDocument.signatures()`. `verify()` runs the
|
|
4158
|
-
*
|
|
4159
|
-
*
|
|
4160
|
-
* throw an `UnsupportedFeature`-mapped JS error.
|
|
5163
|
+
* `WasmPdfDocument.signatures()`. `verify()` runs the signer-attributes
|
|
5164
|
+
* check; `verifyDetached()` adds the `messageDigest` content-hash check.
|
|
5165
|
+
* Supported: RSA-PKCS#1 v1.5, RSA-PSS, ECDSA P-256/P-384.
|
|
4161
5166
|
*/
|
|
4162
5167
|
export class WasmSignature {
|
|
4163
5168
|
static __wrap(ptr) {
|
|
@@ -4488,7 +5493,11 @@ export class WasmTimestamp {
|
|
|
4488
5493
|
}
|
|
4489
5494
|
}
|
|
4490
5495
|
/**
|
|
4491
|
-
*
|
|
5496
|
+
* Cryptographically verify this TimeStampToken.
|
|
5497
|
+
*
|
|
5498
|
+
* Returns `true` when the TSA's signature and `messageDigest` both pass.
|
|
5499
|
+
* Returns `false` when a crypto check fails (tampered token or wrong key).
|
|
5500
|
+
* Throws when the token is not CMS-wrapped or uses an unsupported algorithm.
|
|
4492
5501
|
* @returns {boolean}
|
|
4493
5502
|
*/
|
|
4494
5503
|
verify() {
|
|
@@ -4550,10 +5559,51 @@ export function setLogLevel(level) {
|
|
|
4550
5559
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4551
5560
|
}
|
|
4552
5561
|
}
|
|
5562
|
+
|
|
5563
|
+
/**
|
|
5564
|
+
* Sign raw PDF bytes and return the signed PDF as a `Uint8Array`.
|
|
5565
|
+
*
|
|
5566
|
+
* `cert` must carry a private key (loaded via `Certificate.loadPem` or
|
|
5567
|
+
* `Certificate.loadPkcs12`).
|
|
5568
|
+
* @param {Uint8Array} pdf_data
|
|
5569
|
+
* @param {WasmCertificate} cert
|
|
5570
|
+
* @param {string | null} [reason]
|
|
5571
|
+
* @param {string | null} [location]
|
|
5572
|
+
* @returns {Uint8Array}
|
|
5573
|
+
*/
|
|
5574
|
+
export function signPdfBytes(pdf_data, cert, reason, location) {
|
|
5575
|
+
try {
|
|
5576
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5577
|
+
const ptr0 = passArray8ToWasm0(pdf_data, wasm.__wbindgen_export);
|
|
5578
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5579
|
+
_assertClass(cert, WasmCertificate);
|
|
5580
|
+
var ptr1 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
5581
|
+
var len1 = WASM_VECTOR_LEN;
|
|
5582
|
+
var ptr2 = isLikeNone(location) ? 0 : passStringToWasm0(location, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
5583
|
+
var len2 = WASM_VECTOR_LEN;
|
|
5584
|
+
wasm.signPdfBytes(retptr, ptr0, len0, cert.__wbg_ptr, ptr1, len1, ptr2, len2);
|
|
5585
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5586
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5587
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5588
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5589
|
+
if (r3) {
|
|
5590
|
+
throw takeObject(r2);
|
|
5591
|
+
}
|
|
5592
|
+
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5593
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
5594
|
+
return v4;
|
|
5595
|
+
} finally {
|
|
5596
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5597
|
+
}
|
|
5598
|
+
}
|
|
4553
5599
|
export function __wbg_Error_960c155d3d49e4c2(arg0, arg1) {
|
|
4554
5600
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
4555
5601
|
return addHeapObject(ret);
|
|
4556
5602
|
}
|
|
5603
|
+
export function __wbg_Number_32bf70a599af1d4b(arg0) {
|
|
5604
|
+
const ret = Number(getObject(arg0));
|
|
5605
|
+
return ret;
|
|
5606
|
+
}
|
|
4557
5607
|
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
4558
5608
|
const ret = String(getObject(arg1));
|
|
4559
5609
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -4561,6 +5611,12 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
4561
5611
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4562
5612
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4563
5613
|
}
|
|
5614
|
+
export function __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51(arg0, arg1) {
|
|
5615
|
+
const v = getObject(arg1);
|
|
5616
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
5617
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
5618
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
5619
|
+
}
|
|
4564
5620
|
export function __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff(arg0) {
|
|
4565
5621
|
const v = getObject(arg0);
|
|
4566
5622
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
@@ -4573,6 +5629,14 @@ export function __wbg___wbindgen_debug_string_ab4b34d23d6778bd(arg0, arg1) {
|
|
|
4573
5629
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4574
5630
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4575
5631
|
}
|
|
5632
|
+
export function __wbg___wbindgen_in_a5d8b22e52b24dd1(arg0, arg1) {
|
|
5633
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
5634
|
+
return ret;
|
|
5635
|
+
}
|
|
5636
|
+
export function __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93(arg0) {
|
|
5637
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
5638
|
+
return ret;
|
|
5639
|
+
}
|
|
4576
5640
|
export function __wbg___wbindgen_is_function_3baa9db1a987f47d(arg0) {
|
|
4577
5641
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
4578
5642
|
return ret;
|
|
@@ -4594,6 +5658,10 @@ export function __wbg___wbindgen_is_undefined_29a43b4d42920abd(arg0) {
|
|
|
4594
5658
|
const ret = getObject(arg0) === undefined;
|
|
4595
5659
|
return ret;
|
|
4596
5660
|
}
|
|
5661
|
+
export function __wbg___wbindgen_jsval_eq_d3465d8a07697228(arg0, arg1) {
|
|
5662
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
5663
|
+
return ret;
|
|
5664
|
+
}
|
|
4597
5665
|
export function __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c(arg0, arg1) {
|
|
4598
5666
|
const ret = getObject(arg0) == getObject(arg1);
|
|
4599
5667
|
return ret;
|
|
@@ -4671,6 +5739,10 @@ export function __wbg_get_unchecked_17f53dad852b9588(arg0, arg1) {
|
|
|
4671
5739
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
4672
5740
|
return addHeapObject(ret);
|
|
4673
5741
|
}
|
|
5742
|
+
export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
5743
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
5744
|
+
return addHeapObject(ret);
|
|
5745
|
+
}
|
|
4674
5746
|
export function __wbg_info_e1c3400f7bf783dc(arg0, arg1, arg2, arg3) {
|
|
4675
5747
|
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
4676
5748
|
}
|
|
@@ -4698,6 +5770,10 @@ export function __wbg_isArray_c3109d14ffc06469(arg0) {
|
|
|
4698
5770
|
const ret = Array.isArray(getObject(arg0));
|
|
4699
5771
|
return ret;
|
|
4700
5772
|
}
|
|
5773
|
+
export function __wbg_isSafeInteger_4fc213d1989d6d2a(arg0) {
|
|
5774
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
5775
|
+
return ret;
|
|
5776
|
+
}
|
|
4701
5777
|
export function __wbg_iterator_013bc09ec998c2a7() {
|
|
4702
5778
|
const ret = Symbol.iterator;
|
|
4703
5779
|
return addHeapObject(ret);
|
|
@@ -4864,6 +5940,9 @@ const WasmPdfPageRegionFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
4864
5940
|
const WasmSignatureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4865
5941
|
? { register: () => {}, unregister: () => {} }
|
|
4866
5942
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsignature_free(ptr >>> 0, 1));
|
|
5943
|
+
const StreamingTableFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5944
|
+
? { register: () => {}, unregister: () => {} }
|
|
5945
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_streamingtable_free(ptr >>> 0, 1));
|
|
4867
5946
|
const WasmTimestampFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4868
5947
|
? { register: () => {}, unregister: () => {} }
|
|
4869
5948
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtimestamp_free(ptr >>> 0, 1));
|