quietmark 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +276 -2
- package/dist/index.d.ts +76 -0
- package/dist/index.js +170 -0
- package/dist/index.js.map +1 -0
- package/dist/inline.d.ts +2 -0
- package/dist/inline.js +16 -0
- package/dist/inline.js.map +1 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/wasm/inline.d.ts +1 -0
- package/dist/wasm/inline.js +2 -0
- package/dist/wasm/quietmark.d.ts +139 -0
- package/dist/wasm/quietmark.js +807 -0
- package/dist/wasm/quietmark_bg.wasm +0 -0
- package/dist/wasm/quietmark_bg.wasm.d.ts +30 -0
- package/package.json +51 -3
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
/* @ts-self-types="./quietmark.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A text being edited and the look of each of its blocks. A view keeps one
|
|
5
|
+
* per editor, gives it every change, and draws again only the blocks a
|
|
6
|
+
* change names.
|
|
7
|
+
*/
|
|
8
|
+
export class Document {
|
|
9
|
+
__destroy_into_raw() {
|
|
10
|
+
const ptr = this.__wbg_ptr;
|
|
11
|
+
this.__wbg_ptr = 0;
|
|
12
|
+
DocumentFinalization.unregister(this);
|
|
13
|
+
return ptr;
|
|
14
|
+
}
|
|
15
|
+
free() {
|
|
16
|
+
const ptr = this.__destroy_into_raw();
|
|
17
|
+
wasm.__wbg_document_free(ptr, 0);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Applies an edit, such as one `key` or `toggleTask` returned.
|
|
21
|
+
* @param {any} edit
|
|
22
|
+
* @returns {any}
|
|
23
|
+
*/
|
|
24
|
+
apply(edit) {
|
|
25
|
+
const ret = wasm.document_apply(this.__wbg_ptr, edit);
|
|
26
|
+
if (ret[2]) {
|
|
27
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
28
|
+
}
|
|
29
|
+
return takeFromExternrefTable0(ret[0]);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @returns {number}
|
|
33
|
+
*/
|
|
34
|
+
blockCount() {
|
|
35
|
+
const ret = wasm.document_blockCount(this.__wbg_ptr);
|
|
36
|
+
return ret >>> 0;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The blocks from `start` up to `end`, both clamped to the blocks
|
|
40
|
+
* there are, or all of them. A view fetches only the ones a change
|
|
41
|
+
* names, since each crosses as a fresh object.
|
|
42
|
+
* @param {number | null} [start]
|
|
43
|
+
* @param {number | null} [end]
|
|
44
|
+
* @returns {any}
|
|
45
|
+
*/
|
|
46
|
+
blocks(start, end) {
|
|
47
|
+
const ret = wasm.document_blocks(this.__wbg_ptr, isLikeNone(start) ? Number.MAX_SAFE_INTEGER : (start) >>> 0, isLikeNone(end) ? Number.MAX_SAFE_INTEGER : (end) >>> 0);
|
|
48
|
+
if (ret[2]) {
|
|
49
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
50
|
+
}
|
|
51
|
+
return takeFromExternrefTable0(ret[0]);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* What `key` does with the selection at `from..to`, or `undefined`
|
|
55
|
+
* where the Markdown gives it no meaning and the view does what it
|
|
56
|
+
* always does.
|
|
57
|
+
* @param {number} from
|
|
58
|
+
* @param {number} to
|
|
59
|
+
* @param {string} key
|
|
60
|
+
* @returns {any}
|
|
61
|
+
*/
|
|
62
|
+
key(from, to, key) {
|
|
63
|
+
const val2 = +from;
|
|
64
|
+
const val3 = +to;
|
|
65
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
66
|
+
const len0 = WASM_VECTOR_LEN;
|
|
67
|
+
const ret = wasm.document_key(this.__wbg_ptr, val2, val3, ptr0, len0);
|
|
68
|
+
if (ret[2]) {
|
|
69
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
70
|
+
}
|
|
71
|
+
return takeFromExternrefTable0(ret[0]);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The whole text's look, with offsets and lines from the text's start.
|
|
75
|
+
* @returns {any}
|
|
76
|
+
*/
|
|
77
|
+
look() {
|
|
78
|
+
const ret = wasm.document_look(this.__wbg_ptr);
|
|
79
|
+
if (ret[2]) {
|
|
80
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
81
|
+
}
|
|
82
|
+
return takeFromExternrefTable0(ret[0]);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A document for `text`. `options` defaults to the note preset, and a
|
|
86
|
+
* field it leaves out keeps the note preset's value.
|
|
87
|
+
* @param {string} text
|
|
88
|
+
* @param {any} options
|
|
89
|
+
*/
|
|
90
|
+
constructor(text, options) {
|
|
91
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
92
|
+
const len0 = WASM_VECTOR_LEN;
|
|
93
|
+
const ret = wasm.document_new(ptr0, len0, options);
|
|
94
|
+
if (ret[2]) {
|
|
95
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
96
|
+
}
|
|
97
|
+
this.__wbg_ptr = ret[0];
|
|
98
|
+
DocumentFinalization.register(this, this.__wbg_ptr, this);
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @returns {any}
|
|
103
|
+
*/
|
|
104
|
+
options() {
|
|
105
|
+
const ret = wasm.document_options(this.__wbg_ptr);
|
|
106
|
+
if (ret[2]) {
|
|
107
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
108
|
+
}
|
|
109
|
+
return takeFromExternrefTable0(ret[0]);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Replaces `from..to` with `insert`. A range past the text's end
|
|
113
|
+
* changes nothing and returns an empty change.
|
|
114
|
+
* @param {number} from
|
|
115
|
+
* @param {number} to
|
|
116
|
+
* @param {string} insert
|
|
117
|
+
* @returns {any}
|
|
118
|
+
*/
|
|
119
|
+
replace(from, to, insert) {
|
|
120
|
+
const val2 = +from;
|
|
121
|
+
const val3 = +to;
|
|
122
|
+
const ptr0 = passStringToWasm0(insert, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
123
|
+
const len0 = WASM_VECTOR_LEN;
|
|
124
|
+
const ret = wasm.document_replace(this.__wbg_ptr, val2, val3, ptr0, len0);
|
|
125
|
+
if (ret[2]) {
|
|
126
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
127
|
+
}
|
|
128
|
+
return takeFromExternrefTable0(ret[0]);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @param {any} options
|
|
132
|
+
* @returns {any}
|
|
133
|
+
*/
|
|
134
|
+
setOptions(options) {
|
|
135
|
+
const ret = wasm.document_setOptions(this.__wbg_ptr, options);
|
|
136
|
+
if (ret[2]) {
|
|
137
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
138
|
+
}
|
|
139
|
+
return takeFromExternrefTable0(ret[0]);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @param {string} text
|
|
143
|
+
* @returns {any}
|
|
144
|
+
*/
|
|
145
|
+
setText(text) {
|
|
146
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
147
|
+
const len0 = WASM_VECTOR_LEN;
|
|
148
|
+
const ret = wasm.document_setText(this.__wbg_ptr, ptr0, len0);
|
|
149
|
+
if (ret[2]) {
|
|
150
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
151
|
+
}
|
|
152
|
+
return takeFromExternrefTable0(ret[0]);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @returns {string}
|
|
156
|
+
*/
|
|
157
|
+
text() {
|
|
158
|
+
let deferred1_0;
|
|
159
|
+
let deferred1_1;
|
|
160
|
+
try {
|
|
161
|
+
const ret = wasm.document_text(this.__wbg_ptr);
|
|
162
|
+
deferred1_0 = ret[0];
|
|
163
|
+
deferred1_1 = ret[1];
|
|
164
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
165
|
+
} finally {
|
|
166
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Ticks or clears the task box on the line holding `at`, or
|
|
171
|
+
* `undefined` when that line holds none.
|
|
172
|
+
* @param {number} at
|
|
173
|
+
* @returns {any}
|
|
174
|
+
*/
|
|
175
|
+
toggleTask(at) {
|
|
176
|
+
const ret = wasm.document_toggleTask(this.__wbg_ptr, at);
|
|
177
|
+
if (ret[2]) {
|
|
178
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
179
|
+
}
|
|
180
|
+
return takeFromExternrefTable0(ret[0]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* What `key` does in `text` with the selection at `from..to`.
|
|
187
|
+
* @param {string} text
|
|
188
|
+
* @param {number} from
|
|
189
|
+
* @param {number} to
|
|
190
|
+
* @param {string} key
|
|
191
|
+
* @returns {any}
|
|
192
|
+
*/
|
|
193
|
+
export function key(text, from, to, key) {
|
|
194
|
+
const val3 = +from;
|
|
195
|
+
const val4 = +to;
|
|
196
|
+
let ptr0, len0, ptr1, len1;
|
|
197
|
+
try {
|
|
198
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
+
len0 = WASM_VECTOR_LEN;
|
|
200
|
+
ptr1 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
201
|
+
len1 = WASM_VECTOR_LEN;
|
|
202
|
+
} catch (e) {
|
|
203
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
204
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
205
|
+
throw e;
|
|
206
|
+
}
|
|
207
|
+
const ret = wasm.key(ptr0, len0, val3, val4, ptr1, len1);
|
|
208
|
+
if (ret[2]) {
|
|
209
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
210
|
+
}
|
|
211
|
+
return takeFromExternrefTable0(ret[0]);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The whole look of `text`, for a view that keeps no document.
|
|
216
|
+
* @param {string} text
|
|
217
|
+
* @param {any} options
|
|
218
|
+
* @returns {any}
|
|
219
|
+
*/
|
|
220
|
+
export function look(text, options) {
|
|
221
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
223
|
+
const ret = wasm.look(ptr0, len0, options);
|
|
224
|
+
if (ret[2]) {
|
|
225
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
226
|
+
}
|
|
227
|
+
return takeFromExternrefTable0(ret[0]);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* A message box: every line stays put and markers only hide.
|
|
232
|
+
* @returns {any}
|
|
233
|
+
*/
|
|
234
|
+
export function messageOptions() {
|
|
235
|
+
const ret = wasm.messageOptions();
|
|
236
|
+
if (ret[2]) {
|
|
237
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
238
|
+
}
|
|
239
|
+
return takeFromExternrefTable0(ret[0]);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Everything on, as a note editor wants it.
|
|
244
|
+
* @returns {any}
|
|
245
|
+
*/
|
|
246
|
+
export function noteOptions() {
|
|
247
|
+
const ret = wasm.noteOptions();
|
|
248
|
+
if (ret[2]) {
|
|
249
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
250
|
+
}
|
|
251
|
+
return takeFromExternrefTable0(ret[0]);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Ticks or clears the task box on the line of `text` holding `at`.
|
|
256
|
+
* @param {string} text
|
|
257
|
+
* @param {number} at
|
|
258
|
+
* @returns {any}
|
|
259
|
+
*/
|
|
260
|
+
export function toggleTask(text, at) {
|
|
261
|
+
const val2 = +at;
|
|
262
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
263
|
+
const len0 = WASM_VECTOR_LEN;
|
|
264
|
+
const ret = wasm.toggleTask(ptr0, len0, val2);
|
|
265
|
+
if (ret[2]) {
|
|
266
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
267
|
+
}
|
|
268
|
+
return takeFromExternrefTable0(ret[0]);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The text as it reads with the selection at `from..to`: hidden markers
|
|
273
|
+
* gone, glyphs in their place, the caret drawn as `‸`. Tests compare it,
|
|
274
|
+
* as the core's corpus does.
|
|
275
|
+
* @param {string} text
|
|
276
|
+
* @param {any} options
|
|
277
|
+
* @param {number} from
|
|
278
|
+
* @param {number} to
|
|
279
|
+
* @returns {string}
|
|
280
|
+
*/
|
|
281
|
+
export function view(text, options, from, to) {
|
|
282
|
+
let deferred5_0;
|
|
283
|
+
let deferred5_1;
|
|
284
|
+
try {
|
|
285
|
+
const val2 = +from;
|
|
286
|
+
const val3 = +to;
|
|
287
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.view(ptr0, len0, options, val2, val3);
|
|
290
|
+
var ptr4 = ret[0];
|
|
291
|
+
var len4 = ret[1];
|
|
292
|
+
if (ret[3]) {
|
|
293
|
+
ptr4 = 0; len4 = 0;
|
|
294
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
295
|
+
}
|
|
296
|
+
deferred5_0 = ptr4;
|
|
297
|
+
deferred5_1 = len4;
|
|
298
|
+
return getStringFromWasm0(ptr4, len4);
|
|
299
|
+
} finally {
|
|
300
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function __wbg_get_imports() {
|
|
304
|
+
const import0 = {
|
|
305
|
+
__proto__: null,
|
|
306
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
307
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
308
|
+
return ret;
|
|
309
|
+
},
|
|
310
|
+
__wbg_Number_ff192a72a0dcdf6d: function(arg0) {
|
|
311
|
+
const ret = Number(arg0);
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
315
|
+
const ret = String(arg1);
|
|
316
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
317
|
+
const len1 = WASM_VECTOR_LEN;
|
|
318
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
319
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
320
|
+
},
|
|
321
|
+
__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
|
|
322
|
+
const v = arg1;
|
|
323
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
324
|
+
getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
325
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
326
|
+
},
|
|
327
|
+
__wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
|
|
328
|
+
const v = arg0;
|
|
329
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
330
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
331
|
+
},
|
|
332
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
333
|
+
const ret = debugString(arg1);
|
|
334
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
335
|
+
const len1 = WASM_VECTOR_LEN;
|
|
336
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
337
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
338
|
+
},
|
|
339
|
+
__wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
|
|
340
|
+
const ret = arg0 in arg1;
|
|
341
|
+
return ret;
|
|
342
|
+
},
|
|
343
|
+
__wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
|
|
344
|
+
const ret = typeof(arg0) === 'bigint';
|
|
345
|
+
return ret;
|
|
346
|
+
},
|
|
347
|
+
__wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
|
|
348
|
+
const ret = typeof(arg0) === 'function';
|
|
349
|
+
return ret;
|
|
350
|
+
},
|
|
351
|
+
__wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
|
|
352
|
+
const ret = arg0 === null;
|
|
353
|
+
return ret;
|
|
354
|
+
},
|
|
355
|
+
__wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
|
|
356
|
+
const val = arg0;
|
|
357
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
358
|
+
return ret;
|
|
359
|
+
},
|
|
360
|
+
__wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
|
|
361
|
+
const ret = typeof(arg0) === 'string';
|
|
362
|
+
return ret;
|
|
363
|
+
},
|
|
364
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
365
|
+
const ret = arg0 === undefined;
|
|
366
|
+
return ret;
|
|
367
|
+
},
|
|
368
|
+
__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
|
|
369
|
+
const ret = arg0 === arg1;
|
|
370
|
+
return ret;
|
|
371
|
+
},
|
|
372
|
+
__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
|
|
373
|
+
const ret = arg0 == arg1;
|
|
374
|
+
return ret;
|
|
375
|
+
},
|
|
376
|
+
__wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
|
|
377
|
+
const obj = arg1;
|
|
378
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
379
|
+
getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
380
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
381
|
+
},
|
|
382
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
383
|
+
const obj = arg1;
|
|
384
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
385
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
386
|
+
var len1 = WASM_VECTOR_LEN;
|
|
387
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
388
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
389
|
+
},
|
|
390
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
391
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
392
|
+
},
|
|
393
|
+
__wbg_call_40b008ba32f73991: function() { return handleError(function (arg0, arg1) {
|
|
394
|
+
const ret = arg0.call(arg1);
|
|
395
|
+
return ret;
|
|
396
|
+
}, arguments); },
|
|
397
|
+
__wbg_done_57e08d0be6e30c02: function(arg0) {
|
|
398
|
+
const ret = arg0.done;
|
|
399
|
+
return ret;
|
|
400
|
+
},
|
|
401
|
+
__wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
|
|
402
|
+
const ret = Object.entries(arg0);
|
|
403
|
+
return ret;
|
|
404
|
+
},
|
|
405
|
+
__wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
|
|
406
|
+
const ret = Reflect.get(arg0, arg1);
|
|
407
|
+
return ret;
|
|
408
|
+
}, arguments); },
|
|
409
|
+
__wbg_get_d7176cfb76d71114: function(arg0, arg1) {
|
|
410
|
+
const ret = arg0[arg1 >>> 0];
|
|
411
|
+
return ret;
|
|
412
|
+
},
|
|
413
|
+
__wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
|
|
414
|
+
const ret = arg0[arg1 >>> 0];
|
|
415
|
+
return ret;
|
|
416
|
+
},
|
|
417
|
+
__wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
|
|
418
|
+
const ret = arg0[arg1];
|
|
419
|
+
return ret;
|
|
420
|
+
},
|
|
421
|
+
__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
|
|
422
|
+
let result;
|
|
423
|
+
try {
|
|
424
|
+
result = arg0 instanceof ArrayBuffer;
|
|
425
|
+
} catch (_) {
|
|
426
|
+
result = false;
|
|
427
|
+
}
|
|
428
|
+
const ret = result;
|
|
429
|
+
return ret;
|
|
430
|
+
},
|
|
431
|
+
__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
|
|
432
|
+
let result;
|
|
433
|
+
try {
|
|
434
|
+
result = arg0 instanceof Uint8Array;
|
|
435
|
+
} catch (_) {
|
|
436
|
+
result = false;
|
|
437
|
+
}
|
|
438
|
+
const ret = result;
|
|
439
|
+
return ret;
|
|
440
|
+
},
|
|
441
|
+
__wbg_isArray_bcf1376d0d732d08: function(arg0) {
|
|
442
|
+
const ret = Array.isArray(arg0);
|
|
443
|
+
return ret;
|
|
444
|
+
},
|
|
445
|
+
__wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
|
|
446
|
+
const ret = Number.isSafeInteger(arg0);
|
|
447
|
+
return ret;
|
|
448
|
+
},
|
|
449
|
+
__wbg_iterator_e4c5e8f68ada7b58: function() {
|
|
450
|
+
const ret = Symbol.iterator;
|
|
451
|
+
return ret;
|
|
452
|
+
},
|
|
453
|
+
__wbg_length_186163212ffe79c3: function(arg0) {
|
|
454
|
+
const ret = arg0.length;
|
|
455
|
+
return ret;
|
|
456
|
+
},
|
|
457
|
+
__wbg_length_b03a0fabb109b1e9: function(arg0) {
|
|
458
|
+
const ret = arg0.length;
|
|
459
|
+
return ret;
|
|
460
|
+
},
|
|
461
|
+
__wbg_new_13de428334042d26: function(arg0) {
|
|
462
|
+
const ret = new Uint8Array(arg0);
|
|
463
|
+
return ret;
|
|
464
|
+
},
|
|
465
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
466
|
+
const ret = new Array();
|
|
467
|
+
return ret;
|
|
468
|
+
},
|
|
469
|
+
__wbg_new_cd4348290afae586: function() {
|
|
470
|
+
const ret = new Object();
|
|
471
|
+
return ret;
|
|
472
|
+
},
|
|
473
|
+
__wbg_next_178c1651c11432b3: function(arg0) {
|
|
474
|
+
const ret = arg0.next;
|
|
475
|
+
return ret;
|
|
476
|
+
},
|
|
477
|
+
__wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
|
|
478
|
+
const ret = arg0.next();
|
|
479
|
+
return ret;
|
|
480
|
+
}, arguments); },
|
|
481
|
+
__wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
|
|
482
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
483
|
+
},
|
|
484
|
+
__wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
|
|
485
|
+
arg0[arg1 >>> 0] = arg2;
|
|
486
|
+
},
|
|
487
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
488
|
+
arg0[arg1] = arg2;
|
|
489
|
+
},
|
|
490
|
+
__wbg_value_e0f328965e184931: function(arg0) {
|
|
491
|
+
const ret = arg0.value;
|
|
492
|
+
return ret;
|
|
493
|
+
},
|
|
494
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
495
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
496
|
+
const ret = arg0;
|
|
497
|
+
return ret;
|
|
498
|
+
},
|
|
499
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
500
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
501
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
502
|
+
return ret;
|
|
503
|
+
},
|
|
504
|
+
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
505
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
506
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
507
|
+
return ret;
|
|
508
|
+
},
|
|
509
|
+
__wbindgen_init_externref_table: function() {
|
|
510
|
+
const table = wasm.__wbindgen_externrefs;
|
|
511
|
+
table.set(0, undefined);
|
|
512
|
+
table.set(1024, undefined);
|
|
513
|
+
table.set(1025, null);
|
|
514
|
+
table.set(1026, true);
|
|
515
|
+
table.set(1027, false);
|
|
516
|
+
},
|
|
517
|
+
};
|
|
518
|
+
return {
|
|
519
|
+
__proto__: null,
|
|
520
|
+
"./quietmark_bg.js": import0,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
525
|
+
? { register: () => {}, unregister: () => {} }
|
|
526
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
|
|
527
|
+
|
|
528
|
+
function addToExternrefTable0(obj) {
|
|
529
|
+
const idx = wasm.__externref_table_alloc();
|
|
530
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
531
|
+
return idx;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function debugString(val) {
|
|
535
|
+
switch (typeof val) {
|
|
536
|
+
// primitive types
|
|
537
|
+
case 'number':
|
|
538
|
+
case 'boolean':
|
|
539
|
+
case 'undefined':
|
|
540
|
+
return `${val}`;
|
|
541
|
+
case 'string':
|
|
542
|
+
return JSON.stringify(val);
|
|
543
|
+
case 'bigint':
|
|
544
|
+
return `${val}n`;
|
|
545
|
+
case 'symbol':
|
|
546
|
+
return val.description !== undefined
|
|
547
|
+
? `Symbol(${val.description})`
|
|
548
|
+
: 'Symbol';
|
|
549
|
+
case 'function':
|
|
550
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
551
|
+
? `Function(${val.name})`
|
|
552
|
+
: 'Function';
|
|
553
|
+
case 'object': {
|
|
554
|
+
if (val === null) {
|
|
555
|
+
return 'null';
|
|
556
|
+
}
|
|
557
|
+
// objects
|
|
558
|
+
if (Array.isArray(val)) {
|
|
559
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
560
|
+
}
|
|
561
|
+
// errors
|
|
562
|
+
if (val instanceof Error) {
|
|
563
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
const toStringOutput = toString.call(val);
|
|
567
|
+
// Test for built-in
|
|
568
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
569
|
+
|
|
570
|
+
// Failed to match the standard '[object ClassName]'
|
|
571
|
+
if (className === undefined) {
|
|
572
|
+
return toStringOutput;
|
|
573
|
+
}
|
|
574
|
+
if (className === 'Object') {
|
|
575
|
+
// we're a user defined class or Object
|
|
576
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
577
|
+
// easier than looping through ownProperties of `val`.
|
|
578
|
+
try {
|
|
579
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
580
|
+
} catch (_) {
|
|
581
|
+
return 'Object';
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
585
|
+
return className;
|
|
586
|
+
}
|
|
587
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
588
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
593
|
+
ptr = ptr >>> 0;
|
|
594
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
let cachedDataViewMemory0 = null;
|
|
598
|
+
function getDataViewMemory0() {
|
|
599
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
600
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
601
|
+
}
|
|
602
|
+
return cachedDataViewMemory0;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function getStringFromWasm0(ptr, len) {
|
|
606
|
+
ptr = ptr >>> 0;
|
|
607
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
let cachedUint8ArrayMemory0 = null;
|
|
611
|
+
function getUint8ArrayMemory0() {
|
|
612
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
613
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
614
|
+
}
|
|
615
|
+
return cachedUint8ArrayMemory0;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function handleError(f, args) {
|
|
619
|
+
try {
|
|
620
|
+
return f.apply(this, args);
|
|
621
|
+
} catch (e) {
|
|
622
|
+
const idx = addToExternrefTable0(e);
|
|
623
|
+
wasm.__wbindgen_exn_store(idx);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function isLikeNone(x) {
|
|
628
|
+
return x === undefined || x === null;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
632
|
+
if (realloc === undefined) {
|
|
633
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
634
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
635
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
636
|
+
WASM_VECTOR_LEN = buf.length;
|
|
637
|
+
return ptr;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
let len = arg.length;
|
|
641
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
642
|
+
|
|
643
|
+
const mem = getUint8ArrayMemory0();
|
|
644
|
+
|
|
645
|
+
let offset = 0;
|
|
646
|
+
|
|
647
|
+
for (; offset < len; offset++) {
|
|
648
|
+
const code = arg.charCodeAt(offset);
|
|
649
|
+
if (code > 0x7F) break;
|
|
650
|
+
mem[ptr + offset] = code;
|
|
651
|
+
}
|
|
652
|
+
if (offset !== len) {
|
|
653
|
+
if (offset !== 0) {
|
|
654
|
+
arg = arg.slice(offset);
|
|
655
|
+
}
|
|
656
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
657
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
658
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
659
|
+
|
|
660
|
+
offset += ret.written;
|
|
661
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
WASM_VECTOR_LEN = offset;
|
|
665
|
+
return ptr;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function takeFromExternrefTable0(idx) {
|
|
669
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
670
|
+
wasm.__externref_table_dealloc(idx);
|
|
671
|
+
return value;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
675
|
+
cachedTextDecoder.decode();
|
|
676
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
677
|
+
let numBytesDecoded = 0;
|
|
678
|
+
function decodeText(bytes) {
|
|
679
|
+
numBytesDecoded += bytes.length;
|
|
680
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
681
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
682
|
+
cachedTextDecoder.decode();
|
|
683
|
+
numBytesDecoded = bytes.length;
|
|
684
|
+
}
|
|
685
|
+
return cachedTextDecoder.decode(bytes);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const cachedTextEncoder = new TextEncoder();
|
|
689
|
+
|
|
690
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
691
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
692
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
693
|
+
view.set(buf);
|
|
694
|
+
return {
|
|
695
|
+
read: arg.length,
|
|
696
|
+
written: buf.length
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
let WASM_VECTOR_LEN = 0;
|
|
702
|
+
|
|
703
|
+
let wasmModule, wasmInstance, wasm;
|
|
704
|
+
function __wbg_finalize_init(instance, module) {
|
|
705
|
+
wasmInstance = instance;
|
|
706
|
+
wasm = instance.exports;
|
|
707
|
+
wasmModule = module;
|
|
708
|
+
cachedDataViewMemory0 = null;
|
|
709
|
+
cachedUint8ArrayMemory0 = null;
|
|
710
|
+
wasm.__wbindgen_start();
|
|
711
|
+
return wasm;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
async function __wbg_load(module, imports) {
|
|
715
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
716
|
+
if (!module.ok) {
|
|
717
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
721
|
+
try {
|
|
722
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
723
|
+
} catch (e) {
|
|
724
|
+
const validResponse = expectedResponseType(module.type);
|
|
725
|
+
|
|
726
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
727
|
+
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);
|
|
728
|
+
|
|
729
|
+
} else { throw e; }
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
const bytes = await module.arrayBuffer();
|
|
734
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
735
|
+
} else {
|
|
736
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
737
|
+
|
|
738
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
739
|
+
return { instance, module };
|
|
740
|
+
} else {
|
|
741
|
+
return instance;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
function expectedResponseType(type) {
|
|
746
|
+
switch (type) {
|
|
747
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
748
|
+
}
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
function initSync(module) {
|
|
754
|
+
if (wasm !== undefined) return wasm;
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
if (module !== undefined) {
|
|
758
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
759
|
+
({module} = module)
|
|
760
|
+
} else {
|
|
761
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
const imports = __wbg_get_imports();
|
|
766
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
767
|
+
module = new WebAssembly.Module(module);
|
|
768
|
+
}
|
|
769
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
770
|
+
return __wbg_finalize_init(instance, module);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
let __wbg_init_promise;
|
|
774
|
+
async function __wbg_init(module_or_path) {
|
|
775
|
+
if (wasm !== undefined) return wasm;
|
|
776
|
+
if (__wbg_init_promise === undefined) {
|
|
777
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
778
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
779
|
+
}
|
|
780
|
+
return __wbg_init_promise;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
async function __wbg_init_once(module_or_path) {
|
|
784
|
+
|
|
785
|
+
if (module_or_path !== undefined) {
|
|
786
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
787
|
+
({module_or_path} = module_or_path)
|
|
788
|
+
} else {
|
|
789
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if (module_or_path === undefined) {
|
|
794
|
+
module_or_path = new URL('quietmark_bg.wasm', import.meta.url);
|
|
795
|
+
}
|
|
796
|
+
const imports = __wbg_get_imports();
|
|
797
|
+
|
|
798
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
799
|
+
module_or_path = fetch(module_or_path);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
803
|
+
|
|
804
|
+
return __wbg_finalize_init(instance, module);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
export { initSync, __wbg_init as default };
|