@vector-im/matrix-wysiwyg 2.42.0 → 2.42.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.
@@ -1,1850 +0,0 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- function isLikeNone(x) {
8
- return x === undefined || x === null;
9
- }
10
-
11
- function addToExternrefTable0(obj) {
12
- const idx = wasm.__externref_table_alloc();
13
- wasm.__wbindgen_export_1.set(idx, obj);
14
- return idx;
15
- }
16
-
17
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
18
-
19
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
20
-
21
- cachedTextDecoder.decode();
22
-
23
- let cachedUint8ArrayMemory0 = null;
24
-
25
- function getUint8ArrayMemory0() {
26
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
27
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
28
- }
29
- return cachedUint8ArrayMemory0;
30
- }
31
-
32
- function getStringFromWasm0(ptr, len) {
33
- ptr = ptr >>> 0;
34
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
35
- }
36
-
37
- let WASM_VECTOR_LEN = 0;
38
-
39
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
40
-
41
- let cachedTextEncoder = new lTextEncoder('utf-8');
42
-
43
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
44
- ? function (arg, view) {
45
- return cachedTextEncoder.encodeInto(arg, view);
46
- }
47
- : function (arg, view) {
48
- const buf = cachedTextEncoder.encode(arg);
49
- view.set(buf);
50
- return {
51
- read: arg.length,
52
- written: buf.length
53
- };
54
- });
55
-
56
- function passStringToWasm0(arg, malloc, realloc) {
57
-
58
- if (realloc === undefined) {
59
- const buf = cachedTextEncoder.encode(arg);
60
- const ptr = malloc(buf.length, 1) >>> 0;
61
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
62
- WASM_VECTOR_LEN = buf.length;
63
- return ptr;
64
- }
65
-
66
- let len = arg.length;
67
- let ptr = malloc(len, 1) >>> 0;
68
-
69
- const mem = getUint8ArrayMemory0();
70
-
71
- let offset = 0;
72
-
73
- for (; offset < len; offset++) {
74
- const code = arg.charCodeAt(offset);
75
- if (code > 0x7F) break;
76
- mem[ptr + offset] = code;
77
- }
78
-
79
- if (offset !== len) {
80
- if (offset !== 0) {
81
- arg = arg.slice(offset);
82
- }
83
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
84
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
85
- const ret = encodeString(arg, view);
86
-
87
- offset += ret.written;
88
- ptr = realloc(ptr, len, offset, 1) >>> 0;
89
- }
90
-
91
- WASM_VECTOR_LEN = offset;
92
- return ptr;
93
- }
94
-
95
- let cachedDataViewMemory0 = null;
96
-
97
- function getDataViewMemory0() {
98
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
99
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
100
- }
101
- return cachedDataViewMemory0;
102
- }
103
-
104
- function handleError(f, args) {
105
- try {
106
- return f.apply(this, args);
107
- } catch (e) {
108
- const idx = addToExternrefTable0(e);
109
- wasm.__wbindgen_exn_store(idx);
110
- }
111
- }
112
-
113
- function takeFromExternrefTable0(idx) {
114
- const value = wasm.__wbindgen_export_1.get(idx);
115
- wasm.__externref_table_dealloc(idx);
116
- return value;
117
- }
118
-
119
- function _assertClass(instance, klass) {
120
- if (!(instance instanceof klass)) {
121
- throw new Error(`expected instance of ${klass.name}`);
122
- }
123
- }
124
-
125
- export function start() {
126
- wasm.start();
127
- }
128
-
129
- /**
130
- * @returns {ComposerModel}
131
- */
132
- export function new_composer_model() {
133
- const ret = wasm.composermodel_new();
134
- return ComposerModel.__wrap(ret);
135
- }
136
-
137
- /**
138
- * @param {string} html
139
- * @param {number} start_utf16_codeunit
140
- * @param {number} end_utf16_codeunit
141
- * @returns {ComposerModel}
142
- */
143
- export function new_composer_model_from_html(html, start_utf16_codeunit, end_utf16_codeunit) {
144
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
145
- const len0 = WASM_VECTOR_LEN;
146
- const ret = wasm.new_composer_model_from_html(ptr0, len0, start_utf16_codeunit, end_utf16_codeunit);
147
- return ComposerModel.__wrap(ret);
148
- }
149
-
150
- function __wbg_adapter_124(arg0, arg1, arg2, arg3) {
151
- wasm.closure84_externref_shim(arg0, arg1, arg2, arg3);
152
- }
153
-
154
- function __wbg_adapter_131(arg0, arg1, arg2, arg3, arg4) {
155
- wasm.closure78_externref_shim(arg0, arg1, arg2, arg3, arg4);
156
- }
157
-
158
- /**
159
- * @enum {0 | 1 | 2}
160
- */
161
- export const ActionState = Object.freeze({
162
- /**
163
- * The button can be clicked, and will perform its normal action
164
- * e.g. make something bold
165
- */
166
- Enabled: 0, "0": "Enabled",
167
- /**
168
- * The button can be clicked, and will perform the reverse of its
169
- * normal action e.g. stop something being bold
170
- */
171
- Reversed: 1, "1": "Reversed",
172
- /**
173
- * The button cannot be clicked
174
- */
175
- Disabled: 2, "2": "Disabled",
176
- });
177
- /**
178
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13}
179
- */
180
- export const ComposerAction = Object.freeze({
181
- Bold: 0, "0": "Bold",
182
- Italic: 1, "1": "Italic",
183
- StrikeThrough: 2, "2": "StrikeThrough",
184
- Underline: 3, "3": "Underline",
185
- InlineCode: 4, "4": "InlineCode",
186
- Link: 5, "5": "Link",
187
- Undo: 6, "6": "Undo",
188
- Redo: 7, "7": "Redo",
189
- OrderedList: 8, "8": "OrderedList",
190
- UnorderedList: 9, "9": "UnorderedList",
191
- Indent: 10, "10": "Indent",
192
- Unindent: 11, "11": "Unindent",
193
- CodeBlock: 12, "12": "CodeBlock",
194
- Quote: 13, "13": "Quote",
195
- });
196
- /**
197
- * @enum {0 | 1}
198
- */
199
- export const DomCreationError = Object.freeze({
200
- HtmlParseError: 0, "0": "HtmlParseError",
201
- MarkdownParseError: 1, "1": "MarkdownParseError",
202
- });
203
- /**
204
- * @enum {0 | 1 | 2}
205
- */
206
- export const HtmlSource = Object.freeze({
207
- Matrix: 0, "0": "Matrix",
208
- GoogleDoc: 1, "1": "GoogleDoc",
209
- UnknownExternal: 2, "2": "UnknownExternal",
210
- });
211
- /**
212
- * @enum {0 | 1 | 2 | 3 | 4}
213
- */
214
- export const PatternKeyType = Object.freeze({
215
- At: 0, "0": "At",
216
- Hash: 1, "1": "Hash",
217
- Slash: 2, "2": "Slash",
218
- Custom: 3, "3": "Custom",
219
- Colon: 4, "4": "Colon",
220
- });
221
-
222
- const __wbindgen_enum_SupportedType = ["text/html", "text/xml", "application/xml", "application/xhtml+xml", "image/svg+xml"];
223
-
224
- const ComposerModelFinalization = (typeof FinalizationRegistry === 'undefined')
225
- ? { register: () => {}, unregister: () => {} }
226
- : new FinalizationRegistry(ptr => wasm.__wbg_composermodel_free(ptr >>> 0, 1));
227
-
228
- export class ComposerModel {
229
-
230
- static __wrap(ptr) {
231
- ptr = ptr >>> 0;
232
- const obj = Object.create(ComposerModel.prototype);
233
- obj.__wbg_ptr = ptr;
234
- ComposerModelFinalization.register(obj, obj.__wbg_ptr, obj);
235
- return obj;
236
- }
237
-
238
- __destroy_into_raw() {
239
- const ptr = this.__wbg_ptr;
240
- this.__wbg_ptr = 0;
241
- ComposerModelFinalization.unregister(this);
242
- return ptr;
243
- }
244
-
245
- free() {
246
- const ptr = this.__destroy_into_raw();
247
- wasm.__wbg_composermodel_free(ptr, 0);
248
- }
249
- /**
250
- * @returns {ComposerUpdate}
251
- */
252
- code_block() {
253
- const ret = wasm.composermodel_code_block(this.__wbg_ptr);
254
- return ComposerUpdate.__wrap(ret);
255
- }
256
- /**
257
- * @returns {ComposerUpdate}
258
- */
259
- delete_word() {
260
- const ret = wasm.composermodel_delete_word(this.__wbg_ptr);
261
- return ComposerUpdate.__wrap(ret);
262
- }
263
- /**
264
- * @returns {ComposerUpdate}
265
- */
266
- inline_code() {
267
- const ret = wasm.composermodel_inline_code(this.__wbg_ptr);
268
- return ComposerUpdate.__wrap(ret);
269
- }
270
- /**
271
- * @returns {ComposerUpdate}
272
- */
273
- ordered_list() {
274
- const ret = wasm.composermodel_ordered_list(this.__wbg_ptr);
275
- return ComposerUpdate.__wrap(ret);
276
- }
277
- /**
278
- * @returns {ComposerUpdate}
279
- */
280
- remove_links() {
281
- const ret = wasm.composermodel_remove_links(this.__wbg_ptr);
282
- return ComposerUpdate.__wrap(ret);
283
- }
284
- /**
285
- * @param {string} new_html
286
- * @param {HtmlSource} external_source
287
- * @returns {ComposerUpdate}
288
- */
289
- replace_html(new_html, external_source) {
290
- const ptr0 = passStringToWasm0(new_html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
291
- const len0 = WASM_VECTOR_LEN;
292
- const ret = wasm.composermodel_replace_html(this.__wbg_ptr, ptr0, len0, external_source);
293
- return ComposerUpdate.__wrap(ret);
294
- }
295
- /**
296
- * @param {string} new_text
297
- * @returns {ComposerUpdate}
298
- */
299
- replace_text(new_text) {
300
- const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
301
- const len0 = WASM_VECTOR_LEN;
302
- const ret = wasm.composermodel_replace_text(this.__wbg_ptr, ptr0, len0);
303
- return ComposerUpdate.__wrap(ret);
304
- }
305
- /**
306
- * @returns {Map<any, any>}
307
- */
308
- action_states() {
309
- const ret = wasm.composermodel_action_states(this.__wbg_ptr);
310
- return ret;
311
- }
312
- /**
313
- * @returns {number}
314
- */
315
- selection_end() {
316
- const ret = wasm.composermodel_selection_end(this.__wbg_ptr);
317
- return ret >>> 0;
318
- }
319
- /**
320
- * @returns {ComposerUpdate}
321
- */
322
- backspace_word() {
323
- const ret = wasm.composermodel_backspace_word(this.__wbg_ptr);
324
- return ComposerUpdate.__wrap(ret);
325
- }
326
- /**
327
- * Creates a mention node and inserts it into the composer at the current selection
328
- * @param {string} url
329
- * @param {string} text
330
- * @param {Map<any, any>} attributes
331
- * @returns {ComposerUpdate}
332
- */
333
- insert_mention(url, text, attributes) {
334
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
335
- const len0 = WASM_VECTOR_LEN;
336
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
337
- const len1 = WASM_VECTOR_LEN;
338
- const ret = wasm.composermodel_insert_mention(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
339
- return ComposerUpdate.__wrap(ret);
340
- }
341
- /**
342
- * @returns {ComposerUpdate}
343
- */
344
- strike_through() {
345
- const ret = wasm.composermodel_strike_through(this.__wbg_ptr);
346
- return ComposerUpdate.__wrap(ret);
347
- }
348
- /**
349
- * @returns {ComposerUpdate}
350
- */
351
- unordered_list() {
352
- const ret = wasm.composermodel_unordered_list(this.__wbg_ptr);
353
- return ComposerUpdate.__wrap(ret);
354
- }
355
- /**
356
- * @returns {LinkAction}
357
- */
358
- get_link_action() {
359
- const ret = wasm.composermodel_get_link_action(this.__wbg_ptr);
360
- return LinkAction.__wrap(ret);
361
- }
362
- /**
363
- * @returns {number}
364
- */
365
- selection_start() {
366
- const ret = wasm.composermodel_selection_start(this.__wbg_ptr);
367
- return ret >>> 0;
368
- }
369
- /**
370
- * @returns {string}
371
- */
372
- to_example_format() {
373
- let deferred1_0;
374
- let deferred1_1;
375
- try {
376
- const ret = wasm.composermodel_to_example_format(this.__wbg_ptr);
377
- deferred1_0 = ret[0];
378
- deferred1_1 = ret[1];
379
- return getStringFromWasm0(ret[0], ret[1]);
380
- } finally {
381
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
382
- }
383
- }
384
- /**
385
- * @param {string} url
386
- * @param {string} text
387
- * @param {Map<any, any>} attributes
388
- * @returns {ComposerUpdate}
389
- */
390
- set_link_with_text(url, text, attributes) {
391
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
392
- const len0 = WASM_VECTOR_LEN;
393
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
- const len1 = WASM_VECTOR_LEN;
395
- const ret = wasm.composermodel_set_link_with_text(this.__wbg_ptr, ptr0, len0, ptr1, len1, attributes);
396
- return ComposerUpdate.__wrap(ret);
397
- }
398
- /**
399
- * @param {string} text
400
- * @returns {ComposerModel}
401
- */
402
- static from_example_format(text) {
403
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
404
- const len0 = WASM_VECTOR_LEN;
405
- const ret = wasm.composermodel_from_example_format(ptr0, len0);
406
- return ComposerModel.__wrap(ret);
407
- }
408
- /**
409
- * @returns {string}
410
- */
411
- get_content_as_html() {
412
- let deferred1_0;
413
- let deferred1_1;
414
- try {
415
- const ret = wasm.composermodel_get_content_as_html(this.__wbg_ptr);
416
- deferred1_0 = ret[0];
417
- deferred1_1 = ret[1];
418
- return getStringFromWasm0(ret[0], ret[1]);
419
- } finally {
420
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
421
- }
422
- }
423
- /**
424
- * @param {string} text
425
- * @returns {ComposerUpdate}
426
- */
427
- set_content_from_html(text) {
428
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
429
- const len0 = WASM_VECTOR_LEN;
430
- const ret = wasm.composermodel_set_content_from_html(this.__wbg_ptr, ptr0, len0);
431
- if (ret[2]) {
432
- throw takeFromExternrefTable0(ret[1]);
433
- }
434
- return ComposerUpdate.__wrap(ret[0]);
435
- }
436
- /**
437
- * Creates an at-room mention node and inserts it into the composer at the current selection
438
- * @param {Map<any, any>} attributes
439
- * @returns {ComposerUpdate}
440
- */
441
- insert_at_room_mention(attributes) {
442
- const ret = wasm.composermodel_insert_at_room_mention(this.__wbg_ptr, attributes);
443
- return ComposerUpdate.__wrap(ret);
444
- }
445
- /**
446
- * @returns {string}
447
- */
448
- get_content_as_markdown() {
449
- let deferred1_0;
450
- let deferred1_1;
451
- try {
452
- const ret = wasm.composermodel_get_content_as_markdown(this.__wbg_ptr);
453
- deferred1_0 = ret[0];
454
- deferred1_1 = ret[1];
455
- return getStringFromWasm0(ret[0], ret[1]);
456
- } finally {
457
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
458
- }
459
- }
460
- /**
461
- * @param {string} new_text
462
- * @param {SuggestionPattern} suggestion
463
- * @param {boolean} append_space
464
- * @returns {ComposerUpdate}
465
- */
466
- replace_text_suggestion(new_text, suggestion, append_space) {
467
- const ptr0 = passStringToWasm0(new_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
- const len0 = WASM_VECTOR_LEN;
469
- _assertClass(suggestion, SuggestionPattern);
470
- const ret = wasm.composermodel_replace_text_suggestion(this.__wbg_ptr, ptr0, len0, suggestion.__wbg_ptr, append_space);
471
- return ComposerUpdate.__wrap(ret);
472
- }
473
- /**
474
- * @returns {string}
475
- */
476
- get_content_as_plain_text() {
477
- let deferred1_0;
478
- let deferred1_1;
479
- try {
480
- const ret = wasm.composermodel_get_content_as_plain_text(this.__wbg_ptr);
481
- deferred1_0 = ret[0];
482
- deferred1_1 = ret[1];
483
- return getStringFromWasm0(ret[0], ret[1]);
484
- } finally {
485
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
486
- }
487
- }
488
- /**
489
- * @param {string} text
490
- * @returns {ComposerUpdate}
491
- */
492
- set_content_from_markdown(text) {
493
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
- const len0 = WASM_VECTOR_LEN;
495
- const ret = wasm.composermodel_set_content_from_markdown(this.__wbg_ptr, ptr0, len0);
496
- if (ret[2]) {
497
- throw takeFromExternrefTable0(ret[1]);
498
- }
499
- return ComposerUpdate.__wrap(ret[0]);
500
- }
501
- /**
502
- * @returns {string}
503
- */
504
- get_content_as_message_html() {
505
- let deferred1_0;
506
- let deferred1_1;
507
- try {
508
- const ret = wasm.composermodel_get_content_as_message_html(this.__wbg_ptr);
509
- deferred1_0 = ret[0];
510
- deferred1_1 = ret[1];
511
- return getStringFromWasm0(ret[0], ret[1]);
512
- } finally {
513
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
514
- }
515
- }
516
- /**
517
- * Creates a mention node and inserts it into the composer, replacing the
518
- * text content defined by the suggestion
519
- * @param {string} url
520
- * @param {string} text
521
- * @param {SuggestionPattern} suggestion
522
- * @param {Map<any, any>} attributes
523
- * @returns {ComposerUpdate}
524
- */
525
- insert_mention_at_suggestion(url, text, suggestion, attributes) {
526
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
527
- const len0 = WASM_VECTOR_LEN;
528
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
- const len1 = WASM_VECTOR_LEN;
530
- _assertClass(suggestion, SuggestionPattern);
531
- const ret = wasm.composermodel_insert_mention_at_suggestion(this.__wbg_ptr, ptr0, len0, ptr1, len1, suggestion.__wbg_ptr, attributes);
532
- return ComposerUpdate.__wrap(ret);
533
- }
534
- /**
535
- * @param {Array<any>} custom_suggestion_patterns
536
- */
537
- set_custom_suggestion_patterns(custom_suggestion_patterns) {
538
- wasm.composermodel_set_custom_suggestion_patterns(this.__wbg_ptr, custom_suggestion_patterns);
539
- }
540
- /**
541
- * @returns {string}
542
- */
543
- get_content_as_message_markdown() {
544
- let deferred1_0;
545
- let deferred1_1;
546
- try {
547
- const ret = wasm.composermodel_get_content_as_message_markdown(this.__wbg_ptr);
548
- deferred1_0 = ret[0];
549
- deferred1_1 = ret[1];
550
- return getStringFromWasm0(ret[0], ret[1]);
551
- } finally {
552
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
553
- }
554
- }
555
- /**
556
- * Creates an at-room mention node and inserts it into the composer, replacing the
557
- * text content defined by the suggestion
558
- * @param {SuggestionPattern} suggestion
559
- * @param {Map<any, any>} attributes
560
- * @returns {ComposerUpdate}
561
- */
562
- insert_at_room_mention_at_suggestion(suggestion, attributes) {
563
- _assertClass(suggestion, SuggestionPattern);
564
- const ret = wasm.composermodel_insert_at_room_mention_at_suggestion(this.__wbg_ptr, suggestion.__wbg_ptr, attributes);
565
- return ComposerUpdate.__wrap(ret);
566
- }
567
- /**
568
- * @returns {ComposerModel}
569
- */
570
- static new() {
571
- const ret = wasm.composermodel_new();
572
- return ComposerModel.__wrap(ret);
573
- }
574
- /**
575
- * @returns {ComposerUpdate}
576
- */
577
- bold() {
578
- const ret = wasm.composermodel_bold(this.__wbg_ptr);
579
- return ComposerUpdate.__wrap(ret);
580
- }
581
- /**
582
- * @returns {ComposerUpdate}
583
- */
584
- redo() {
585
- const ret = wasm.composermodel_redo(this.__wbg_ptr);
586
- return ComposerUpdate.__wrap(ret);
587
- }
588
- /**
589
- * @returns {ComposerUpdate}
590
- */
591
- undo() {
592
- const ret = wasm.composermodel_undo(this.__wbg_ptr);
593
- return ComposerUpdate.__wrap(ret);
594
- }
595
- /**
596
- * @returns {ComposerUpdate}
597
- */
598
- clear() {
599
- const ret = wasm.composermodel_clear(this.__wbg_ptr);
600
- return ComposerUpdate.__wrap(ret);
601
- }
602
- /**
603
- * @returns {ComposerUpdate}
604
- */
605
- enter() {
606
- const ret = wasm.composermodel_enter(this.__wbg_ptr);
607
- return ComposerUpdate.__wrap(ret);
608
- }
609
- /**
610
- * @returns {ComposerUpdate}
611
- */
612
- quote() {
613
- const ret = wasm.composermodel_quote(this.__wbg_ptr);
614
- return ComposerUpdate.__wrap(ret);
615
- }
616
- /**
617
- * @returns {ComposerUpdate}
618
- */
619
- delete() {
620
- const ret = wasm.composermodel_delete(this.__wbg_ptr);
621
- return ComposerUpdate.__wrap(ret);
622
- }
623
- /**
624
- * @returns {ComposerUpdate}
625
- */
626
- indent() {
627
- const ret = wasm.composermodel_indent(this.__wbg_ptr);
628
- return ComposerUpdate.__wrap(ret);
629
- }
630
- /**
631
- * @returns {ComposerUpdate}
632
- */
633
- italic() {
634
- const ret = wasm.composermodel_italic(this.__wbg_ptr);
635
- return ComposerUpdate.__wrap(ret);
636
- }
637
- /**
638
- * @param {number} start_utf16_codeunit
639
- * @param {number} end_utf16_codeunit
640
- * @returns {ComposerUpdate}
641
- */
642
- select(start_utf16_codeunit, end_utf16_codeunit) {
643
- const ret = wasm.composermodel_select(this.__wbg_ptr, start_utf16_codeunit, end_utf16_codeunit);
644
- return ComposerUpdate.__wrap(ret);
645
- }
646
- /**
647
- * @returns {DomHandle}
648
- */
649
- document() {
650
- const ret = wasm.composermodel_document(this.__wbg_ptr);
651
- return DomHandle.__wrap(ret);
652
- }
653
- /**
654
- * @param {string} url
655
- * @param {Map<any, any>} attributes
656
- * @returns {ComposerUpdate}
657
- */
658
- set_link(url, attributes) {
659
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
660
- const len0 = WASM_VECTOR_LEN;
661
- const ret = wasm.composermodel_set_link(this.__wbg_ptr, ptr0, len0, attributes);
662
- return ComposerUpdate.__wrap(ret);
663
- }
664
- /**
665
- * @returns {ComposerUpdate}
666
- */
667
- unindent() {
668
- const ret = wasm.composermodel_unindent(this.__wbg_ptr);
669
- return ComposerUpdate.__wrap(ret);
670
- }
671
- /**
672
- * @returns {ComposerUpdate}
673
- */
674
- backspace() {
675
- const ret = wasm.composermodel_backspace(this.__wbg_ptr);
676
- return ComposerUpdate.__wrap(ret);
677
- }
678
- /**
679
- * @returns {ComposerUpdate}
680
- */
681
- underline() {
682
- const ret = wasm.composermodel_underline(this.__wbg_ptr);
683
- return ComposerUpdate.__wrap(ret);
684
- }
685
- }
686
-
687
- const ComposerUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
688
- ? { register: () => {}, unregister: () => {} }
689
- : new FinalizationRegistry(ptr => wasm.__wbg_composerupdate_free(ptr >>> 0, 1));
690
-
691
- export class ComposerUpdate {
692
-
693
- static __wrap(ptr) {
694
- ptr = ptr >>> 0;
695
- const obj = Object.create(ComposerUpdate.prototype);
696
- obj.__wbg_ptr = ptr;
697
- ComposerUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
698
- return obj;
699
- }
700
-
701
- __destroy_into_raw() {
702
- const ptr = this.__wbg_ptr;
703
- this.__wbg_ptr = 0;
704
- ComposerUpdateFinalization.unregister(this);
705
- return ptr;
706
- }
707
-
708
- free() {
709
- const ptr = this.__destroy_into_raw();
710
- wasm.__wbg_composerupdate_free(ptr, 0);
711
- }
712
- /**
713
- * @returns {MenuState}
714
- */
715
- menu_state() {
716
- const ret = wasm.composerupdate_menu_state(this.__wbg_ptr);
717
- return MenuState.__wrap(ret);
718
- }
719
- /**
720
- * @returns {MenuAction}
721
- */
722
- menu_action() {
723
- const ret = wasm.composerupdate_menu_action(this.__wbg_ptr);
724
- return MenuAction.__wrap(ret);
725
- }
726
- /**
727
- * @returns {TextUpdate}
728
- */
729
- text_update() {
730
- const ret = wasm.composerupdate_text_update(this.__wbg_ptr);
731
- return TextUpdate.__wrap(ret);
732
- }
733
- }
734
-
735
- const CreateFinalization = (typeof FinalizationRegistry === 'undefined')
736
- ? { register: () => {}, unregister: () => {} }
737
- : new FinalizationRegistry(ptr => wasm.__wbg_create_free(ptr >>> 0, 1));
738
-
739
- export class Create {
740
-
741
- static __wrap(ptr) {
742
- ptr = ptr >>> 0;
743
- const obj = Object.create(Create.prototype);
744
- obj.__wbg_ptr = ptr;
745
- CreateFinalization.register(obj, obj.__wbg_ptr, obj);
746
- return obj;
747
- }
748
-
749
- __destroy_into_raw() {
750
- const ptr = this.__wbg_ptr;
751
- this.__wbg_ptr = 0;
752
- CreateFinalization.unregister(this);
753
- return ptr;
754
- }
755
-
756
- free() {
757
- const ptr = this.__destroy_into_raw();
758
- wasm.__wbg_create_free(ptr, 0);
759
- }
760
- }
761
-
762
- const CreateWithTextFinalization = (typeof FinalizationRegistry === 'undefined')
763
- ? { register: () => {}, unregister: () => {} }
764
- : new FinalizationRegistry(ptr => wasm.__wbg_createwithtext_free(ptr >>> 0, 1));
765
-
766
- export class CreateWithText {
767
-
768
- static __wrap(ptr) {
769
- ptr = ptr >>> 0;
770
- const obj = Object.create(CreateWithText.prototype);
771
- obj.__wbg_ptr = ptr;
772
- CreateWithTextFinalization.register(obj, obj.__wbg_ptr, obj);
773
- return obj;
774
- }
775
-
776
- __destroy_into_raw() {
777
- const ptr = this.__wbg_ptr;
778
- this.__wbg_ptr = 0;
779
- CreateWithTextFinalization.unregister(this);
780
- return ptr;
781
- }
782
-
783
- free() {
784
- const ptr = this.__destroy_into_raw();
785
- wasm.__wbg_createwithtext_free(ptr, 0);
786
- }
787
- }
788
-
789
- const DisabledFinalization = (typeof FinalizationRegistry === 'undefined')
790
- ? { register: () => {}, unregister: () => {} }
791
- : new FinalizationRegistry(ptr => wasm.__wbg_disabled_free(ptr >>> 0, 1));
792
-
793
- export class Disabled {
794
-
795
- static __wrap(ptr) {
796
- ptr = ptr >>> 0;
797
- const obj = Object.create(Disabled.prototype);
798
- obj.__wbg_ptr = ptr;
799
- DisabledFinalization.register(obj, obj.__wbg_ptr, obj);
800
- return obj;
801
- }
802
-
803
- __destroy_into_raw() {
804
- const ptr = this.__wbg_ptr;
805
- this.__wbg_ptr = 0;
806
- DisabledFinalization.unregister(this);
807
- return ptr;
808
- }
809
-
810
- free() {
811
- const ptr = this.__destroy_into_raw();
812
- wasm.__wbg_disabled_free(ptr, 0);
813
- }
814
- }
815
-
816
- const DomChildrenFinalization = (typeof FinalizationRegistry === 'undefined')
817
- ? { register: () => {}, unregister: () => {} }
818
- : new FinalizationRegistry(ptr => wasm.__wbg_domchildren_free(ptr >>> 0, 1));
819
- /**
820
- * An iterator-like view of a DomHandle's children, written to work around
821
- * the lack of support for returning Vec<T> in wasm_bindgen.
822
- */
823
- export class DomChildren {
824
-
825
- static __wrap(ptr) {
826
- ptr = ptr >>> 0;
827
- const obj = Object.create(DomChildren.prototype);
828
- obj.__wbg_ptr = ptr;
829
- DomChildrenFinalization.register(obj, obj.__wbg_ptr, obj);
830
- return obj;
831
- }
832
-
833
- __destroy_into_raw() {
834
- const ptr = this.__wbg_ptr;
835
- this.__wbg_ptr = 0;
836
- DomChildrenFinalization.unregister(this);
837
- return ptr;
838
- }
839
-
840
- free() {
841
- const ptr = this.__destroy_into_raw();
842
- wasm.__wbg_domchildren_free(ptr, 0);
843
- }
844
- /**
845
- * @returns {DomHandle | undefined}
846
- */
847
- next_child() {
848
- const ret = wasm.domchildren_next_child(this.__wbg_ptr);
849
- return ret === 0 ? undefined : DomHandle.__wrap(ret);
850
- }
851
- }
852
-
853
- const DomHandleFinalization = (typeof FinalizationRegistry === 'undefined')
854
- ? { register: () => {}, unregister: () => {} }
855
- : new FinalizationRegistry(ptr => wasm.__wbg_domhandle_free(ptr >>> 0, 1));
856
- /**
857
- * Refers to a node in the composer model.
858
- */
859
- export class DomHandle {
860
-
861
- static __wrap(ptr) {
862
- ptr = ptr >>> 0;
863
- const obj = Object.create(DomHandle.prototype);
864
- obj.__wbg_ptr = ptr;
865
- DomHandleFinalization.register(obj, obj.__wbg_ptr, obj);
866
- return obj;
867
- }
868
-
869
- __destroy_into_raw() {
870
- const ptr = this.__wbg_ptr;
871
- this.__wbg_ptr = 0;
872
- DomHandleFinalization.unregister(this);
873
- return ptr;
874
- }
875
-
876
- free() {
877
- const ptr = this.__destroy_into_raw();
878
- wasm.__wbg_domhandle_free(ptr, 0);
879
- }
880
- /**
881
- * Returns our tagname, or "-text-"/"-zwsp-" if we are a text/zwsp node.
882
- * Panics if we are not a valid reference (because the model has changed
883
- * since we were created, or because you passed in a different model
884
- * from the one that created us.)
885
- * @param {ComposerModel} model
886
- * @returns {string}
887
- */
888
- tag(model) {
889
- let deferred1_0;
890
- let deferred1_1;
891
- try {
892
- _assertClass(model, ComposerModel);
893
- const ret = wasm.domhandle_tag(this.__wbg_ptr, model.__wbg_ptr);
894
- deferred1_0 = ret[0];
895
- deferred1_1 = ret[1];
896
- return getStringFromWasm0(ret[0], ret[1]);
897
- } finally {
898
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
899
- }
900
- }
901
- /**
902
- * Returns the text of this node, or an empty string if this is a
903
- * container or line break.
904
- * Panics if we are not a valid reference (because the model has changed
905
- * since we were created, or because you passed in a different model
906
- * from the one that created us.)
907
- * @param {ComposerModel} model
908
- * @returns {string}
909
- */
910
- text(model) {
911
- let deferred1_0;
912
- let deferred1_1;
913
- try {
914
- _assertClass(model, ComposerModel);
915
- const ret = wasm.domhandle_text(this.__wbg_ptr, model.__wbg_ptr);
916
- deferred1_0 = ret[0];
917
- deferred1_1 = ret[1];
918
- return getStringFromWasm0(ret[0], ret[1]);
919
- } finally {
920
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
921
- }
922
- }
923
- /**
924
- * Returns a list of our children nodes, or an empty list if we refer
925
- * to a text or line break node.
926
- * Panics if we are not a valid reference (because the model has changed
927
- * since we were created, or because you passed in a different model
928
- * from the one that created us.)
929
- * @param {ComposerModel} model
930
- * @returns {DomChildren}
931
- */
932
- children(model) {
933
- _assertClass(model, ComposerModel);
934
- const ret = wasm.domhandle_children(this.__wbg_ptr, model.__wbg_ptr);
935
- return DomChildren.__wrap(ret);
936
- }
937
- /**
938
- * Returns "container", "line_break", "text" or "zwsp" depending on the type of
939
- * node we refer to.
940
- * Panics if we are not a valid reference (because the model has changed
941
- * since we were created, or because you passed in a different model
942
- * from the one that created us.)
943
- * @param {ComposerModel} model
944
- * @returns {string}
945
- */
946
- node_type(model) {
947
- let deferred1_0;
948
- let deferred1_1;
949
- try {
950
- _assertClass(model, ComposerModel);
951
- const ret = wasm.domhandle_node_type(this.__wbg_ptr, model.__wbg_ptr);
952
- deferred1_0 = ret[0];
953
- deferred1_1 = ret[1];
954
- return getStringFromWasm0(ret[0], ret[1]);
955
- } finally {
956
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
957
- }
958
- }
959
- }
960
-
961
- const EditFinalization = (typeof FinalizationRegistry === 'undefined')
962
- ? { register: () => {}, unregister: () => {} }
963
- : new FinalizationRegistry(ptr => wasm.__wbg_edit_free(ptr >>> 0, 1));
964
-
965
- export class Edit {
966
-
967
- static __wrap(ptr) {
968
- ptr = ptr >>> 0;
969
- const obj = Object.create(Edit.prototype);
970
- obj.__wbg_ptr = ptr;
971
- EditFinalization.register(obj, obj.__wbg_ptr, obj);
972
- return obj;
973
- }
974
-
975
- __destroy_into_raw() {
976
- const ptr = this.__wbg_ptr;
977
- this.__wbg_ptr = 0;
978
- EditFinalization.unregister(this);
979
- return ptr;
980
- }
981
-
982
- free() {
983
- const ptr = this.__destroy_into_raw();
984
- wasm.__wbg_edit_free(ptr, 0);
985
- }
986
- /**
987
- * @returns {string}
988
- */
989
- get url() {
990
- let deferred1_0;
991
- let deferred1_1;
992
- try {
993
- const ret = wasm.__wbg_get_edit_url(this.__wbg_ptr);
994
- deferred1_0 = ret[0];
995
- deferred1_1 = ret[1];
996
- return getStringFromWasm0(ret[0], ret[1]);
997
- } finally {
998
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
999
- }
1000
- }
1001
- /**
1002
- * @param {string} arg0
1003
- */
1004
- set url(arg0) {
1005
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1006
- const len0 = WASM_VECTOR_LEN;
1007
- wasm.__wbg_set_edit_url(this.__wbg_ptr, ptr0, len0);
1008
- }
1009
- }
1010
-
1011
- const KeepFinalization = (typeof FinalizationRegistry === 'undefined')
1012
- ? { register: () => {}, unregister: () => {} }
1013
- : new FinalizationRegistry(ptr => wasm.__wbg_keep_free(ptr >>> 0, 1));
1014
-
1015
- export class Keep {
1016
-
1017
- static __wrap(ptr) {
1018
- ptr = ptr >>> 0;
1019
- const obj = Object.create(Keep.prototype);
1020
- obj.__wbg_ptr = ptr;
1021
- KeepFinalization.register(obj, obj.__wbg_ptr, obj);
1022
- return obj;
1023
- }
1024
-
1025
- __destroy_into_raw() {
1026
- const ptr = this.__wbg_ptr;
1027
- this.__wbg_ptr = 0;
1028
- KeepFinalization.unregister(this);
1029
- return ptr;
1030
- }
1031
-
1032
- free() {
1033
- const ptr = this.__destroy_into_raw();
1034
- wasm.__wbg_keep_free(ptr, 0);
1035
- }
1036
- }
1037
-
1038
- const LinkActionFinalization = (typeof FinalizationRegistry === 'undefined')
1039
- ? { register: () => {}, unregister: () => {} }
1040
- : new FinalizationRegistry(ptr => wasm.__wbg_linkaction_free(ptr >>> 0, 1));
1041
-
1042
- export class LinkAction {
1043
-
1044
- static __wrap(ptr) {
1045
- ptr = ptr >>> 0;
1046
- const obj = Object.create(LinkAction.prototype);
1047
- obj.__wbg_ptr = ptr;
1048
- LinkActionFinalization.register(obj, obj.__wbg_ptr, obj);
1049
- return obj;
1050
- }
1051
-
1052
- __destroy_into_raw() {
1053
- const ptr = this.__wbg_ptr;
1054
- this.__wbg_ptr = 0;
1055
- LinkActionFinalization.unregister(this);
1056
- return ptr;
1057
- }
1058
-
1059
- free() {
1060
- const ptr = this.__destroy_into_raw();
1061
- wasm.__wbg_linkaction_free(ptr, 0);
1062
- }
1063
- /**
1064
- * @returns {CreateWithText | undefined}
1065
- */
1066
- get create_with_text() {
1067
- const ret = wasm.__wbg_get_linkaction_create_with_text(this.__wbg_ptr);
1068
- return ret === 0 ? undefined : CreateWithText.__wrap(ret);
1069
- }
1070
- /**
1071
- * @param {CreateWithText | null} [arg0]
1072
- */
1073
- set create_with_text(arg0) {
1074
- let ptr0 = 0;
1075
- if (!isLikeNone(arg0)) {
1076
- _assertClass(arg0, CreateWithText);
1077
- ptr0 = arg0.__destroy_into_raw();
1078
- }
1079
- wasm.__wbg_set_linkaction_create_with_text(this.__wbg_ptr, ptr0);
1080
- }
1081
- /**
1082
- * @returns {Create | undefined}
1083
- */
1084
- get create() {
1085
- const ret = wasm.__wbg_get_linkaction_create(this.__wbg_ptr);
1086
- return ret === 0 ? undefined : Create.__wrap(ret);
1087
- }
1088
- /**
1089
- * @param {Create | null} [arg0]
1090
- */
1091
- set create(arg0) {
1092
- let ptr0 = 0;
1093
- if (!isLikeNone(arg0)) {
1094
- _assertClass(arg0, Create);
1095
- ptr0 = arg0.__destroy_into_raw();
1096
- }
1097
- wasm.__wbg_set_linkaction_create(this.__wbg_ptr, ptr0);
1098
- }
1099
- /**
1100
- * @returns {Edit | undefined}
1101
- */
1102
- get edit_link() {
1103
- const ret = wasm.__wbg_get_linkaction_edit_link(this.__wbg_ptr);
1104
- return ret === 0 ? undefined : Edit.__wrap(ret);
1105
- }
1106
- /**
1107
- * @param {Edit | null} [arg0]
1108
- */
1109
- set edit_link(arg0) {
1110
- let ptr0 = 0;
1111
- if (!isLikeNone(arg0)) {
1112
- _assertClass(arg0, Edit);
1113
- ptr0 = arg0.__destroy_into_raw();
1114
- }
1115
- wasm.__wbg_set_linkaction_edit_link(this.__wbg_ptr, ptr0);
1116
- }
1117
- /**
1118
- * @returns {Disabled | undefined}
1119
- */
1120
- get disabled() {
1121
- const ret = wasm.__wbg_get_linkaction_disabled(this.__wbg_ptr);
1122
- return ret === 0 ? undefined : Disabled.__wrap(ret);
1123
- }
1124
- /**
1125
- * @param {Disabled | null} [arg0]
1126
- */
1127
- set disabled(arg0) {
1128
- let ptr0 = 0;
1129
- if (!isLikeNone(arg0)) {
1130
- _assertClass(arg0, Disabled);
1131
- ptr0 = arg0.__destroy_into_raw();
1132
- }
1133
- wasm.__wbg_set_linkaction_disabled(this.__wbg_ptr, ptr0);
1134
- }
1135
- }
1136
-
1137
- const MenuActionFinalization = (typeof FinalizationRegistry === 'undefined')
1138
- ? { register: () => {}, unregister: () => {} }
1139
- : new FinalizationRegistry(ptr => wasm.__wbg_menuaction_free(ptr >>> 0, 1));
1140
-
1141
- export class MenuAction {
1142
-
1143
- static __wrap(ptr) {
1144
- ptr = ptr >>> 0;
1145
- const obj = Object.create(MenuAction.prototype);
1146
- obj.__wbg_ptr = ptr;
1147
- MenuActionFinalization.register(obj, obj.__wbg_ptr, obj);
1148
- return obj;
1149
- }
1150
-
1151
- __destroy_into_raw() {
1152
- const ptr = this.__wbg_ptr;
1153
- this.__wbg_ptr = 0;
1154
- MenuActionFinalization.unregister(this);
1155
- return ptr;
1156
- }
1157
-
1158
- free() {
1159
- const ptr = this.__destroy_into_raw();
1160
- wasm.__wbg_menuaction_free(ptr, 0);
1161
- }
1162
- /**
1163
- * @returns {MenuActionSuggestion | undefined}
1164
- */
1165
- suggestion() {
1166
- const ret = wasm.menuaction_suggestion(this.__wbg_ptr);
1167
- return ret === 0 ? undefined : MenuActionSuggestion.__wrap(ret);
1168
- }
1169
- /**
1170
- * @returns {boolean}
1171
- */
1172
- keep() {
1173
- const ret = wasm.menuaction_keep(this.__wbg_ptr);
1174
- return ret !== 0;
1175
- }
1176
- /**
1177
- * @returns {boolean}
1178
- */
1179
- none() {
1180
- const ret = wasm.menuaction_none(this.__wbg_ptr);
1181
- return ret !== 0;
1182
- }
1183
- }
1184
-
1185
- const MenuActionSuggestionFinalization = (typeof FinalizationRegistry === 'undefined')
1186
- ? { register: () => {}, unregister: () => {} }
1187
- : new FinalizationRegistry(ptr => wasm.__wbg_menuactionsuggestion_free(ptr >>> 0, 1));
1188
-
1189
- export class MenuActionSuggestion {
1190
-
1191
- static __wrap(ptr) {
1192
- ptr = ptr >>> 0;
1193
- const obj = Object.create(MenuActionSuggestion.prototype);
1194
- obj.__wbg_ptr = ptr;
1195
- MenuActionSuggestionFinalization.register(obj, obj.__wbg_ptr, obj);
1196
- return obj;
1197
- }
1198
-
1199
- __destroy_into_raw() {
1200
- const ptr = this.__wbg_ptr;
1201
- this.__wbg_ptr = 0;
1202
- MenuActionSuggestionFinalization.unregister(this);
1203
- return ptr;
1204
- }
1205
-
1206
- free() {
1207
- const ptr = this.__destroy_into_raw();
1208
- wasm.__wbg_menuactionsuggestion_free(ptr, 0);
1209
- }
1210
- /**
1211
- * @returns {SuggestionPattern}
1212
- */
1213
- get suggestion_pattern() {
1214
- const ret = wasm.__wbg_get_menuactionsuggestion_suggestion_pattern(this.__wbg_ptr);
1215
- return SuggestionPattern.__wrap(ret);
1216
- }
1217
- /**
1218
- * @param {SuggestionPattern} arg0
1219
- */
1220
- set suggestion_pattern(arg0) {
1221
- _assertClass(arg0, SuggestionPattern);
1222
- var ptr0 = arg0.__destroy_into_raw();
1223
- wasm.__wbg_set_menuactionsuggestion_suggestion_pattern(this.__wbg_ptr, ptr0);
1224
- }
1225
- }
1226
-
1227
- const MenuStateFinalization = (typeof FinalizationRegistry === 'undefined')
1228
- ? { register: () => {}, unregister: () => {} }
1229
- : new FinalizationRegistry(ptr => wasm.__wbg_menustate_free(ptr >>> 0, 1));
1230
-
1231
- export class MenuState {
1232
-
1233
- static __wrap(ptr) {
1234
- ptr = ptr >>> 0;
1235
- const obj = Object.create(MenuState.prototype);
1236
- obj.__wbg_ptr = ptr;
1237
- MenuStateFinalization.register(obj, obj.__wbg_ptr, obj);
1238
- return obj;
1239
- }
1240
-
1241
- __destroy_into_raw() {
1242
- const ptr = this.__wbg_ptr;
1243
- this.__wbg_ptr = 0;
1244
- MenuStateFinalization.unregister(this);
1245
- return ptr;
1246
- }
1247
-
1248
- free() {
1249
- const ptr = this.__destroy_into_raw();
1250
- wasm.__wbg_menustate_free(ptr, 0);
1251
- }
1252
- /**
1253
- * @returns {boolean}
1254
- */
1255
- keep() {
1256
- const ret = wasm.menustate_keep(this.__wbg_ptr);
1257
- return ret !== 0;
1258
- }
1259
- /**
1260
- * @returns {MenuStateUpdate | undefined}
1261
- */
1262
- update() {
1263
- const ret = wasm.menustate_update(this.__wbg_ptr);
1264
- return ret === 0 ? undefined : MenuStateUpdate.__wrap(ret);
1265
- }
1266
- }
1267
-
1268
- const MenuStateUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
1269
- ? { register: () => {}, unregister: () => {} }
1270
- : new FinalizationRegistry(ptr => wasm.__wbg_menustateupdate_free(ptr >>> 0, 1));
1271
-
1272
- export class MenuStateUpdate {
1273
-
1274
- static __wrap(ptr) {
1275
- ptr = ptr >>> 0;
1276
- const obj = Object.create(MenuStateUpdate.prototype);
1277
- obj.__wbg_ptr = ptr;
1278
- MenuStateUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
1279
- return obj;
1280
- }
1281
-
1282
- __destroy_into_raw() {
1283
- const ptr = this.__wbg_ptr;
1284
- this.__wbg_ptr = 0;
1285
- MenuStateUpdateFinalization.unregister(this);
1286
- return ptr;
1287
- }
1288
-
1289
- free() {
1290
- const ptr = this.__destroy_into_raw();
1291
- wasm.__wbg_menustateupdate_free(ptr, 0);
1292
- }
1293
- /**
1294
- * @returns {Map<any, any>}
1295
- */
1296
- get action_states() {
1297
- const ret = wasm.__wbg_get_menustateupdate_action_states(this.__wbg_ptr);
1298
- return ret;
1299
- }
1300
- /**
1301
- * @param {Map<any, any>} arg0
1302
- */
1303
- set action_states(arg0) {
1304
- wasm.__wbg_set_menustateupdate_action_states(this.__wbg_ptr, arg0);
1305
- }
1306
- }
1307
-
1308
- const PatternKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1309
- ? { register: () => {}, unregister: () => {} }
1310
- : new FinalizationRegistry(ptr => wasm.__wbg_patternkey_free(ptr >>> 0, 1));
1311
-
1312
- export class PatternKey {
1313
-
1314
- static __wrap(ptr) {
1315
- ptr = ptr >>> 0;
1316
- const obj = Object.create(PatternKey.prototype);
1317
- obj.__wbg_ptr = ptr;
1318
- PatternKeyFinalization.register(obj, obj.__wbg_ptr, obj);
1319
- return obj;
1320
- }
1321
-
1322
- __destroy_into_raw() {
1323
- const ptr = this.__wbg_ptr;
1324
- this.__wbg_ptr = 0;
1325
- PatternKeyFinalization.unregister(this);
1326
- return ptr;
1327
- }
1328
-
1329
- free() {
1330
- const ptr = this.__destroy_into_raw();
1331
- wasm.__wbg_patternkey_free(ptr, 0);
1332
- }
1333
- /**
1334
- * @returns {PatternKeyType}
1335
- */
1336
- get key_type() {
1337
- const ret = wasm.__wbg_get_patternkey_key_type(this.__wbg_ptr);
1338
- return ret;
1339
- }
1340
- /**
1341
- * @param {PatternKeyType} arg0
1342
- */
1343
- set key_type(arg0) {
1344
- wasm.__wbg_set_patternkey_key_type(this.__wbg_ptr, arg0);
1345
- }
1346
- /**
1347
- * @returns {string | undefined}
1348
- */
1349
- get custom_key_value() {
1350
- const ret = wasm.__wbg_get_patternkey_custom_key_value(this.__wbg_ptr);
1351
- let v1;
1352
- if (ret[0] !== 0) {
1353
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1354
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1355
- }
1356
- return v1;
1357
- }
1358
- /**
1359
- * @param {string | null} [arg0]
1360
- */
1361
- set custom_key_value(arg0) {
1362
- var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1363
- var len0 = WASM_VECTOR_LEN;
1364
- wasm.__wbg_set_patternkey_custom_key_value(this.__wbg_ptr, ptr0, len0);
1365
- }
1366
- }
1367
-
1368
- const ReplaceAllFinalization = (typeof FinalizationRegistry === 'undefined')
1369
- ? { register: () => {}, unregister: () => {} }
1370
- : new FinalizationRegistry(ptr => wasm.__wbg_replaceall_free(ptr >>> 0, 1));
1371
-
1372
- export class ReplaceAll {
1373
-
1374
- static __wrap(ptr) {
1375
- ptr = ptr >>> 0;
1376
- const obj = Object.create(ReplaceAll.prototype);
1377
- obj.__wbg_ptr = ptr;
1378
- ReplaceAllFinalization.register(obj, obj.__wbg_ptr, obj);
1379
- return obj;
1380
- }
1381
-
1382
- __destroy_into_raw() {
1383
- const ptr = this.__wbg_ptr;
1384
- this.__wbg_ptr = 0;
1385
- ReplaceAllFinalization.unregister(this);
1386
- return ptr;
1387
- }
1388
-
1389
- free() {
1390
- const ptr = this.__destroy_into_raw();
1391
- wasm.__wbg_replaceall_free(ptr, 0);
1392
- }
1393
- /**
1394
- * @returns {string}
1395
- */
1396
- get replacement_html() {
1397
- let deferred1_0;
1398
- let deferred1_1;
1399
- try {
1400
- const ret = wasm.__wbg_get_replaceall_replacement_html(this.__wbg_ptr);
1401
- deferred1_0 = ret[0];
1402
- deferred1_1 = ret[1];
1403
- return getStringFromWasm0(ret[0], ret[1]);
1404
- } finally {
1405
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1406
- }
1407
- }
1408
- /**
1409
- * @param {string} arg0
1410
- */
1411
- set replacement_html(arg0) {
1412
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1413
- const len0 = WASM_VECTOR_LEN;
1414
- wasm.__wbg_set_edit_url(this.__wbg_ptr, ptr0, len0);
1415
- }
1416
- /**
1417
- * @returns {number}
1418
- */
1419
- get start_utf16_codeunit() {
1420
- const ret = wasm.__wbg_get_replaceall_start_utf16_codeunit(this.__wbg_ptr);
1421
- return ret >>> 0;
1422
- }
1423
- /**
1424
- * @param {number} arg0
1425
- */
1426
- set start_utf16_codeunit(arg0) {
1427
- wasm.__wbg_set_replaceall_start_utf16_codeunit(this.__wbg_ptr, arg0);
1428
- }
1429
- /**
1430
- * @returns {number}
1431
- */
1432
- get end_utf16_codeunit() {
1433
- const ret = wasm.__wbg_get_replaceall_end_utf16_codeunit(this.__wbg_ptr);
1434
- return ret >>> 0;
1435
- }
1436
- /**
1437
- * @param {number} arg0
1438
- */
1439
- set end_utf16_codeunit(arg0) {
1440
- wasm.__wbg_set_replaceall_end_utf16_codeunit(this.__wbg_ptr, arg0);
1441
- }
1442
- }
1443
-
1444
- const SelectionFinalization = (typeof FinalizationRegistry === 'undefined')
1445
- ? { register: () => {}, unregister: () => {} }
1446
- : new FinalizationRegistry(ptr => wasm.__wbg_selection_free(ptr >>> 0, 1));
1447
-
1448
- export class Selection {
1449
-
1450
- static __wrap(ptr) {
1451
- ptr = ptr >>> 0;
1452
- const obj = Object.create(Selection.prototype);
1453
- obj.__wbg_ptr = ptr;
1454
- SelectionFinalization.register(obj, obj.__wbg_ptr, obj);
1455
- return obj;
1456
- }
1457
-
1458
- __destroy_into_raw() {
1459
- const ptr = this.__wbg_ptr;
1460
- this.__wbg_ptr = 0;
1461
- SelectionFinalization.unregister(this);
1462
- return ptr;
1463
- }
1464
-
1465
- free() {
1466
- const ptr = this.__destroy_into_raw();
1467
- wasm.__wbg_selection_free(ptr, 0);
1468
- }
1469
- /**
1470
- * @returns {number}
1471
- */
1472
- get start_utf16_codeunit() {
1473
- const ret = wasm.__wbg_get_selection_start_utf16_codeunit(this.__wbg_ptr);
1474
- return ret >>> 0;
1475
- }
1476
- /**
1477
- * @param {number} arg0
1478
- */
1479
- set start_utf16_codeunit(arg0) {
1480
- wasm.__wbg_set_selection_start_utf16_codeunit(this.__wbg_ptr, arg0);
1481
- }
1482
- /**
1483
- * @returns {number}
1484
- */
1485
- get end_utf16_codeunit() {
1486
- const ret = wasm.__wbg_get_selection_end_utf16_codeunit(this.__wbg_ptr);
1487
- return ret >>> 0;
1488
- }
1489
- /**
1490
- * @param {number} arg0
1491
- */
1492
- set end_utf16_codeunit(arg0) {
1493
- wasm.__wbg_set_selection_end_utf16_codeunit(this.__wbg_ptr, arg0);
1494
- }
1495
- }
1496
-
1497
- const SuggestionPatternFinalization = (typeof FinalizationRegistry === 'undefined')
1498
- ? { register: () => {}, unregister: () => {} }
1499
- : new FinalizationRegistry(ptr => wasm.__wbg_suggestionpattern_free(ptr >>> 0, 1));
1500
-
1501
- export class SuggestionPattern {
1502
-
1503
- static __wrap(ptr) {
1504
- ptr = ptr >>> 0;
1505
- const obj = Object.create(SuggestionPattern.prototype);
1506
- obj.__wbg_ptr = ptr;
1507
- SuggestionPatternFinalization.register(obj, obj.__wbg_ptr, obj);
1508
- return obj;
1509
- }
1510
-
1511
- __destroy_into_raw() {
1512
- const ptr = this.__wbg_ptr;
1513
- this.__wbg_ptr = 0;
1514
- SuggestionPatternFinalization.unregister(this);
1515
- return ptr;
1516
- }
1517
-
1518
- free() {
1519
- const ptr = this.__destroy_into_raw();
1520
- wasm.__wbg_suggestionpattern_free(ptr, 0);
1521
- }
1522
- /**
1523
- * @returns {PatternKey}
1524
- */
1525
- get key() {
1526
- const ret = wasm.__wbg_get_suggestionpattern_key(this.__wbg_ptr);
1527
- return PatternKey.__wrap(ret);
1528
- }
1529
- /**
1530
- * @param {PatternKey} arg0
1531
- */
1532
- set key(arg0) {
1533
- _assertClass(arg0, PatternKey);
1534
- var ptr0 = arg0.__destroy_into_raw();
1535
- wasm.__wbg_set_suggestionpattern_key(this.__wbg_ptr, ptr0);
1536
- }
1537
- /**
1538
- * @returns {string}
1539
- */
1540
- get text() {
1541
- let deferred1_0;
1542
- let deferred1_1;
1543
- try {
1544
- const ret = wasm.__wbg_get_suggestionpattern_text(this.__wbg_ptr);
1545
- deferred1_0 = ret[0];
1546
- deferred1_1 = ret[1];
1547
- return getStringFromWasm0(ret[0], ret[1]);
1548
- } finally {
1549
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1550
- }
1551
- }
1552
- /**
1553
- * @param {string} arg0
1554
- */
1555
- set text(arg0) {
1556
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1557
- const len0 = WASM_VECTOR_LEN;
1558
- wasm.__wbg_set_edit_url(this.__wbg_ptr, ptr0, len0);
1559
- }
1560
- /**
1561
- * @returns {number}
1562
- */
1563
- get start() {
1564
- const ret = wasm.__wbg_get_suggestionpattern_start(this.__wbg_ptr);
1565
- return ret >>> 0;
1566
- }
1567
- /**
1568
- * @param {number} arg0
1569
- */
1570
- set start(arg0) {
1571
- wasm.__wbg_set_suggestionpattern_start(this.__wbg_ptr, arg0);
1572
- }
1573
- /**
1574
- * @returns {number}
1575
- */
1576
- get end() {
1577
- const ret = wasm.__wbg_get_suggestionpattern_end(this.__wbg_ptr);
1578
- return ret >>> 0;
1579
- }
1580
- /**
1581
- * @param {number} arg0
1582
- */
1583
- set end(arg0) {
1584
- wasm.__wbg_set_suggestionpattern_end(this.__wbg_ptr, arg0);
1585
- }
1586
- }
1587
-
1588
- const TextUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
1589
- ? { register: () => {}, unregister: () => {} }
1590
- : new FinalizationRegistry(ptr => wasm.__wbg_textupdate_free(ptr >>> 0, 1));
1591
-
1592
- export class TextUpdate {
1593
-
1594
- static __wrap(ptr) {
1595
- ptr = ptr >>> 0;
1596
- const obj = Object.create(TextUpdate.prototype);
1597
- obj.__wbg_ptr = ptr;
1598
- TextUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
1599
- return obj;
1600
- }
1601
-
1602
- __destroy_into_raw() {
1603
- const ptr = this.__wbg_ptr;
1604
- this.__wbg_ptr = 0;
1605
- TextUpdateFinalization.unregister(this);
1606
- return ptr;
1607
- }
1608
-
1609
- free() {
1610
- const ptr = this.__destroy_into_raw();
1611
- wasm.__wbg_textupdate_free(ptr, 0);
1612
- }
1613
- /**
1614
- * @returns {Keep | undefined}
1615
- */
1616
- get keep() {
1617
- const ret = wasm.__wbg_get_textupdate_keep(this.__wbg_ptr);
1618
- return ret === 0 ? undefined : Keep.__wrap(ret);
1619
- }
1620
- /**
1621
- * @param {Keep | null} [arg0]
1622
- */
1623
- set keep(arg0) {
1624
- let ptr0 = 0;
1625
- if (!isLikeNone(arg0)) {
1626
- _assertClass(arg0, Keep);
1627
- ptr0 = arg0.__destroy_into_raw();
1628
- }
1629
- wasm.__wbg_set_textupdate_keep(this.__wbg_ptr, ptr0);
1630
- }
1631
- /**
1632
- * @returns {ReplaceAll | undefined}
1633
- */
1634
- get replace_all() {
1635
- const ret = wasm.__wbg_get_textupdate_replace_all(this.__wbg_ptr);
1636
- return ret === 0 ? undefined : ReplaceAll.__wrap(ret);
1637
- }
1638
- /**
1639
- * @param {ReplaceAll | null} [arg0]
1640
- */
1641
- set replace_all(arg0) {
1642
- let ptr0 = 0;
1643
- if (!isLikeNone(arg0)) {
1644
- _assertClass(arg0, ReplaceAll);
1645
- ptr0 = arg0.__destroy_into_raw();
1646
- }
1647
- wasm.__wbg_set_textupdate_replace_all(this.__wbg_ptr, ptr0);
1648
- }
1649
- /**
1650
- * @returns {Selection | undefined}
1651
- */
1652
- get select() {
1653
- const ret = wasm.__wbg_get_textupdate_select(this.__wbg_ptr);
1654
- return ret === 0 ? undefined : Selection.__wrap(ret);
1655
- }
1656
- /**
1657
- * @param {Selection | null} [arg0]
1658
- */
1659
- set select(arg0) {
1660
- let ptr0 = 0;
1661
- if (!isLikeNone(arg0)) {
1662
- _assertClass(arg0, Selection);
1663
- ptr0 = arg0.__destroy_into_raw();
1664
- }
1665
- wasm.__wbg_set_textupdate_select(this.__wbg_ptr, ptr0);
1666
- }
1667
- }
1668
-
1669
- export function __wbg_body_942ea927546a04ba(arg0) {
1670
- const ret = arg0.body;
1671
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1672
- };
1673
-
1674
- export function __wbg_childNodes_c4423003f3a9441f(arg0) {
1675
- const ret = arg0.childNodes;
1676
- return ret;
1677
- };
1678
-
1679
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
1680
- let deferred0_0;
1681
- let deferred0_1;
1682
- try {
1683
- deferred0_0 = arg0;
1684
- deferred0_1 = arg1;
1685
- console.error(getStringFromWasm0(arg0, arg1));
1686
- } finally {
1687
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1688
- }
1689
- };
1690
-
1691
- export function __wbg_forEach_d6a05ca96422eff9(arg0, arg1, arg2) {
1692
- try {
1693
- var state0 = {a: arg1, b: arg2};
1694
- var cb0 = (arg0, arg1, arg2) => {
1695
- const a = state0.a;
1696
- state0.a = 0;
1697
- try {
1698
- return __wbg_adapter_131(a, state0.b, arg0, arg1, arg2);
1699
- } finally {
1700
- state0.a = a;
1701
- }
1702
- };
1703
- arg0.forEach(cb0);
1704
- } finally {
1705
- state0.a = state0.b = 0;
1706
- }
1707
- };
1708
-
1709
- export function __wbg_forEach_e1cf6f7c8ecb7dae(arg0, arg1, arg2) {
1710
- try {
1711
- var state0 = {a: arg1, b: arg2};
1712
- var cb0 = (arg0, arg1) => {
1713
- const a = state0.a;
1714
- state0.a = 0;
1715
- try {
1716
- return __wbg_adapter_124(a, state0.b, arg0, arg1);
1717
- } finally {
1718
- state0.a = a;
1719
- }
1720
- };
1721
- arg0.forEach(cb0);
1722
- } finally {
1723
- state0.a = state0.b = 0;
1724
- }
1725
- };
1726
-
1727
- export function __wbg_getAttribute_ea5166be2deba45e(arg0, arg1, arg2, arg3) {
1728
- const ret = arg1.getAttribute(getStringFromWasm0(arg2, arg3));
1729
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1730
- var len1 = WASM_VECTOR_LEN;
1731
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1732
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1733
- };
1734
-
1735
- export function __wbg_getPropertyValue_e623c23a05dfb30c() { return handleError(function (arg0, arg1, arg2, arg3) {
1736
- const ret = arg1.getPropertyValue(getStringFromWasm0(arg2, arg3));
1737
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1738
- const len1 = WASM_VECTOR_LEN;
1739
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1740
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1741
- }, arguments) };
1742
-
1743
- export function __wbg_get_e27dfaeb6f46bd45(arg0, arg1) {
1744
- const ret = arg0[arg1 >>> 0];
1745
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1746
- };
1747
-
1748
- export function __wbg_hasAttribute_db31090c2e646f57(arg0, arg1, arg2) {
1749
- const ret = arg0.hasAttribute(getStringFromWasm0(arg1, arg2));
1750
- return ret;
1751
- };
1752
-
1753
- export function __wbg_length_49b2ba67f0897e97(arg0) {
1754
- const ret = arg0.length;
1755
- return ret;
1756
- };
1757
-
1758
- export function __wbg_new_363ae9575a2aba54() { return handleError(function () {
1759
- const ret = new DOMParser();
1760
- return ret;
1761
- }, arguments) };
1762
-
1763
- export function __wbg_new_5e0be73521bc8c17() {
1764
- const ret = new Map();
1765
- return ret;
1766
- };
1767
-
1768
- export function __wbg_new_8a6f238a6ece86ea() {
1769
- const ret = new Error();
1770
- return ret;
1771
- };
1772
-
1773
- export function __wbg_nodeName_ff3aa439a5af6311(arg0, arg1) {
1774
- const ret = arg1.nodeName;
1775
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1776
- const len1 = WASM_VECTOR_LEN;
1777
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1778
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1779
- };
1780
-
1781
- export function __wbg_nodeType_5e1153141daac26a(arg0) {
1782
- const ret = arg0.nodeType;
1783
- return ret;
1784
- };
1785
-
1786
- export function __wbg_nodeValue_6ff4f14870c43bd9(arg0, arg1) {
1787
- const ret = arg1.nodeValue;
1788
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1789
- var len1 = WASM_VECTOR_LEN;
1790
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1791
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1792
- };
1793
-
1794
- export function __wbg_parseFromString_91cbec9ba27a222a() { return handleError(function (arg0, arg1, arg2, arg3) {
1795
- const ret = arg0.parseFromString(getStringFromWasm0(arg1, arg2), __wbindgen_enum_SupportedType[arg3]);
1796
- return ret;
1797
- }, arguments) };
1798
-
1799
- export function __wbg_set_8fc6bf8a5b1071d1(arg0, arg1, arg2) {
1800
- const ret = arg0.set(arg1, arg2);
1801
- return ret;
1802
- };
1803
-
1804
- export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
1805
- const ret = arg1.stack;
1806
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1807
- const len1 = WASM_VECTOR_LEN;
1808
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1809
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1810
- };
1811
-
1812
- export function __wbg_style_fb30c14e5815805c(arg0) {
1813
- const ret = arg0.style;
1814
- return ret;
1815
- };
1816
-
1817
- export function __wbindgen_init_externref_table() {
1818
- const table = wasm.__wbindgen_export_1;
1819
- const offset = table.grow(4);
1820
- table.set(0, undefined);
1821
- table.set(offset + 0, undefined);
1822
- table.set(offset + 1, null);
1823
- table.set(offset + 2, true);
1824
- table.set(offset + 3, false);
1825
- ;
1826
- };
1827
-
1828
- export function __wbindgen_number_new(arg0) {
1829
- const ret = arg0;
1830
- return ret;
1831
- };
1832
-
1833
- export function __wbindgen_string_get(arg0, arg1) {
1834
- const obj = arg1;
1835
- const ret = typeof(obj) === 'string' ? obj : undefined;
1836
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1837
- var len1 = WASM_VECTOR_LEN;
1838
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1839
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1840
- };
1841
-
1842
- export function __wbindgen_string_new(arg0, arg1) {
1843
- const ret = getStringFromWasm0(arg0, arg1);
1844
- return ret;
1845
- };
1846
-
1847
- export function __wbindgen_throw(arg0, arg1) {
1848
- throw new Error(getStringFromWasm0(arg0, arg1));
1849
- };
1850
-