@quillmark/wasm 0.42.2 → 0.44.0
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/wasm.d.ts +55 -28
- package/bundler/wasm_bg.js +96 -0
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +4 -0
- package/node-esm/wasm.d.ts +55 -28
- package/node-esm/wasm_bg.js +96 -0
- package/node-esm/wasm_bg.wasm +0 -0
- package/node-esm/wasm_bg.wasm.d.ts +4 -0
- package/package.json +1 -1
package/bundler/wasm.d.ts
CHANGED
|
@@ -4,60 +4,83 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt" | "png";
|
|
8
|
+
|
|
9
|
+
export interface CompileOptions {
|
|
10
|
+
quillRef?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface QuillInfo {
|
|
14
|
+
name: string;
|
|
15
|
+
backend: string;
|
|
16
|
+
metadata: Record<string, any>;
|
|
17
|
+
example?: string;
|
|
18
|
+
schema: Record<string, any>;
|
|
19
|
+
defaults: Record<string, any>;
|
|
20
|
+
examples: Record<string, any[]>;
|
|
21
|
+
supportedFormats: OutputFormat[];
|
|
12
22
|
}
|
|
13
23
|
|
|
24
|
+
export type Severity = "error" | "warning" | "note";
|
|
25
|
+
|
|
14
26
|
export interface Location {
|
|
15
27
|
file: string;
|
|
16
28
|
line: number;
|
|
17
29
|
column: number;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
21
|
-
|
|
22
32
|
export interface Artifact {
|
|
23
33
|
format: OutputFormat;
|
|
24
34
|
bytes: Uint8Array;
|
|
25
35
|
mimeType: string;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
export interface ParsedDocument {
|
|
39
|
+
fields: Record<string, any>;
|
|
40
|
+
quillRef: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface RenderResult {
|
|
44
|
+
artifacts: Artifact[];
|
|
45
|
+
warnings: Diagnostic[];
|
|
46
|
+
outputFormat: OutputFormat;
|
|
47
|
+
renderTimeMs: number;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
export interface RenderOptions {
|
|
38
51
|
format?: OutputFormat;
|
|
39
52
|
assets?: Record<string, Uint8Array | number[]>;
|
|
40
53
|
quillRef?: string;
|
|
54
|
+
ppi?: number;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
|
-
export interface
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
metadata: Record<string, any>;
|
|
47
|
-
example?: string;
|
|
48
|
-
schema: Record<string, any>;
|
|
49
|
-
defaults: Record<string, any>;
|
|
50
|
-
examples: Record<string, any[]>;
|
|
51
|
-
supportedFormats: OutputFormat[];
|
|
57
|
+
export interface RenderPagesOptions {
|
|
58
|
+
format: OutputFormat;
|
|
59
|
+
ppi?: number;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
export interface Diagnostic {
|
|
63
|
+
severity: Severity;
|
|
64
|
+
code?: string;
|
|
65
|
+
message: string;
|
|
66
|
+
location?: Location;
|
|
67
|
+
hint?: string;
|
|
68
|
+
sourceChain: string[];
|
|
59
69
|
}
|
|
60
70
|
|
|
71
|
+
export class CompiledDocument {
|
|
72
|
+
private constructor();
|
|
73
|
+
free(): void;
|
|
74
|
+
[Symbol.dispose](): void;
|
|
75
|
+
/**
|
|
76
|
+
* Render selected pages. `pages = null/undefined` renders all pages.
|
|
77
|
+
*/
|
|
78
|
+
renderPages(pages: Uint32Array | null | undefined, opts: RenderPagesOptions): RenderResult;
|
|
79
|
+
/**
|
|
80
|
+
* Number of pages in this compiled document.
|
|
81
|
+
*/
|
|
82
|
+
readonly pageCount: number;
|
|
83
|
+
}
|
|
61
84
|
/**
|
|
62
85
|
* Quillmark WASM Engine
|
|
63
86
|
*
|
|
@@ -135,6 +158,10 @@ export class Quillmark {
|
|
|
135
158
|
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
136
159
|
*/
|
|
137
160
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
161
|
+
/**
|
|
162
|
+
* Compile a parsed document into an opaque compiled document handle.
|
|
163
|
+
*/
|
|
164
|
+
compile(parsed: ParsedDocument, opts?: CompileOptions | null): CompiledDocument;
|
|
138
165
|
/**
|
|
139
166
|
* Perform a dry run validation without backend compilation.
|
|
140
167
|
*
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -214,6 +214,22 @@ export function init() {
|
|
|
214
214
|
wasm.init();
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
+
let cachedUint32ArrayMemory0 = null;
|
|
218
|
+
|
|
219
|
+
function getUint32ArrayMemory0() {
|
|
220
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
221
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
222
|
+
}
|
|
223
|
+
return cachedUint32ArrayMemory0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
227
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
228
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
229
|
+
WASM_VECTOR_LEN = arg.length;
|
|
230
|
+
return ptr;
|
|
231
|
+
}
|
|
232
|
+
|
|
217
233
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
218
234
|
ptr = ptr >>> 0;
|
|
219
235
|
const mem = getDataViewMemory0();
|
|
@@ -224,6 +240,65 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
224
240
|
return result;
|
|
225
241
|
}
|
|
226
242
|
|
|
243
|
+
const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
244
|
+
? { register: () => {}, unregister: () => {} }
|
|
245
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_compileddocument_free(ptr >>> 0, 1));
|
|
246
|
+
|
|
247
|
+
export class CompiledDocument {
|
|
248
|
+
|
|
249
|
+
static __wrap(ptr) {
|
|
250
|
+
ptr = ptr >>> 0;
|
|
251
|
+
const obj = Object.create(CompiledDocument.prototype);
|
|
252
|
+
obj.__wbg_ptr = ptr;
|
|
253
|
+
CompiledDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
254
|
+
return obj;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
__destroy_into_raw() {
|
|
258
|
+
const ptr = this.__wbg_ptr;
|
|
259
|
+
this.__wbg_ptr = 0;
|
|
260
|
+
CompiledDocumentFinalization.unregister(this);
|
|
261
|
+
return ptr;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
free() {
|
|
265
|
+
const ptr = this.__destroy_into_raw();
|
|
266
|
+
wasm.__wbg_compileddocument_free(ptr, 0);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Number of pages in this compiled document.
|
|
270
|
+
* @returns {number}
|
|
271
|
+
*/
|
|
272
|
+
get pageCount() {
|
|
273
|
+
const ret = wasm.compileddocument_pageCount(this.__wbg_ptr);
|
|
274
|
+
return ret >>> 0;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Render selected pages. `pages = null/undefined` renders all pages.
|
|
278
|
+
* @param {Uint32Array | null | undefined} pages
|
|
279
|
+
* @param {RenderPagesOptions} opts
|
|
280
|
+
* @returns {RenderResult}
|
|
281
|
+
*/
|
|
282
|
+
renderPages(pages, opts) {
|
|
283
|
+
try {
|
|
284
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
285
|
+
var ptr0 = isLikeNone(pages) ? 0 : passArray32ToWasm0(pages, wasm.__wbindgen_export_0);
|
|
286
|
+
var len0 = WASM_VECTOR_LEN;
|
|
287
|
+
wasm.compileddocument_renderPages(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(opts));
|
|
288
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
291
|
+
if (r2) {
|
|
292
|
+
throw takeObject(r1);
|
|
293
|
+
}
|
|
294
|
+
return takeObject(r0);
|
|
295
|
+
} finally {
|
|
296
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (Symbol.dispose) CompiledDocument.prototype[Symbol.dispose] = CompiledDocument.prototype.free;
|
|
301
|
+
|
|
227
302
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
228
303
|
? { register: () => {}, unregister: () => {} }
|
|
229
304
|
: new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
|
|
@@ -451,6 +526,27 @@ export class Quillmark {
|
|
|
451
526
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
452
527
|
}
|
|
453
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* Compile a parsed document into an opaque compiled document handle.
|
|
531
|
+
* @param {ParsedDocument} parsed
|
|
532
|
+
* @param {CompileOptions | null} [opts]
|
|
533
|
+
* @returns {CompiledDocument}
|
|
534
|
+
*/
|
|
535
|
+
compile(parsed, opts) {
|
|
536
|
+
try {
|
|
537
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
538
|
+
wasm.quillmark_compile(retptr, this.__wbg_ptr, addHeapObject(parsed), isLikeNone(opts) ? 0 : addHeapObject(opts));
|
|
539
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
540
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
541
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
542
|
+
if (r2) {
|
|
543
|
+
throw takeObject(r1);
|
|
544
|
+
}
|
|
545
|
+
return CompiledDocument.__wrap(r0);
|
|
546
|
+
} finally {
|
|
547
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
454
550
|
/**
|
|
455
551
|
* Perform a dry run validation without backend compilation.
|
|
456
552
|
*
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_compileddocument_free: (a: number, b: number) => void;
|
|
4
5
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
6
|
+
export const compileddocument_pageCount: (a: number) => number;
|
|
7
|
+
export const compileddocument_renderPages: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
5
8
|
export const init: () => void;
|
|
9
|
+
export const quillmark_compile: (a: number, b: number, c: number, d: number) => void;
|
|
6
10
|
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
11
|
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
12
|
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
package/node-esm/wasm.d.ts
CHANGED
|
@@ -4,60 +4,83 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt" | "png";
|
|
8
|
+
|
|
9
|
+
export interface CompileOptions {
|
|
10
|
+
quillRef?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface QuillInfo {
|
|
14
|
+
name: string;
|
|
15
|
+
backend: string;
|
|
16
|
+
metadata: Record<string, any>;
|
|
17
|
+
example?: string;
|
|
18
|
+
schema: Record<string, any>;
|
|
19
|
+
defaults: Record<string, any>;
|
|
20
|
+
examples: Record<string, any[]>;
|
|
21
|
+
supportedFormats: OutputFormat[];
|
|
12
22
|
}
|
|
13
23
|
|
|
24
|
+
export type Severity = "error" | "warning" | "note";
|
|
25
|
+
|
|
14
26
|
export interface Location {
|
|
15
27
|
file: string;
|
|
16
28
|
line: number;
|
|
17
29
|
column: number;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
21
|
-
|
|
22
32
|
export interface Artifact {
|
|
23
33
|
format: OutputFormat;
|
|
24
34
|
bytes: Uint8Array;
|
|
25
35
|
mimeType: string;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
export interface ParsedDocument {
|
|
39
|
+
fields: Record<string, any>;
|
|
40
|
+
quillRef: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface RenderResult {
|
|
44
|
+
artifacts: Artifact[];
|
|
45
|
+
warnings: Diagnostic[];
|
|
46
|
+
outputFormat: OutputFormat;
|
|
47
|
+
renderTimeMs: number;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
export interface RenderOptions {
|
|
38
51
|
format?: OutputFormat;
|
|
39
52
|
assets?: Record<string, Uint8Array | number[]>;
|
|
40
53
|
quillRef?: string;
|
|
54
|
+
ppi?: number;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
|
-
export interface
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
metadata: Record<string, any>;
|
|
47
|
-
example?: string;
|
|
48
|
-
schema: Record<string, any>;
|
|
49
|
-
defaults: Record<string, any>;
|
|
50
|
-
examples: Record<string, any[]>;
|
|
51
|
-
supportedFormats: OutputFormat[];
|
|
57
|
+
export interface RenderPagesOptions {
|
|
58
|
+
format: OutputFormat;
|
|
59
|
+
ppi?: number;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
export interface Diagnostic {
|
|
63
|
+
severity: Severity;
|
|
64
|
+
code?: string;
|
|
65
|
+
message: string;
|
|
66
|
+
location?: Location;
|
|
67
|
+
hint?: string;
|
|
68
|
+
sourceChain: string[];
|
|
59
69
|
}
|
|
60
70
|
|
|
71
|
+
export class CompiledDocument {
|
|
72
|
+
private constructor();
|
|
73
|
+
free(): void;
|
|
74
|
+
[Symbol.dispose](): void;
|
|
75
|
+
/**
|
|
76
|
+
* Render selected pages. `pages = null/undefined` renders all pages.
|
|
77
|
+
*/
|
|
78
|
+
renderPages(pages: Uint32Array | null | undefined, opts: RenderPagesOptions): RenderResult;
|
|
79
|
+
/**
|
|
80
|
+
* Number of pages in this compiled document.
|
|
81
|
+
*/
|
|
82
|
+
readonly pageCount: number;
|
|
83
|
+
}
|
|
61
84
|
/**
|
|
62
85
|
* Quillmark WASM Engine
|
|
63
86
|
*
|
|
@@ -135,6 +158,10 @@ export class Quillmark {
|
|
|
135
158
|
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
136
159
|
*/
|
|
137
160
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
161
|
+
/**
|
|
162
|
+
* Compile a parsed document into an opaque compiled document handle.
|
|
163
|
+
*/
|
|
164
|
+
compile(parsed: ParsedDocument, opts?: CompileOptions | null): CompiledDocument;
|
|
138
165
|
/**
|
|
139
166
|
* Perform a dry run validation without backend compilation.
|
|
140
167
|
*
|
package/node-esm/wasm_bg.js
CHANGED
|
@@ -208,6 +208,22 @@ export function init() {
|
|
|
208
208
|
wasm.init();
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
let cachedUint32ArrayMemory0 = null;
|
|
212
|
+
|
|
213
|
+
function getUint32ArrayMemory0() {
|
|
214
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
215
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
216
|
+
}
|
|
217
|
+
return cachedUint32ArrayMemory0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
221
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
222
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
223
|
+
WASM_VECTOR_LEN = arg.length;
|
|
224
|
+
return ptr;
|
|
225
|
+
}
|
|
226
|
+
|
|
211
227
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
212
228
|
ptr = ptr >>> 0;
|
|
213
229
|
const mem = getDataViewMemory0();
|
|
@@ -218,6 +234,65 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
218
234
|
return result;
|
|
219
235
|
}
|
|
220
236
|
|
|
237
|
+
const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
238
|
+
? { register: () => {}, unregister: () => {} }
|
|
239
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_compileddocument_free(ptr >>> 0, 1));
|
|
240
|
+
|
|
241
|
+
export class CompiledDocument {
|
|
242
|
+
|
|
243
|
+
static __wrap(ptr) {
|
|
244
|
+
ptr = ptr >>> 0;
|
|
245
|
+
const obj = Object.create(CompiledDocument.prototype);
|
|
246
|
+
obj.__wbg_ptr = ptr;
|
|
247
|
+
CompiledDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
248
|
+
return obj;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
__destroy_into_raw() {
|
|
252
|
+
const ptr = this.__wbg_ptr;
|
|
253
|
+
this.__wbg_ptr = 0;
|
|
254
|
+
CompiledDocumentFinalization.unregister(this);
|
|
255
|
+
return ptr;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
free() {
|
|
259
|
+
const ptr = this.__destroy_into_raw();
|
|
260
|
+
wasm.__wbg_compileddocument_free(ptr, 0);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Number of pages in this compiled document.
|
|
264
|
+
* @returns {number}
|
|
265
|
+
*/
|
|
266
|
+
get pageCount() {
|
|
267
|
+
const ret = wasm.compileddocument_pageCount(this.__wbg_ptr);
|
|
268
|
+
return ret >>> 0;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Render selected pages. `pages = null/undefined` renders all pages.
|
|
272
|
+
* @param {Uint32Array | null | undefined} pages
|
|
273
|
+
* @param {RenderPagesOptions} opts
|
|
274
|
+
* @returns {RenderResult}
|
|
275
|
+
*/
|
|
276
|
+
renderPages(pages, opts) {
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
var ptr0 = isLikeNone(pages) ? 0 : passArray32ToWasm0(pages, wasm.__wbindgen_export_0);
|
|
280
|
+
var len0 = WASM_VECTOR_LEN;
|
|
281
|
+
wasm.compileddocument_renderPages(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(opts));
|
|
282
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
283
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
284
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
285
|
+
if (r2) {
|
|
286
|
+
throw takeObject(r1);
|
|
287
|
+
}
|
|
288
|
+
return takeObject(r0);
|
|
289
|
+
} finally {
|
|
290
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (Symbol.dispose) CompiledDocument.prototype[Symbol.dispose] = CompiledDocument.prototype.free;
|
|
295
|
+
|
|
221
296
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
297
|
? { register: () => {}, unregister: () => {} }
|
|
223
298
|
: new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
|
|
@@ -445,6 +520,27 @@ export class Quillmark {
|
|
|
445
520
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
446
521
|
}
|
|
447
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* Compile a parsed document into an opaque compiled document handle.
|
|
525
|
+
* @param {ParsedDocument} parsed
|
|
526
|
+
* @param {CompileOptions | null} [opts]
|
|
527
|
+
* @returns {CompiledDocument}
|
|
528
|
+
*/
|
|
529
|
+
compile(parsed, opts) {
|
|
530
|
+
try {
|
|
531
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
532
|
+
wasm.quillmark_compile(retptr, this.__wbg_ptr, addHeapObject(parsed), isLikeNone(opts) ? 0 : addHeapObject(opts));
|
|
533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
536
|
+
if (r2) {
|
|
537
|
+
throw takeObject(r1);
|
|
538
|
+
}
|
|
539
|
+
return CompiledDocument.__wrap(r0);
|
|
540
|
+
} finally {
|
|
541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
448
544
|
/**
|
|
449
545
|
* Perform a dry run validation without backend compilation.
|
|
450
546
|
*
|
package/node-esm/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_compileddocument_free: (a: number, b: number) => void;
|
|
4
5
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
6
|
+
export const compileddocument_pageCount: (a: number) => number;
|
|
7
|
+
export const compileddocument_renderPages: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
5
8
|
export const init: () => void;
|
|
9
|
+
export const quillmark_compile: (a: number, b: number, c: number, d: number) => void;
|
|
6
10
|
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
11
|
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
12
|
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|