@wybxc/typst-ts-web-compiler 0.7.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/README.md +8 -0
- package/package.json +26 -0
- package/typst_ts_web_compiler.d.ts +187 -0
- package/typst_ts_web_compiler.mjs +1605 -0
- package/typst_ts_web_compiler_bg.wasm +0 -0
- package/typst_ts_web_compiler_bg.wasm.d.ts +59 -0
- package/wasm-pack-shim.d.mts +4 -0
- package/wasm-pack-shim.mjs +24 -0
|
@@ -0,0 +1,1605 @@
|
|
|
1
|
+
/// Processed by wasm-debundle.mjs
|
|
2
|
+
let wasm;
|
|
3
|
+
|
|
4
|
+
function addHeapObject(obj) {
|
|
5
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
6
|
+
const idx = heap_next;
|
|
7
|
+
heap_next = heap[idx];
|
|
8
|
+
|
|
9
|
+
heap[idx] = obj;
|
|
10
|
+
return idx;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _assertClass(instance, klass) {
|
|
14
|
+
if (!(instance instanceof klass)) {
|
|
15
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
20
|
+
? { register: () => {}, unregister: () => {} }
|
|
21
|
+
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
22
|
+
|
|
23
|
+
function debugString(val) {
|
|
24
|
+
// primitive types
|
|
25
|
+
const type = typeof val;
|
|
26
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
27
|
+
return `${val}`;
|
|
28
|
+
}
|
|
29
|
+
if (type == 'string') {
|
|
30
|
+
return `"${val}"`;
|
|
31
|
+
}
|
|
32
|
+
if (type == 'symbol') {
|
|
33
|
+
const description = val.description;
|
|
34
|
+
if (description == null) {
|
|
35
|
+
return 'Symbol';
|
|
36
|
+
} else {
|
|
37
|
+
return `Symbol(${description})`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (type == 'function') {
|
|
41
|
+
const name = val.name;
|
|
42
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
43
|
+
return `Function(${name})`;
|
|
44
|
+
} else {
|
|
45
|
+
return 'Function';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// objects
|
|
49
|
+
if (Array.isArray(val)) {
|
|
50
|
+
const length = val.length;
|
|
51
|
+
let debug = '[';
|
|
52
|
+
if (length > 0) {
|
|
53
|
+
debug += debugString(val[0]);
|
|
54
|
+
}
|
|
55
|
+
for(let i = 1; i < length; i++) {
|
|
56
|
+
debug += ', ' + debugString(val[i]);
|
|
57
|
+
}
|
|
58
|
+
debug += ']';
|
|
59
|
+
return debug;
|
|
60
|
+
}
|
|
61
|
+
// Test for built-in
|
|
62
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
63
|
+
let className;
|
|
64
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
65
|
+
className = builtInMatches[1];
|
|
66
|
+
} else {
|
|
67
|
+
// Failed to match the standard '[object ClassName]'
|
|
68
|
+
return toString.call(val);
|
|
69
|
+
}
|
|
70
|
+
if (className == 'Object') {
|
|
71
|
+
// we're a user defined class or Object
|
|
72
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
73
|
+
// easier than looping through ownProperties of `val`.
|
|
74
|
+
try {
|
|
75
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
76
|
+
} catch (_) {
|
|
77
|
+
return 'Object';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// errors
|
|
81
|
+
if (val instanceof Error) {
|
|
82
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
83
|
+
}
|
|
84
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
85
|
+
return className;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function dropObject(idx) {
|
|
89
|
+
if (idx < 132) return;
|
|
90
|
+
heap[idx] = heap_next;
|
|
91
|
+
heap_next = idx;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
95
|
+
ptr = ptr >>> 0;
|
|
96
|
+
const mem = getDataViewMemory0();
|
|
97
|
+
const result = [];
|
|
98
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
99
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
105
|
+
ptr = ptr >>> 0;
|
|
106
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
110
|
+
ptr = ptr >>> 0;
|
|
111
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let cachedDataViewMemory0 = null;
|
|
115
|
+
function getDataViewMemory0() {
|
|
116
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
117
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
118
|
+
}
|
|
119
|
+
return cachedDataViewMemory0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function getStringFromWasm0(ptr, len) {
|
|
123
|
+
ptr = ptr >>> 0;
|
|
124
|
+
return decodeText(ptr, len);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let cachedUint32ArrayMemory0 = null;
|
|
128
|
+
function getUint32ArrayMemory0() {
|
|
129
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
130
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
131
|
+
}
|
|
132
|
+
return cachedUint32ArrayMemory0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let cachedUint8ArrayMemory0 = null;
|
|
136
|
+
function getUint8ArrayMemory0() {
|
|
137
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
138
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
139
|
+
}
|
|
140
|
+
return cachedUint8ArrayMemory0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function getObject(idx) { return heap[idx]; }
|
|
144
|
+
|
|
145
|
+
function handleError(f, args) {
|
|
146
|
+
try {
|
|
147
|
+
return f.apply(this, args);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let heap = new Array(128).fill(undefined);
|
|
154
|
+
heap.push(undefined, null, true, false);
|
|
155
|
+
|
|
156
|
+
let heap_next = heap.length;
|
|
157
|
+
|
|
158
|
+
function isLikeNone(x) {
|
|
159
|
+
return x === undefined || x === null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
163
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
164
|
+
const real = (...args) => {
|
|
165
|
+
|
|
166
|
+
// First up with a closure we increment the internal reference
|
|
167
|
+
// count. This ensures that the Rust closure environment won't
|
|
168
|
+
// be deallocated while we're invoking it.
|
|
169
|
+
state.cnt++;
|
|
170
|
+
const a = state.a;
|
|
171
|
+
state.a = 0;
|
|
172
|
+
try {
|
|
173
|
+
return f(a, state.b, ...args);
|
|
174
|
+
} finally {
|
|
175
|
+
state.a = a;
|
|
176
|
+
real._wbg_cb_unref();
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
real._wbg_cb_unref = () => {
|
|
180
|
+
if (--state.cnt === 0) {
|
|
181
|
+
state.dtor(state.a, state.b);
|
|
182
|
+
state.a = 0;
|
|
183
|
+
CLOSURE_DTORS.unregister(state);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
187
|
+
return real;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
191
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
192
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
193
|
+
WASM_VECTOR_LEN = arg.length;
|
|
194
|
+
return ptr;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
198
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
199
|
+
const mem = getDataViewMemory0();
|
|
200
|
+
for (let i = 0; i < array.length; i++) {
|
|
201
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
202
|
+
}
|
|
203
|
+
WASM_VECTOR_LEN = array.length;
|
|
204
|
+
return ptr;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
208
|
+
if (realloc === undefined) {
|
|
209
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
210
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
211
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
212
|
+
WASM_VECTOR_LEN = buf.length;
|
|
213
|
+
return ptr;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let len = arg.length;
|
|
217
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
218
|
+
|
|
219
|
+
const mem = getUint8ArrayMemory0();
|
|
220
|
+
|
|
221
|
+
let offset = 0;
|
|
222
|
+
|
|
223
|
+
for (; offset < len; offset++) {
|
|
224
|
+
const code = arg.charCodeAt(offset);
|
|
225
|
+
if (code > 0x7F) break;
|
|
226
|
+
mem[ptr + offset] = code;
|
|
227
|
+
}
|
|
228
|
+
if (offset !== len) {
|
|
229
|
+
if (offset !== 0) {
|
|
230
|
+
arg = arg.slice(offset);
|
|
231
|
+
}
|
|
232
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
233
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
234
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
235
|
+
|
|
236
|
+
offset += ret.written;
|
|
237
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
WASM_VECTOR_LEN = offset;
|
|
241
|
+
return ptr;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function takeObject(idx) {
|
|
245
|
+
const ret = getObject(idx);
|
|
246
|
+
dropObject(idx);
|
|
247
|
+
return ret;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
251
|
+
cachedTextDecoder.decode();
|
|
252
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
253
|
+
let numBytesDecoded = 0;
|
|
254
|
+
function decodeText(ptr, len) {
|
|
255
|
+
numBytesDecoded += len;
|
|
256
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
257
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
258
|
+
cachedTextDecoder.decode();
|
|
259
|
+
numBytesDecoded = len;
|
|
260
|
+
}
|
|
261
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const cachedTextEncoder = new TextEncoder();
|
|
265
|
+
|
|
266
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
267
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
268
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
269
|
+
view.set(buf);
|
|
270
|
+
return {
|
|
271
|
+
read: arg.length,
|
|
272
|
+
written: buf.length
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
let WASM_VECTOR_LEN = 0;
|
|
278
|
+
|
|
279
|
+
function __wasm_bindgen_func_elem_982(arg0, arg1, arg2) {
|
|
280
|
+
wasm.__wasm_bindgen_func_elem_982(arg0, arg1, addHeapObject(arg2));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function __wasm_bindgen_func_elem_37495(arg0, arg1, arg2, arg3) {
|
|
284
|
+
wasm.__wasm_bindgen_func_elem_37495(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const IncrServerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
288
|
+
? { register: () => {}, unregister: () => {} }
|
|
289
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_incrserver_free(ptr >>> 0, 1));
|
|
290
|
+
|
|
291
|
+
const ProxyContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
292
|
+
? { register: () => {}, unregister: () => {} }
|
|
293
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_proxycontext_free(ptr >>> 0, 1));
|
|
294
|
+
|
|
295
|
+
const TypstCompileWorldFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
296
|
+
? { register: () => {}, unregister: () => {} }
|
|
297
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typstcompileworld_free(ptr >>> 0, 1));
|
|
298
|
+
|
|
299
|
+
const TypstCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
300
|
+
? { register: () => {}, unregister: () => {} }
|
|
301
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typstcompiler_free(ptr >>> 0, 1));
|
|
302
|
+
|
|
303
|
+
const TypstCompilerBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
304
|
+
? { register: () => {}, unregister: () => {} }
|
|
305
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typstcompilerbuilder_free(ptr >>> 0, 1));
|
|
306
|
+
|
|
307
|
+
const TypstFontResolverFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
308
|
+
? { register: () => {}, unregister: () => {} }
|
|
309
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typstfontresolver_free(ptr >>> 0, 1));
|
|
310
|
+
|
|
311
|
+
const TypstFontResolverBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
312
|
+
? { register: () => {}, unregister: () => {} }
|
|
313
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_typstfontresolverbuilder_free(ptr >>> 0, 1));
|
|
314
|
+
|
|
315
|
+
export class IncrServer {
|
|
316
|
+
static __wrap(ptr) {
|
|
317
|
+
ptr = ptr >>> 0;
|
|
318
|
+
const obj = Object.create(IncrServer.prototype);
|
|
319
|
+
obj.__wbg_ptr = ptr;
|
|
320
|
+
IncrServerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
321
|
+
return obj;
|
|
322
|
+
}
|
|
323
|
+
__destroy_into_raw() {
|
|
324
|
+
const ptr = this.__wbg_ptr;
|
|
325
|
+
this.__wbg_ptr = 0;
|
|
326
|
+
IncrServerFinalization.unregister(this);
|
|
327
|
+
return ptr;
|
|
328
|
+
}
|
|
329
|
+
free() {
|
|
330
|
+
const ptr = this.__destroy_into_raw();
|
|
331
|
+
wasm.__wbg_incrserver_free(ptr, 0);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @param {boolean} attach
|
|
335
|
+
*/
|
|
336
|
+
set_attach_debug_info(attach) {
|
|
337
|
+
wasm.incrserver_set_attach_debug_info(this.__wbg_ptr, attach);
|
|
338
|
+
}
|
|
339
|
+
reset() {
|
|
340
|
+
wasm.incrserver_reset(this.__wbg_ptr);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* @returns {Uint8Array | undefined}
|
|
344
|
+
*/
|
|
345
|
+
current() {
|
|
346
|
+
try {
|
|
347
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
348
|
+
wasm.incrserver_current(retptr, this.__wbg_ptr);
|
|
349
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
350
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
351
|
+
let v1;
|
|
352
|
+
if (r0 !== 0) {
|
|
353
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
354
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
355
|
+
}
|
|
356
|
+
return v1;
|
|
357
|
+
} finally {
|
|
358
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (Symbol.dispose) IncrServer.prototype[Symbol.dispose] = IncrServer.prototype.free;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The `ProxyContext` struct is a wrapper around a JavaScript this.
|
|
366
|
+
*/
|
|
367
|
+
export class ProxyContext {
|
|
368
|
+
static __wrap(ptr) {
|
|
369
|
+
ptr = ptr >>> 0;
|
|
370
|
+
const obj = Object.create(ProxyContext.prototype);
|
|
371
|
+
obj.__wbg_ptr = ptr;
|
|
372
|
+
ProxyContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
373
|
+
return obj;
|
|
374
|
+
}
|
|
375
|
+
__destroy_into_raw() {
|
|
376
|
+
const ptr = this.__wbg_ptr;
|
|
377
|
+
this.__wbg_ptr = 0;
|
|
378
|
+
ProxyContextFinalization.unregister(this);
|
|
379
|
+
return ptr;
|
|
380
|
+
}
|
|
381
|
+
free() {
|
|
382
|
+
const ptr = this.__destroy_into_raw();
|
|
383
|
+
wasm.__wbg_proxycontext_free(ptr, 0);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Creates a new `ProxyContext` instance.
|
|
387
|
+
* @param {any} context
|
|
388
|
+
*/
|
|
389
|
+
constructor(context) {
|
|
390
|
+
const ret = wasm.proxycontext_new(addHeapObject(context));
|
|
391
|
+
this.__wbg_ptr = ret >>> 0;
|
|
392
|
+
ProxyContextFinalization.register(this, this.__wbg_ptr, this);
|
|
393
|
+
return this;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* A convenience function to untar a tarball and call a callback for each
|
|
397
|
+
* entry.
|
|
398
|
+
* @param {Uint8Array} data
|
|
399
|
+
* @param {Function} cb
|
|
400
|
+
*/
|
|
401
|
+
untar(data, cb) {
|
|
402
|
+
try {
|
|
403
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
404
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
405
|
+
const len0 = WASM_VECTOR_LEN;
|
|
406
|
+
wasm.proxycontext_untar(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(cb));
|
|
407
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
408
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
409
|
+
if (r1) {
|
|
410
|
+
throw takeObject(r0);
|
|
411
|
+
}
|
|
412
|
+
} finally {
|
|
413
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Returns the JavaScript this.
|
|
418
|
+
* @returns {any}
|
|
419
|
+
*/
|
|
420
|
+
get context() {
|
|
421
|
+
const ret = wasm.proxycontext_context(this.__wbg_ptr);
|
|
422
|
+
return takeObject(ret);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (Symbol.dispose) ProxyContext.prototype[Symbol.dispose] = ProxyContext.prototype.free;
|
|
426
|
+
|
|
427
|
+
export class TypstCompileWorld {
|
|
428
|
+
static __wrap(ptr) {
|
|
429
|
+
ptr = ptr >>> 0;
|
|
430
|
+
const obj = Object.create(TypstCompileWorld.prototype);
|
|
431
|
+
obj.__wbg_ptr = ptr;
|
|
432
|
+
TypstCompileWorldFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
433
|
+
return obj;
|
|
434
|
+
}
|
|
435
|
+
__destroy_into_raw() {
|
|
436
|
+
const ptr = this.__wbg_ptr;
|
|
437
|
+
this.__wbg_ptr = 0;
|
|
438
|
+
TypstCompileWorldFinalization.unregister(this);
|
|
439
|
+
return ptr;
|
|
440
|
+
}
|
|
441
|
+
free() {
|
|
442
|
+
const ptr = this.__destroy_into_raw();
|
|
443
|
+
wasm.__wbg_typstcompileworld_free(ptr, 0);
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @param {number} fmt
|
|
447
|
+
* @param {number} diagnostics_format
|
|
448
|
+
* @returns {any}
|
|
449
|
+
*/
|
|
450
|
+
get_artifact(fmt, diagnostics_format) {
|
|
451
|
+
try {
|
|
452
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
453
|
+
wasm.typstcompileworld_get_artifact(retptr, this.__wbg_ptr, fmt, diagnostics_format);
|
|
454
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
455
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
456
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
457
|
+
if (r2) {
|
|
458
|
+
throw takeObject(r1);
|
|
459
|
+
}
|
|
460
|
+
return takeObject(r0);
|
|
461
|
+
} finally {
|
|
462
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* @param {IncrServer} state
|
|
467
|
+
* @param {number} diagnostics_format
|
|
468
|
+
* @returns {any}
|
|
469
|
+
*/
|
|
470
|
+
incr_compile(state, diagnostics_format) {
|
|
471
|
+
try {
|
|
472
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
473
|
+
_assertClass(state, IncrServer);
|
|
474
|
+
wasm.typstcompileworld_incr_compile(retptr, this.__wbg_ptr, state.__wbg_ptr, diagnostics_format);
|
|
475
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
476
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
477
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
478
|
+
if (r2) {
|
|
479
|
+
throw takeObject(r1);
|
|
480
|
+
}
|
|
481
|
+
return takeObject(r0);
|
|
482
|
+
} finally {
|
|
483
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* @param {number} kind
|
|
488
|
+
* @param {string} selector
|
|
489
|
+
* @param {string | null} [field]
|
|
490
|
+
* @returns {string}
|
|
491
|
+
*/
|
|
492
|
+
query(kind, selector, field) {
|
|
493
|
+
let deferred4_0;
|
|
494
|
+
let deferred4_1;
|
|
495
|
+
try {
|
|
496
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
497
|
+
const ptr0 = passStringToWasm0(selector, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
498
|
+
const len0 = WASM_VECTOR_LEN;
|
|
499
|
+
var ptr1 = isLikeNone(field) ? 0 : passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
500
|
+
var len1 = WASM_VECTOR_LEN;
|
|
501
|
+
wasm.typstcompileworld_query(retptr, this.__wbg_ptr, kind, ptr0, len0, ptr1, len1);
|
|
502
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
503
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
504
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
505
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
506
|
+
var ptr3 = r0;
|
|
507
|
+
var len3 = r1;
|
|
508
|
+
if (r3) {
|
|
509
|
+
ptr3 = 0; len3 = 0;
|
|
510
|
+
throw takeObject(r2);
|
|
511
|
+
}
|
|
512
|
+
deferred4_0 = ptr3;
|
|
513
|
+
deferred4_1 = len3;
|
|
514
|
+
return getStringFromWasm0(ptr3, len3);
|
|
515
|
+
} finally {
|
|
516
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
517
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* @param {number} kind
|
|
522
|
+
* @returns {string | undefined}
|
|
523
|
+
*/
|
|
524
|
+
title(kind) {
|
|
525
|
+
try {
|
|
526
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
527
|
+
wasm.typstcompileworld_title(retptr, this.__wbg_ptr, kind);
|
|
528
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
529
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
530
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
531
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
532
|
+
if (r3) {
|
|
533
|
+
throw takeObject(r2);
|
|
534
|
+
}
|
|
535
|
+
let v1;
|
|
536
|
+
if (r0 !== 0) {
|
|
537
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
538
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
539
|
+
}
|
|
540
|
+
return v1;
|
|
541
|
+
} finally {
|
|
542
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* @param {number} kind
|
|
547
|
+
* @param {number} diagnostics_format
|
|
548
|
+
* @returns {any}
|
|
549
|
+
*/
|
|
550
|
+
compile(kind, diagnostics_format) {
|
|
551
|
+
try {
|
|
552
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
553
|
+
wasm.typstcompileworld_compile(retptr, this.__wbg_ptr, kind, diagnostics_format);
|
|
554
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
555
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
556
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
557
|
+
if (r2) {
|
|
558
|
+
throw takeObject(r1);
|
|
559
|
+
}
|
|
560
|
+
return takeObject(r0);
|
|
561
|
+
} finally {
|
|
562
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (Symbol.dispose) TypstCompileWorld.prototype[Symbol.dispose] = TypstCompileWorld.prototype.free;
|
|
567
|
+
|
|
568
|
+
export class TypstCompiler {
|
|
569
|
+
static __wrap(ptr) {
|
|
570
|
+
ptr = ptr >>> 0;
|
|
571
|
+
const obj = Object.create(TypstCompiler.prototype);
|
|
572
|
+
obj.__wbg_ptr = ptr;
|
|
573
|
+
TypstCompilerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
574
|
+
return obj;
|
|
575
|
+
}
|
|
576
|
+
__destroy_into_raw() {
|
|
577
|
+
const ptr = this.__wbg_ptr;
|
|
578
|
+
this.__wbg_ptr = 0;
|
|
579
|
+
TypstCompilerFinalization.unregister(this);
|
|
580
|
+
return ptr;
|
|
581
|
+
}
|
|
582
|
+
free() {
|
|
583
|
+
const ptr = this.__destroy_into_raw();
|
|
584
|
+
wasm.__wbg_typstcompiler_free(ptr, 0);
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* @param {string} path
|
|
588
|
+
* @param {string} content
|
|
589
|
+
* @returns {boolean}
|
|
590
|
+
*/
|
|
591
|
+
add_source(path, content) {
|
|
592
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
593
|
+
const len0 = WASM_VECTOR_LEN;
|
|
594
|
+
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
595
|
+
const len1 = WASM_VECTOR_LEN;
|
|
596
|
+
const ret = wasm.typstcompiler_add_source(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
597
|
+
return ret !== 0;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* @param {string} path
|
|
601
|
+
* @param {Uint8Array} content
|
|
602
|
+
* @returns {boolean}
|
|
603
|
+
*/
|
|
604
|
+
map_shadow(path, content) {
|
|
605
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_export);
|
|
608
|
+
const len1 = WASM_VECTOR_LEN;
|
|
609
|
+
const ret = wasm.typstcompiler_map_shadow(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
610
|
+
return ret !== 0;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* @param {any} inputs
|
|
614
|
+
*/
|
|
615
|
+
set_inputs(inputs) {
|
|
616
|
+
try {
|
|
617
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
618
|
+
wasm.typstcompiler_set_inputs(retptr, this.__wbg_ptr, addHeapObject(inputs));
|
|
619
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
620
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
621
|
+
if (r1) {
|
|
622
|
+
throw takeObject(r0);
|
|
623
|
+
}
|
|
624
|
+
} finally {
|
|
625
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* @param {string} fmt
|
|
630
|
+
* @param {number} diagnostics_format
|
|
631
|
+
* @returns {any}
|
|
632
|
+
*/
|
|
633
|
+
get_artifact(fmt, diagnostics_format) {
|
|
634
|
+
try {
|
|
635
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
636
|
+
const ptr0 = passStringToWasm0(fmt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
637
|
+
const len0 = WASM_VECTOR_LEN;
|
|
638
|
+
wasm.typstcompiler_get_artifact(retptr, this.__wbg_ptr, ptr0, len0, diagnostics_format);
|
|
639
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
640
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
641
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
642
|
+
if (r2) {
|
|
643
|
+
throw takeObject(r1);
|
|
644
|
+
}
|
|
645
|
+
return takeObject(r0);
|
|
646
|
+
} finally {
|
|
647
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @param {string} main_file_path
|
|
652
|
+
* @param {(Array<any>)[] | null | undefined} inputs
|
|
653
|
+
* @param {IncrServer} state
|
|
654
|
+
* @param {number} diagnostics_format
|
|
655
|
+
* @returns {any}
|
|
656
|
+
*/
|
|
657
|
+
incr_compile(main_file_path, inputs, state, diagnostics_format) {
|
|
658
|
+
try {
|
|
659
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
660
|
+
const ptr0 = passStringToWasm0(main_file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
661
|
+
const len0 = WASM_VECTOR_LEN;
|
|
662
|
+
var ptr1 = isLikeNone(inputs) ? 0 : passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
663
|
+
var len1 = WASM_VECTOR_LEN;
|
|
664
|
+
_assertClass(state, IncrServer);
|
|
665
|
+
wasm.typstcompiler_incr_compile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, state.__wbg_ptr, diagnostics_format);
|
|
666
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
667
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
668
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
669
|
+
if (r2) {
|
|
670
|
+
throw takeObject(r1);
|
|
671
|
+
}
|
|
672
|
+
return takeObject(r0);
|
|
673
|
+
} finally {
|
|
674
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
reset_shadow() {
|
|
678
|
+
wasm.typstcompiler_reset_shadow(this.__wbg_ptr);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @param {string} path
|
|
682
|
+
* @returns {boolean}
|
|
683
|
+
*/
|
|
684
|
+
unmap_shadow(path) {
|
|
685
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
686
|
+
const len0 = WASM_VECTOR_LEN;
|
|
687
|
+
const ret = wasm.typstcompiler_unmap_shadow(this.__wbg_ptr, ptr0, len0);
|
|
688
|
+
return ret !== 0;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* @returns {string[]}
|
|
692
|
+
*/
|
|
693
|
+
get_loaded_fonts() {
|
|
694
|
+
try {
|
|
695
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
696
|
+
wasm.typstcompiler_get_loaded_fonts(retptr, this.__wbg_ptr);
|
|
697
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
698
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
699
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
700
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
701
|
+
return v1;
|
|
702
|
+
} finally {
|
|
703
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* @returns {IncrServer}
|
|
708
|
+
*/
|
|
709
|
+
create_incr_server() {
|
|
710
|
+
try {
|
|
711
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
712
|
+
wasm.typstcompiler_create_incr_server(retptr, this.__wbg_ptr);
|
|
713
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
714
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
715
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
716
|
+
if (r2) {
|
|
717
|
+
throw takeObject(r1);
|
|
718
|
+
}
|
|
719
|
+
return IncrServer.__wrap(r0);
|
|
720
|
+
} finally {
|
|
721
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* @param {string} offset_encoding
|
|
726
|
+
* @param {string | null} [file_path]
|
|
727
|
+
* @param {string | null} [result_id]
|
|
728
|
+
* @returns {object}
|
|
729
|
+
*/
|
|
730
|
+
get_semantic_tokens(offset_encoding, file_path, result_id) {
|
|
731
|
+
try {
|
|
732
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
733
|
+
const ptr0 = passStringToWasm0(offset_encoding, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
734
|
+
const len0 = WASM_VECTOR_LEN;
|
|
735
|
+
var ptr1 = isLikeNone(file_path) ? 0 : passStringToWasm0(file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
736
|
+
var len1 = WASM_VECTOR_LEN;
|
|
737
|
+
var ptr2 = isLikeNone(result_id) ? 0 : passStringToWasm0(result_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
738
|
+
var len2 = WASM_VECTOR_LEN;
|
|
739
|
+
wasm.typstcompiler_get_semantic_tokens(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
740
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
741
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
742
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
743
|
+
if (r2) {
|
|
744
|
+
throw takeObject(r1);
|
|
745
|
+
}
|
|
746
|
+
return takeObject(r0);
|
|
747
|
+
} finally {
|
|
748
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* @returns {any}
|
|
753
|
+
*/
|
|
754
|
+
get_semantic_token_legend() {
|
|
755
|
+
try {
|
|
756
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
757
|
+
wasm.typstcompiler_get_semantic_token_legend(retptr, this.__wbg_ptr);
|
|
758
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
759
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
760
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
761
|
+
if (r2) {
|
|
762
|
+
throw takeObject(r1);
|
|
763
|
+
}
|
|
764
|
+
return takeObject(r0);
|
|
765
|
+
} finally {
|
|
766
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* @param {string} main_file_path
|
|
771
|
+
* @param {(Array<any>)[] | null | undefined} inputs
|
|
772
|
+
* @param {string} selector
|
|
773
|
+
* @param {string | null} [field]
|
|
774
|
+
* @returns {string}
|
|
775
|
+
*/
|
|
776
|
+
query(main_file_path, inputs, selector, field) {
|
|
777
|
+
let deferred6_0;
|
|
778
|
+
let deferred6_1;
|
|
779
|
+
try {
|
|
780
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
781
|
+
const ptr0 = passStringToWasm0(main_file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
782
|
+
const len0 = WASM_VECTOR_LEN;
|
|
783
|
+
var ptr1 = isLikeNone(inputs) ? 0 : passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
784
|
+
var len1 = WASM_VECTOR_LEN;
|
|
785
|
+
const ptr2 = passStringToWasm0(selector, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
786
|
+
const len2 = WASM_VECTOR_LEN;
|
|
787
|
+
var ptr3 = isLikeNone(field) ? 0 : passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
788
|
+
var len3 = WASM_VECTOR_LEN;
|
|
789
|
+
wasm.typstcompiler_query(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
790
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
791
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
792
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
793
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
794
|
+
var ptr5 = r0;
|
|
795
|
+
var len5 = r1;
|
|
796
|
+
if (r3) {
|
|
797
|
+
ptr5 = 0; len5 = 0;
|
|
798
|
+
throw takeObject(r2);
|
|
799
|
+
}
|
|
800
|
+
deferred6_0 = ptr5;
|
|
801
|
+
deferred6_1 = len5;
|
|
802
|
+
return getStringFromWasm0(ptr5, len5);
|
|
803
|
+
} finally {
|
|
804
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
805
|
+
wasm.__wbindgen_export4(deferred6_0, deferred6_1, 1);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
reset() {
|
|
809
|
+
try {
|
|
810
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
811
|
+
wasm.typstcompiler_reset(retptr, this.__wbg_ptr);
|
|
812
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
813
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
814
|
+
if (r1) {
|
|
815
|
+
throw takeObject(r0);
|
|
816
|
+
}
|
|
817
|
+
} finally {
|
|
818
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* @param {string | null | undefined} main_file_path
|
|
823
|
+
* @param {(Array<any>)[] | null | undefined} inputs
|
|
824
|
+
* @param {string} fmt
|
|
825
|
+
* @param {number} diagnostics_format
|
|
826
|
+
* @returns {any}
|
|
827
|
+
*/
|
|
828
|
+
compile(main_file_path, inputs, fmt, diagnostics_format) {
|
|
829
|
+
try {
|
|
830
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
831
|
+
var ptr0 = isLikeNone(main_file_path) ? 0 : passStringToWasm0(main_file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
832
|
+
var len0 = WASM_VECTOR_LEN;
|
|
833
|
+
var ptr1 = isLikeNone(inputs) ? 0 : passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
834
|
+
var len1 = WASM_VECTOR_LEN;
|
|
835
|
+
const ptr2 = passStringToWasm0(fmt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
836
|
+
const len2 = WASM_VECTOR_LEN;
|
|
837
|
+
wasm.typstcompiler_compile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, diagnostics_format);
|
|
838
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
839
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
840
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
841
|
+
if (r2) {
|
|
842
|
+
throw takeObject(r1);
|
|
843
|
+
}
|
|
844
|
+
return takeObject(r0);
|
|
845
|
+
} finally {
|
|
846
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* @param {string} main_file_path
|
|
851
|
+
* @returns {string}
|
|
852
|
+
*/
|
|
853
|
+
get_ast(main_file_path) {
|
|
854
|
+
let deferred3_0;
|
|
855
|
+
let deferred3_1;
|
|
856
|
+
try {
|
|
857
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
858
|
+
const ptr0 = passStringToWasm0(main_file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
859
|
+
const len0 = WASM_VECTOR_LEN;
|
|
860
|
+
wasm.typstcompiler_get_ast(retptr, this.__wbg_ptr, ptr0, len0);
|
|
861
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
862
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
863
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
864
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
865
|
+
var ptr2 = r0;
|
|
866
|
+
var len2 = r1;
|
|
867
|
+
if (r3) {
|
|
868
|
+
ptr2 = 0; len2 = 0;
|
|
869
|
+
throw takeObject(r2);
|
|
870
|
+
}
|
|
871
|
+
deferred3_0 = ptr2;
|
|
872
|
+
deferred3_1 = len2;
|
|
873
|
+
return getStringFromWasm0(ptr2, len2);
|
|
874
|
+
} finally {
|
|
875
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
876
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* @param {string | null} [root]
|
|
881
|
+
* @param {string | null} [main_file_path]
|
|
882
|
+
* @param {(Array<any>)[] | null} [inputs]
|
|
883
|
+
* @returns {TypstCompileWorld}
|
|
884
|
+
*/
|
|
885
|
+
snapshot(root, main_file_path, inputs) {
|
|
886
|
+
try {
|
|
887
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
888
|
+
var ptr0 = isLikeNone(root) ? 0 : passStringToWasm0(root, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
889
|
+
var len0 = WASM_VECTOR_LEN;
|
|
890
|
+
var ptr1 = isLikeNone(main_file_path) ? 0 : passStringToWasm0(main_file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
891
|
+
var len1 = WASM_VECTOR_LEN;
|
|
892
|
+
var ptr2 = isLikeNone(inputs) ? 0 : passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
893
|
+
var len2 = WASM_VECTOR_LEN;
|
|
894
|
+
wasm.typstcompiler_snapshot(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
895
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
896
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
897
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
898
|
+
if (r2) {
|
|
899
|
+
throw takeObject(r1);
|
|
900
|
+
}
|
|
901
|
+
return TypstCompileWorld.__wrap(r0);
|
|
902
|
+
} finally {
|
|
903
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* @param {TypstFontResolver} fonts
|
|
908
|
+
*/
|
|
909
|
+
set_fonts(fonts) {
|
|
910
|
+
try {
|
|
911
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
912
|
+
_assertClass(fonts, TypstFontResolver);
|
|
913
|
+
wasm.typstcompiler_set_fonts(retptr, this.__wbg_ptr, fonts.__wbg_ptr);
|
|
914
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
915
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
916
|
+
if (r1) {
|
|
917
|
+
throw takeObject(r0);
|
|
918
|
+
}
|
|
919
|
+
} finally {
|
|
920
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
if (Symbol.dispose) TypstCompiler.prototype[Symbol.dispose] = TypstCompiler.prototype.free;
|
|
925
|
+
|
|
926
|
+
export class TypstCompilerBuilder {
|
|
927
|
+
__destroy_into_raw() {
|
|
928
|
+
const ptr = this.__wbg_ptr;
|
|
929
|
+
this.__wbg_ptr = 0;
|
|
930
|
+
TypstCompilerBuilderFinalization.unregister(this);
|
|
931
|
+
return ptr;
|
|
932
|
+
}
|
|
933
|
+
free() {
|
|
934
|
+
const ptr = this.__destroy_into_raw();
|
|
935
|
+
wasm.__wbg_typstcompilerbuilder_free(ptr, 0);
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* @param {Uint8Array} data
|
|
939
|
+
* @returns {Promise<void>}
|
|
940
|
+
*/
|
|
941
|
+
add_raw_font(data) {
|
|
942
|
+
const ret = wasm.typstcompilerbuilder_add_raw_font(this.__wbg_ptr, addHeapObject(data));
|
|
943
|
+
return takeObject(ret);
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* @param {any} font
|
|
947
|
+
* @param {Function} blob
|
|
948
|
+
* @returns {Promise<void>}
|
|
949
|
+
*/
|
|
950
|
+
add_lazy_font(font, blob) {
|
|
951
|
+
const ret = wasm.typstcompilerbuilder_add_lazy_font(this.__wbg_ptr, addHeapObject(font), addHeapObject(blob));
|
|
952
|
+
return takeObject(ret);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* @param {any} context
|
|
956
|
+
* @param {Function} mtime_fn
|
|
957
|
+
* @param {Function} is_file_fn
|
|
958
|
+
* @param {Function} real_path_fn
|
|
959
|
+
* @param {Function} read_all_fn
|
|
960
|
+
* @returns {Promise<void>}
|
|
961
|
+
*/
|
|
962
|
+
set_access_model(context, mtime_fn, is_file_fn, real_path_fn, read_all_fn) {
|
|
963
|
+
const ret = wasm.typstcompilerbuilder_set_access_model(this.__wbg_ptr, addHeapObject(context), addHeapObject(mtime_fn), addHeapObject(is_file_fn), addHeapObject(real_path_fn), addHeapObject(read_all_fn));
|
|
964
|
+
return takeObject(ret);
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* @param {any} context
|
|
968
|
+
* @param {Function} real_resolve_fn
|
|
969
|
+
* @returns {Promise<void>}
|
|
970
|
+
*/
|
|
971
|
+
set_package_registry(context, real_resolve_fn) {
|
|
972
|
+
const ret = wasm.typstcompilerbuilder_set_package_registry(this.__wbg_ptr, addHeapObject(context), addHeapObject(real_resolve_fn));
|
|
973
|
+
return takeObject(ret);
|
|
974
|
+
}
|
|
975
|
+
set_dummy_access_model() {
|
|
976
|
+
try {
|
|
977
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
978
|
+
wasm.typstcompilerbuilder_set_dummy_access_model(retptr, this.__wbg_ptr);
|
|
979
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
980
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
981
|
+
if (r1) {
|
|
982
|
+
throw takeObject(r0);
|
|
983
|
+
}
|
|
984
|
+
} finally {
|
|
985
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
constructor() {
|
|
989
|
+
try {
|
|
990
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
991
|
+
wasm.typstcompilerbuilder_new(retptr);
|
|
992
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
993
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
994
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
995
|
+
if (r2) {
|
|
996
|
+
throw takeObject(r1);
|
|
997
|
+
}
|
|
998
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
999
|
+
TypstCompilerBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
1000
|
+
return this;
|
|
1001
|
+
} finally {
|
|
1002
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* @returns {Promise<TypstCompiler>}
|
|
1007
|
+
*/
|
|
1008
|
+
build() {
|
|
1009
|
+
const ptr = this.__destroy_into_raw();
|
|
1010
|
+
const ret = wasm.typstcompilerbuilder_build(ptr);
|
|
1011
|
+
return takeObject(ret);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
if (Symbol.dispose) TypstCompilerBuilder.prototype[Symbol.dispose] = TypstCompilerBuilder.prototype.free;
|
|
1015
|
+
|
|
1016
|
+
export class TypstFontResolver {
|
|
1017
|
+
static __wrap(ptr) {
|
|
1018
|
+
ptr = ptr >>> 0;
|
|
1019
|
+
const obj = Object.create(TypstFontResolver.prototype);
|
|
1020
|
+
obj.__wbg_ptr = ptr;
|
|
1021
|
+
TypstFontResolverFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1022
|
+
return obj;
|
|
1023
|
+
}
|
|
1024
|
+
__destroy_into_raw() {
|
|
1025
|
+
const ptr = this.__wbg_ptr;
|
|
1026
|
+
this.__wbg_ptr = 0;
|
|
1027
|
+
TypstFontResolverFinalization.unregister(this);
|
|
1028
|
+
return ptr;
|
|
1029
|
+
}
|
|
1030
|
+
free() {
|
|
1031
|
+
const ptr = this.__destroy_into_raw();
|
|
1032
|
+
wasm.__wbg_typstfontresolver_free(ptr, 0);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
if (Symbol.dispose) TypstFontResolver.prototype[Symbol.dispose] = TypstFontResolver.prototype.free;
|
|
1036
|
+
|
|
1037
|
+
export class TypstFontResolverBuilder {
|
|
1038
|
+
__destroy_into_raw() {
|
|
1039
|
+
const ptr = this.__wbg_ptr;
|
|
1040
|
+
this.__wbg_ptr = 0;
|
|
1041
|
+
TypstFontResolverBuilderFinalization.unregister(this);
|
|
1042
|
+
return ptr;
|
|
1043
|
+
}
|
|
1044
|
+
free() {
|
|
1045
|
+
const ptr = this.__destroy_into_raw();
|
|
1046
|
+
wasm.__wbg_typstfontresolverbuilder_free(ptr, 0);
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Adds font data to the searcher.
|
|
1050
|
+
* @param {Uint8Array} buffer
|
|
1051
|
+
*/
|
|
1052
|
+
add_raw_font(buffer) {
|
|
1053
|
+
try {
|
|
1054
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1055
|
+
wasm.typstfontresolverbuilder_add_raw_font(retptr, this.__wbg_ptr, addHeapObject(buffer));
|
|
1056
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1057
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1058
|
+
if (r1) {
|
|
1059
|
+
throw takeObject(r0);
|
|
1060
|
+
}
|
|
1061
|
+
} finally {
|
|
1062
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Adds callback that loads font data lazily to the searcher.
|
|
1067
|
+
* `get_font_info` can be used to get the font info.
|
|
1068
|
+
* @param {any} font
|
|
1069
|
+
* @param {Function} blob
|
|
1070
|
+
*/
|
|
1071
|
+
add_lazy_font(font, blob) {
|
|
1072
|
+
try {
|
|
1073
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1074
|
+
wasm.typstfontresolverbuilder_add_lazy_font(retptr, this.__wbg_ptr, addHeapObject(font), addHeapObject(blob));
|
|
1075
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1076
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1077
|
+
if (r1) {
|
|
1078
|
+
throw takeObject(r0);
|
|
1079
|
+
}
|
|
1080
|
+
} finally {
|
|
1081
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* @param {Uint8Array} buffer
|
|
1086
|
+
* @returns {any}
|
|
1087
|
+
*/
|
|
1088
|
+
get_font_info(buffer) {
|
|
1089
|
+
try {
|
|
1090
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1091
|
+
wasm.typstfontresolverbuilder_get_font_info(retptr, this.__wbg_ptr, addHeapObject(buffer));
|
|
1092
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1093
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1094
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1095
|
+
if (r2) {
|
|
1096
|
+
throw takeObject(r1);
|
|
1097
|
+
}
|
|
1098
|
+
return takeObject(r0);
|
|
1099
|
+
} finally {
|
|
1100
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
constructor() {
|
|
1104
|
+
try {
|
|
1105
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1106
|
+
wasm.typstfontresolverbuilder_new(retptr);
|
|
1107
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1108
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1109
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1110
|
+
if (r2) {
|
|
1111
|
+
throw takeObject(r1);
|
|
1112
|
+
}
|
|
1113
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1114
|
+
TypstFontResolverBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
1115
|
+
return this;
|
|
1116
|
+
} finally {
|
|
1117
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* @returns {Promise<TypstFontResolver>}
|
|
1122
|
+
*/
|
|
1123
|
+
build() {
|
|
1124
|
+
const ptr = this.__destroy_into_raw();
|
|
1125
|
+
const ret = wasm.typstfontresolverbuilder_build(ptr);
|
|
1126
|
+
return takeObject(ret);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
if (Symbol.dispose) TypstFontResolverBuilder.prototype[Symbol.dispose] = TypstFontResolverBuilder.prototype.free;
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* @deprecated use TypstFontResolverBuilder instead
|
|
1133
|
+
* @param {Uint8Array} buffer
|
|
1134
|
+
* @returns {any}
|
|
1135
|
+
*/
|
|
1136
|
+
export function get_font_info(buffer) {
|
|
1137
|
+
const ret = wasm.get_font_info(addHeapObject(buffer));
|
|
1138
|
+
return takeObject(ret);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
1142
|
+
|
|
1143
|
+
async function __wbg_load(module, imports) {
|
|
1144
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1145
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1146
|
+
try {
|
|
1147
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1148
|
+
} catch (e) {
|
|
1149
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
1150
|
+
|
|
1151
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1152
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1153
|
+
|
|
1154
|
+
} else {
|
|
1155
|
+
throw e;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
const bytes = await module.arrayBuffer();
|
|
1161
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1162
|
+
} else {
|
|
1163
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1164
|
+
|
|
1165
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1166
|
+
return { instance, module };
|
|
1167
|
+
} else {
|
|
1168
|
+
return instance;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
function __wbg_get_imports() {
|
|
1174
|
+
const imports = {};
|
|
1175
|
+
imports.wbg = {};
|
|
1176
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
1177
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1178
|
+
return addHeapObject(ret);
|
|
1179
|
+
};
|
|
1180
|
+
imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
1181
|
+
const ret = Number(getObject(arg0));
|
|
1182
|
+
return ret;
|
|
1183
|
+
};
|
|
1184
|
+
imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
|
|
1185
|
+
const v = getObject(arg1);
|
|
1186
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1187
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1188
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1189
|
+
};
|
|
1190
|
+
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
1191
|
+
const v = getObject(arg0);
|
|
1192
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1193
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1194
|
+
};
|
|
1195
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
1196
|
+
const ret = debugString(getObject(arg1));
|
|
1197
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1198
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1199
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1200
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1201
|
+
};
|
|
1202
|
+
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
1203
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
1204
|
+
return ret;
|
|
1205
|
+
};
|
|
1206
|
+
imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
|
|
1207
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1208
|
+
return ret;
|
|
1209
|
+
};
|
|
1210
|
+
imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
|
|
1211
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1212
|
+
return ret;
|
|
1213
|
+
};
|
|
1214
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
1215
|
+
const val = getObject(arg0);
|
|
1216
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1217
|
+
return ret;
|
|
1218
|
+
};
|
|
1219
|
+
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
1220
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1221
|
+
return ret;
|
|
1222
|
+
};
|
|
1223
|
+
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
1224
|
+
const ret = getObject(arg0) === undefined;
|
|
1225
|
+
return ret;
|
|
1226
|
+
};
|
|
1227
|
+
imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
|
|
1228
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
1229
|
+
return ret;
|
|
1230
|
+
};
|
|
1231
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
1232
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
1233
|
+
return ret;
|
|
1234
|
+
};
|
|
1235
|
+
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
1236
|
+
const obj = getObject(arg1);
|
|
1237
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1238
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1239
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1240
|
+
};
|
|
1241
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
1242
|
+
const obj = getObject(arg1);
|
|
1243
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1244
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1245
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1246
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1247
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1248
|
+
};
|
|
1249
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
1250
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1251
|
+
};
|
|
1252
|
+
imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
|
|
1253
|
+
getObject(arg0)._wbg_cb_unref();
|
|
1254
|
+
};
|
|
1255
|
+
imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1256
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1257
|
+
return addHeapObject(ret);
|
|
1258
|
+
}, arguments) };
|
|
1259
|
+
imports.wbg.__wbg_call_78f94eb02ec7f9b2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1260
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
|
1261
|
+
return addHeapObject(ret);
|
|
1262
|
+
}, arguments) };
|
|
1263
|
+
imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
1264
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1265
|
+
return addHeapObject(ret);
|
|
1266
|
+
}, arguments) };
|
|
1267
|
+
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
1268
|
+
const ret = getObject(arg0).done;
|
|
1269
|
+
return ret;
|
|
1270
|
+
};
|
|
1271
|
+
imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
1272
|
+
const ret = Object.entries(getObject(arg0));
|
|
1273
|
+
return addHeapObject(ret);
|
|
1274
|
+
};
|
|
1275
|
+
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
1276
|
+
let deferred0_0;
|
|
1277
|
+
let deferred0_1;
|
|
1278
|
+
try {
|
|
1279
|
+
deferred0_0 = arg0;
|
|
1280
|
+
deferred0_1 = arg1;
|
|
1281
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1282
|
+
} finally {
|
|
1283
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
1284
|
+
}
|
|
1285
|
+
};
|
|
1286
|
+
imports.wbg.__wbg_error_85faeb8919b11cc6 = function(arg0, arg1, arg2) {
|
|
1287
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1288
|
+
};
|
|
1289
|
+
imports.wbg.__wbg_getTimezoneOffset_45389e26d6f46823 = function(arg0) {
|
|
1290
|
+
const ret = getObject(arg0).getTimezoneOffset();
|
|
1291
|
+
return ret;
|
|
1292
|
+
};
|
|
1293
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
1294
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1295
|
+
return addHeapObject(ret);
|
|
1296
|
+
};
|
|
1297
|
+
imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
1298
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1299
|
+
return addHeapObject(ret);
|
|
1300
|
+
}, arguments) };
|
|
1301
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
1302
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
1303
|
+
return addHeapObject(ret);
|
|
1304
|
+
};
|
|
1305
|
+
imports.wbg.__wbg_info_ce6bcc489c22f6f0 = function(arg0) {
|
|
1306
|
+
console.info(getObject(arg0));
|
|
1307
|
+
};
|
|
1308
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
1309
|
+
let result;
|
|
1310
|
+
try {
|
|
1311
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1312
|
+
} catch (_) {
|
|
1313
|
+
result = false;
|
|
1314
|
+
}
|
|
1315
|
+
const ret = result;
|
|
1316
|
+
return ret;
|
|
1317
|
+
};
|
|
1318
|
+
imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
|
|
1319
|
+
let result;
|
|
1320
|
+
try {
|
|
1321
|
+
result = getObject(arg0) instanceof Map;
|
|
1322
|
+
} catch (_) {
|
|
1323
|
+
result = false;
|
|
1324
|
+
}
|
|
1325
|
+
const ret = result;
|
|
1326
|
+
return ret;
|
|
1327
|
+
};
|
|
1328
|
+
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
1329
|
+
let result;
|
|
1330
|
+
try {
|
|
1331
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
1332
|
+
} catch (_) {
|
|
1333
|
+
result = false;
|
|
1334
|
+
}
|
|
1335
|
+
const ret = result;
|
|
1336
|
+
return ret;
|
|
1337
|
+
};
|
|
1338
|
+
imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
|
|
1339
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1340
|
+
return ret;
|
|
1341
|
+
};
|
|
1342
|
+
imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
1343
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1344
|
+
return ret;
|
|
1345
|
+
};
|
|
1346
|
+
imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
|
|
1347
|
+
const ret = Symbol.iterator;
|
|
1348
|
+
return addHeapObject(ret);
|
|
1349
|
+
};
|
|
1350
|
+
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
1351
|
+
const ret = getObject(arg0).length;
|
|
1352
|
+
return ret;
|
|
1353
|
+
};
|
|
1354
|
+
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
1355
|
+
const ret = getObject(arg0).length;
|
|
1356
|
+
return ret;
|
|
1357
|
+
};
|
|
1358
|
+
imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
|
|
1359
|
+
const ret = new Object();
|
|
1360
|
+
return addHeapObject(ret);
|
|
1361
|
+
};
|
|
1362
|
+
imports.wbg.__wbg_new_25f239778d6112b9 = function() {
|
|
1363
|
+
const ret = new Array();
|
|
1364
|
+
return addHeapObject(ret);
|
|
1365
|
+
};
|
|
1366
|
+
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
1367
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
1368
|
+
return addHeapObject(ret);
|
|
1369
|
+
};
|
|
1370
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
1371
|
+
const ret = new Error();
|
|
1372
|
+
return addHeapObject(ret);
|
|
1373
|
+
};
|
|
1374
|
+
imports.wbg.__wbg_new_b2db8aa2650f793a = function(arg0) {
|
|
1375
|
+
const ret = new Date(getObject(arg0));
|
|
1376
|
+
return addHeapObject(ret);
|
|
1377
|
+
};
|
|
1378
|
+
imports.wbg.__wbg_new_df1173567d5ff028 = function(arg0, arg1) {
|
|
1379
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1380
|
+
return addHeapObject(ret);
|
|
1381
|
+
};
|
|
1382
|
+
imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
|
|
1383
|
+
try {
|
|
1384
|
+
var state0 = {a: arg0, b: arg1};
|
|
1385
|
+
var cb0 = (arg0, arg1) => {
|
|
1386
|
+
const a = state0.a;
|
|
1387
|
+
state0.a = 0;
|
|
1388
|
+
try {
|
|
1389
|
+
return __wasm_bindgen_func_elem_37495(a, state0.b, arg0, arg1);
|
|
1390
|
+
} finally {
|
|
1391
|
+
state0.a = a;
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
const ret = new Promise(cb0);
|
|
1395
|
+
return addHeapObject(ret);
|
|
1396
|
+
} finally {
|
|
1397
|
+
state0.a = state0.b = 0;
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
imports.wbg.__wbg_new_from_slice_db0691b69e9d3891 = function(arg0, arg1) {
|
|
1401
|
+
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
1402
|
+
return addHeapObject(ret);
|
|
1403
|
+
};
|
|
1404
|
+
imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
|
|
1405
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1406
|
+
return addHeapObject(ret);
|
|
1407
|
+
};
|
|
1408
|
+
imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
|
|
1409
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1410
|
+
return addHeapObject(ret);
|
|
1411
|
+
};
|
|
1412
|
+
imports.wbg.__wbg_new_with_args_df9e7125ffe55248 = function(arg0, arg1, arg2, arg3) {
|
|
1413
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
1414
|
+
return addHeapObject(ret);
|
|
1415
|
+
};
|
|
1416
|
+
imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
1417
|
+
const ret = getObject(arg0).next;
|
|
1418
|
+
return addHeapObject(ret);
|
|
1419
|
+
};
|
|
1420
|
+
imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
1421
|
+
const ret = getObject(arg0).next();
|
|
1422
|
+
return addHeapObject(ret);
|
|
1423
|
+
}, arguments) };
|
|
1424
|
+
imports.wbg.__wbg_now_69d776cd24f5215b = function() {
|
|
1425
|
+
const ret = Date.now();
|
|
1426
|
+
return ret;
|
|
1427
|
+
};
|
|
1428
|
+
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1429
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1430
|
+
};
|
|
1431
|
+
imports.wbg.__wbg_proxycontext_new = function(arg0) {
|
|
1432
|
+
const ret = ProxyContext.__wrap(arg0);
|
|
1433
|
+
return addHeapObject(ret);
|
|
1434
|
+
};
|
|
1435
|
+
imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
1436
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
1437
|
+
return ret;
|
|
1438
|
+
};
|
|
1439
|
+
imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
1440
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
1441
|
+
return addHeapObject(ret);
|
|
1442
|
+
};
|
|
1443
|
+
imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
1444
|
+
queueMicrotask(getObject(arg0));
|
|
1445
|
+
};
|
|
1446
|
+
imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
1447
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
1448
|
+
return addHeapObject(ret);
|
|
1449
|
+
};
|
|
1450
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
1451
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1452
|
+
};
|
|
1453
|
+
imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1454
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1455
|
+
return ret;
|
|
1456
|
+
}, arguments) };
|
|
1457
|
+
imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
1458
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1459
|
+
};
|
|
1460
|
+
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
1461
|
+
const ret = getObject(arg1).stack;
|
|
1462
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1463
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1464
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1465
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1466
|
+
};
|
|
1467
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
|
|
1468
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1469
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1470
|
+
};
|
|
1471
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
|
|
1472
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1473
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1474
|
+
};
|
|
1475
|
+
imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
|
|
1476
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1477
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1478
|
+
};
|
|
1479
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
|
|
1480
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1481
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1482
|
+
};
|
|
1483
|
+
imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
|
|
1484
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
1485
|
+
return addHeapObject(ret);
|
|
1486
|
+
};
|
|
1487
|
+
imports.wbg.__wbg_typstcompiler_new = function(arg0) {
|
|
1488
|
+
const ret = TypstCompiler.__wrap(arg0);
|
|
1489
|
+
return addHeapObject(ret);
|
|
1490
|
+
};
|
|
1491
|
+
imports.wbg.__wbg_typstfontresolver_new = function(arg0) {
|
|
1492
|
+
const ret = TypstFontResolver.__wrap(arg0);
|
|
1493
|
+
return addHeapObject(ret);
|
|
1494
|
+
};
|
|
1495
|
+
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
1496
|
+
const ret = getObject(arg0).value;
|
|
1497
|
+
return addHeapObject(ret);
|
|
1498
|
+
};
|
|
1499
|
+
imports.wbg.__wbindgen_cast_178c4eb12529b3d7 = function(arg0, arg1) {
|
|
1500
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 314, function: Function { arguments: [Externref], shim_idx: 315, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1501
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_981, __wasm_bindgen_func_elem_982);
|
|
1502
|
+
return addHeapObject(ret);
|
|
1503
|
+
};
|
|
1504
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1505
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1506
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1507
|
+
return addHeapObject(ret);
|
|
1508
|
+
};
|
|
1509
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
1510
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1511
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1512
|
+
return addHeapObject(ret);
|
|
1513
|
+
};
|
|
1514
|
+
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
1515
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
1516
|
+
const ret = arg0;
|
|
1517
|
+
return addHeapObject(ret);
|
|
1518
|
+
};
|
|
1519
|
+
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
1520
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1521
|
+
const ret = arg0;
|
|
1522
|
+
return addHeapObject(ret);
|
|
1523
|
+
};
|
|
1524
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1525
|
+
const ret = getObject(arg0);
|
|
1526
|
+
return addHeapObject(ret);
|
|
1527
|
+
};
|
|
1528
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1529
|
+
takeObject(arg0);
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
return imports;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
function __wbg_finalize_init(instance, module) {
|
|
1536
|
+
wasm = instance.exports;
|
|
1537
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
1538
|
+
cachedDataViewMemory0 = null;
|
|
1539
|
+
cachedUint32ArrayMemory0 = null;
|
|
1540
|
+
cachedUint8ArrayMemory0 = null;
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
return wasm;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
function initSync(module) {
|
|
1548
|
+
if (wasm !== undefined) return wasm;
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
if (typeof module !== 'undefined') {
|
|
1552
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1553
|
+
({module} = module)
|
|
1554
|
+
} else {
|
|
1555
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
const imports = __wbg_get_imports();
|
|
1560
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1561
|
+
module = new WebAssembly.Module(module);
|
|
1562
|
+
}
|
|
1563
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1564
|
+
return __wbg_finalize_init(instance, module);
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
async function __wbg_init(module_or_path) {
|
|
1568
|
+
if (wasm !== undefined) return wasm;
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
if (typeof module_or_path !== 'undefined') {
|
|
1572
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1573
|
+
({module_or_path} = module_or_path)
|
|
1574
|
+
} else {
|
|
1575
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
if (typeof module_or_path === 'undefined') {
|
|
1580
|
+
module_or_path = importWasmModule('typst_ts_web_compiler_bg.wasm', import.meta.url);
|
|
1581
|
+
}
|
|
1582
|
+
const imports = __wbg_get_imports();
|
|
1583
|
+
|
|
1584
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1585
|
+
module_or_path = fetch(module_or_path);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1589
|
+
|
|
1590
|
+
return __wbg_finalize_init(instance, module);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
export { initSync };
|
|
1594
|
+
export default __wbg_init;
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
let importWasmModule = async function(wasm_name, url) {
|
|
1598
|
+
throw new Error('Cannot import wasm module without importer: ' + wasm_name + ' ' + url);
|
|
1599
|
+
};
|
|
1600
|
+
function setImportWasmModule(importer) {
|
|
1601
|
+
importWasmModule = importer;
|
|
1602
|
+
}
|
|
1603
|
+
export {
|
|
1604
|
+
setImportWasmModule
|
|
1605
|
+
}
|