@lynx-js/web-core-wasm-canary 0.0.1-canary-20260119-82b4052d → 0.0.1-canary-20260119-609be14f
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/CHANGELOG.md +2 -2
- package/binary/client/client.d.ts +225 -216
- package/binary/client/client.js +781 -813
- package/binary/client/client_bg.wasm +0 -0
- package/binary/client/client_debug.d.ts +225 -216
- package/binary/client/client_debug.js +808 -840
- package/binary/client/client_debug_bg.wasm +0 -0
- package/binary/client/client_debug_bg.wasm.d.ts +30 -30
- package/binary/encode/encode.d.ts +134 -124
- package/binary/encode/encode.js +714 -10
- package/binary/encode/encode_bg.wasm +0 -0
- package/binary/encode/encode_debug.d.ts +134 -124
- package/binary/encode/encode_debug.js +786 -10
- package/binary/encode/encode_debug_bg.wasm +0 -0
- package/binary/encode/encode_debug_bg.wasm.d.ts +12 -12
- package/dist/client_prod/static/js/async/web-core-template-loader-thread.js +4 -4
- package/dist/client_prod/static/js/client.js +2 -2
- package/dist/client_prod/static/wasm/{7ff75609.module.wasm → 3d7e607b.module.wasm} +0 -0
- package/package.json +2 -2
- package/binary/encode/encode_bg.js +0 -749
- package/binary/encode/encode_debug_bg.js +0 -822
package/binary/encode/encode.js
CHANGED
|
@@ -1,17 +1,721 @@
|
|
|
1
|
+
/* @ts-self-types="./encode.d.ts" */
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export class DecodedStyleData {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
DecodedStyleDataFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_decodedstyledata_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {Uint8Array} buffer
|
|
16
|
+
* @param {string | null | undefined} entry_name
|
|
17
|
+
* @param {boolean} config_enable_css_selector
|
|
18
|
+
* @returns {Uint8Array}
|
|
19
|
+
*/
|
|
20
|
+
static decode_into(buffer, entry_name, config_enable_css_selector) {
|
|
21
|
+
var ptr0 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
22
|
+
var len0 = WASM_VECTOR_LEN;
|
|
23
|
+
const ret = wasm.decodedstyledata_decode_into(buffer, ptr0, len0, config_enable_css_selector);
|
|
24
|
+
if (ret[2]) {
|
|
25
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
26
|
+
}
|
|
27
|
+
return takeFromExternrefTable0(ret[0]);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @param {RawStyleInfo} raw_style_info
|
|
31
|
+
* @param {boolean} config_enable_css_selector
|
|
32
|
+
* @param {string | null} [entry_name]
|
|
33
|
+
* @returns {Uint8Array}
|
|
34
|
+
*/
|
|
35
|
+
static encode_from_raw_style_info(raw_style_info, config_enable_css_selector, entry_name) {
|
|
36
|
+
_assertClass(raw_style_info, RawStyleInfo);
|
|
37
|
+
var ptr0 = raw_style_info.__destroy_into_raw();
|
|
38
|
+
var ptr1 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
39
|
+
var len1 = WASM_VECTOR_LEN;
|
|
40
|
+
const ret = wasm.decodedstyledata_encode_from_raw_style_info(ptr0, config_enable_css_selector, ptr1, len1);
|
|
41
|
+
if (ret[2]) {
|
|
42
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
43
|
+
}
|
|
44
|
+
return takeFromExternrefTable0(ret[0]);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @returns {string}
|
|
48
|
+
*/
|
|
49
|
+
get font_face_content() {
|
|
50
|
+
let deferred1_0;
|
|
51
|
+
let deferred1_1;
|
|
52
|
+
try {
|
|
53
|
+
const ret = wasm.decodedstyledata_font_face_content(this.__wbg_ptr);
|
|
54
|
+
deferred1_0 = ret[0];
|
|
55
|
+
deferred1_1 = ret[1];
|
|
56
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
57
|
+
} finally {
|
|
58
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @param {Uint8Array} buffer
|
|
63
|
+
*/
|
|
64
|
+
constructor(buffer) {
|
|
65
|
+
const ret = wasm.decodedstyledata_new(buffer);
|
|
66
|
+
if (ret[2]) {
|
|
67
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
68
|
+
}
|
|
69
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
70
|
+
DecodedStyleDataFinalization.register(this, this.__wbg_ptr, this);
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @param {number} css_id
|
|
75
|
+
* @param {string[]} class_name
|
|
76
|
+
* @returns {string}
|
|
77
|
+
*/
|
|
78
|
+
query_css_og_declarations_by_css_id(css_id, class_name) {
|
|
79
|
+
let deferred2_0;
|
|
80
|
+
let deferred2_1;
|
|
81
|
+
try {
|
|
82
|
+
const ptr0 = passArrayJsValueToWasm0(class_name, wasm.__wbindgen_malloc);
|
|
83
|
+
const len0 = WASM_VECTOR_LEN;
|
|
84
|
+
const ret = wasm.decodedstyledata_query_css_og_declarations_by_css_id(this.__wbg_ptr, css_id, ptr0, len0);
|
|
85
|
+
deferred2_0 = ret[0];
|
|
86
|
+
deferred2_1 = ret[1];
|
|
87
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
88
|
+
} finally {
|
|
89
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @returns {string}
|
|
94
|
+
*/
|
|
95
|
+
get style_content() {
|
|
96
|
+
let deferred1_0;
|
|
97
|
+
let deferred1_1;
|
|
98
|
+
try {
|
|
99
|
+
const ret = wasm.decodedstyledata_style_content(this.__wbg_ptr);
|
|
100
|
+
deferred1_0 = ret[0];
|
|
101
|
+
deferred1_1 = ret[1];
|
|
102
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
103
|
+
} finally {
|
|
104
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (Symbol.dispose) DecodedStyleData.prototype[Symbol.dispose] = DecodedStyleData.prototype.free;
|
|
5
109
|
|
|
6
|
-
|
|
110
|
+
export class ElementTemplateSection {
|
|
111
|
+
static __wrap(ptr) {
|
|
112
|
+
ptr = ptr >>> 0;
|
|
113
|
+
const obj = Object.create(ElementTemplateSection.prototype);
|
|
114
|
+
obj.__wbg_ptr = ptr;
|
|
115
|
+
ElementTemplateSectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
116
|
+
return obj;
|
|
117
|
+
}
|
|
118
|
+
__destroy_into_raw() {
|
|
119
|
+
const ptr = this.__wbg_ptr;
|
|
120
|
+
this.__wbg_ptr = 0;
|
|
121
|
+
ElementTemplateSectionFinalization.unregister(this);
|
|
122
|
+
return ptr;
|
|
123
|
+
}
|
|
124
|
+
free() {
|
|
125
|
+
const ptr = this.__destroy_into_raw();
|
|
126
|
+
wasm.__wbg_elementtemplatesection_free(ptr, 0);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @param {string} id
|
|
130
|
+
* @param {RawElementTemplate} raw_element_template
|
|
131
|
+
*/
|
|
132
|
+
add_element_template(id, raw_element_template) {
|
|
133
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
134
|
+
const len0 = WASM_VECTOR_LEN;
|
|
135
|
+
_assertClass(raw_element_template, RawElementTemplate);
|
|
136
|
+
var ptr1 = raw_element_template.__destroy_into_raw();
|
|
137
|
+
wasm.elementtemplatesection_add_element_template(this.__wbg_ptr, ptr0, len0, ptr1);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @returns {Uint8Array}
|
|
141
|
+
*/
|
|
142
|
+
encode() {
|
|
143
|
+
const ret = wasm.elementtemplatesection_encode(this.__wbg_ptr);
|
|
144
|
+
return ret;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @param {Uint8Array} buffer
|
|
148
|
+
* @returns {ElementTemplateSection}
|
|
149
|
+
*/
|
|
150
|
+
static from_encoded(buffer) {
|
|
151
|
+
const ret = wasm.elementtemplatesection_from_encoded(buffer);
|
|
152
|
+
if (ret[2]) {
|
|
153
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
154
|
+
}
|
|
155
|
+
return ElementTemplateSection.__wrap(ret[0]);
|
|
156
|
+
}
|
|
157
|
+
constructor() {
|
|
158
|
+
const ret = wasm.elementtemplatesection_new();
|
|
159
|
+
this.__wbg_ptr = ret >>> 0;
|
|
160
|
+
ElementTemplateSectionFinalization.register(this, this.__wbg_ptr, this);
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (Symbol.dispose) ElementTemplateSection.prototype[Symbol.dispose] = ElementTemplateSection.prototype.free;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @enum {1 | 3 | 5 | 6 | 7 | 8 | 10 | 11 | 12}
|
|
168
|
+
*/
|
|
169
|
+
export const LEOAsmOpcode = Object.freeze({
|
|
170
|
+
SetAttribute: 1, "1": "SetAttribute",
|
|
171
|
+
RemoveChild: 3, "3": "RemoveChild",
|
|
172
|
+
AppendChild: 5, "5": "AppendChild",
|
|
173
|
+
CreateElement: 6, "6": "CreateElement",
|
|
174
|
+
SetAttributeSlot: 7, "7": "SetAttributeSlot",
|
|
175
|
+
AppendElementSlot: 8, "8": "AppendElementSlot",
|
|
176
|
+
SetDataset: 10, "10": "SetDataset",
|
|
177
|
+
AddEvent: 11, "11": "AddEvent",
|
|
178
|
+
AppendToRoot: 12, "12": "AppendToRoot",
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
export class Operation {
|
|
182
|
+
__destroy_into_raw() {
|
|
183
|
+
const ptr = this.__wbg_ptr;
|
|
184
|
+
this.__wbg_ptr = 0;
|
|
185
|
+
OperationFinalization.unregister(this);
|
|
186
|
+
return ptr;
|
|
187
|
+
}
|
|
188
|
+
free() {
|
|
189
|
+
const ptr = this.__destroy_into_raw();
|
|
190
|
+
wasm.__wbg_operation_free(ptr, 0);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (Symbol.dispose) Operation.prototype[Symbol.dispose] = Operation.prototype.free;
|
|
194
|
+
|
|
195
|
+
export class RawElementTemplate {
|
|
196
|
+
__destroy_into_raw() {
|
|
197
|
+
const ptr = this.__wbg_ptr;
|
|
198
|
+
this.__wbg_ptr = 0;
|
|
199
|
+
RawElementTemplateFinalization.unregister(this);
|
|
200
|
+
return ptr;
|
|
201
|
+
}
|
|
202
|
+
free() {
|
|
203
|
+
const ptr = this.__destroy_into_raw();
|
|
204
|
+
wasm.__wbg_rawelementtemplate_free(ptr, 0);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @param {number} parent_element_id
|
|
208
|
+
* @param {number} child_element_id
|
|
209
|
+
*/
|
|
210
|
+
append_child(parent_element_id, child_element_id) {
|
|
211
|
+
wasm.rawelementtemplate_append_child(this.__wbg_ptr, parent_element_id, child_element_id);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @param {number} parent_element_id
|
|
215
|
+
* @param {number} child_element_slot_id
|
|
216
|
+
*/
|
|
217
|
+
append_element_slot(parent_element_id, child_element_slot_id) {
|
|
218
|
+
wasm.rawelementtemplate_append_element_slot(this.__wbg_ptr, parent_element_id, child_element_slot_id);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @param {number} element_id
|
|
222
|
+
*/
|
|
223
|
+
append_to_root(element_id) {
|
|
224
|
+
wasm.rawelementtemplate_append_to_root(this.__wbg_ptr, element_id);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @param {string} tag_names
|
|
228
|
+
* @param {number} element_id
|
|
229
|
+
*/
|
|
230
|
+
create_element(tag_names, element_id) {
|
|
231
|
+
const ptr0 = passStringToWasm0(tag_names, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
232
|
+
const len0 = WASM_VECTOR_LEN;
|
|
233
|
+
wasm.rawelementtemplate_create_element(this.__wbg_ptr, ptr0, len0, element_id);
|
|
234
|
+
}
|
|
235
|
+
constructor() {
|
|
236
|
+
const ret = wasm.rawelementtemplate_new();
|
|
237
|
+
this.__wbg_ptr = ret >>> 0;
|
|
238
|
+
RawElementTemplateFinalization.register(this, this.__wbg_ptr, this);
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* @param {number} element_id
|
|
243
|
+
* @param {string} attr_name
|
|
244
|
+
* @param {string} attr_value
|
|
245
|
+
*/
|
|
246
|
+
set_attribute(element_id, attr_name, attr_value) {
|
|
247
|
+
const ptr0 = passStringToWasm0(attr_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
248
|
+
const len0 = WASM_VECTOR_LEN;
|
|
249
|
+
const ptr1 = passStringToWasm0(attr_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
250
|
+
const len1 = WASM_VECTOR_LEN;
|
|
251
|
+
wasm.rawelementtemplate_set_attribute(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* @param {number} element_id
|
|
255
|
+
* @param {number} attribute_slot_id
|
|
256
|
+
* @param {string} attr_name
|
|
257
|
+
*/
|
|
258
|
+
set_attribute_slot(element_id, attribute_slot_id, attr_name) {
|
|
259
|
+
const ptr0 = passStringToWasm0(attr_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
+
const len0 = WASM_VECTOR_LEN;
|
|
261
|
+
wasm.rawelementtemplate_set_attribute_slot(this.__wbg_ptr, element_id, attribute_slot_id, ptr0, len0);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* @param {number} element_id
|
|
265
|
+
* @param {string} event_type
|
|
266
|
+
* @param {string} event_name
|
|
267
|
+
* @param {string} event_value
|
|
268
|
+
*/
|
|
269
|
+
set_cross_thread_event(element_id, event_type, event_name, event_value) {
|
|
270
|
+
const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ptr1 = passStringToWasm0(event_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
273
|
+
const len1 = WASM_VECTOR_LEN;
|
|
274
|
+
const ptr2 = passStringToWasm0(event_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
|
+
const len2 = WASM_VECTOR_LEN;
|
|
276
|
+
wasm.rawelementtemplate_set_cross_thread_event(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @param {number} element_id
|
|
280
|
+
* @param {string} data_name
|
|
281
|
+
* @param {string} data_value
|
|
282
|
+
*/
|
|
283
|
+
set_dataset(element_id, data_name, data_value) {
|
|
284
|
+
const ptr0 = passStringToWasm0(data_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
285
|
+
const len0 = WASM_VECTOR_LEN;
|
|
286
|
+
const ptr1 = passStringToWasm0(data_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
287
|
+
const len1 = WASM_VECTOR_LEN;
|
|
288
|
+
wasm.rawelementtemplate_set_dataset(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (Symbol.dispose) RawElementTemplate.prototype[Symbol.dispose] = RawElementTemplate.prototype.free;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* * key: cssId
|
|
296
|
+
* * value: StyleSheet
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
299
|
+
export class RawStyleInfo {
|
|
300
|
+
__destroy_into_raw() {
|
|
301
|
+
const ptr = this.__wbg_ptr;
|
|
302
|
+
this.__wbg_ptr = 0;
|
|
303
|
+
RawStyleInfoFinalization.unregister(this);
|
|
304
|
+
return ptr;
|
|
305
|
+
}
|
|
306
|
+
free() {
|
|
307
|
+
const ptr = this.__destroy_into_raw();
|
|
308
|
+
wasm.__wbg_rawstyleinfo_free(ptr, 0);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
*
|
|
312
|
+
* * Appends an import to the stylesheet identified by `css_id`.
|
|
313
|
+
* * If the stylesheet does not exist, it is created.
|
|
314
|
+
* * @param css_id - The ID of the CSS file.
|
|
315
|
+
* * @param import_css_id - The ID of the imported CSS file.
|
|
316
|
+
*
|
|
317
|
+
* @param {number} css_id
|
|
318
|
+
* @param {number} import_css_id
|
|
319
|
+
*/
|
|
320
|
+
append_import(css_id, import_css_id) {
|
|
321
|
+
wasm.rawstyleinfo_append_import(this.__wbg_ptr, css_id, import_css_id);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
*
|
|
325
|
+
* * Encodes the RawStyleInfo into a Uint8Array using bincode serialization.
|
|
326
|
+
* * @returns A Uint8Array containing the serialized RawStyleInfo.
|
|
327
|
+
*
|
|
328
|
+
* @returns {Uint8Array}
|
|
329
|
+
*/
|
|
330
|
+
encode() {
|
|
331
|
+
const ret = wasm.rawstyleinfo_encode(this.__wbg_ptr);
|
|
332
|
+
if (ret[2]) {
|
|
333
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
334
|
+
}
|
|
335
|
+
return takeFromExternrefTable0(ret[0]);
|
|
336
|
+
}
|
|
337
|
+
constructor() {
|
|
338
|
+
const ret = wasm.rawstyleinfo_new();
|
|
339
|
+
this.__wbg_ptr = ret >>> 0;
|
|
340
|
+
RawStyleInfoFinalization.register(this, this.__wbg_ptr, this);
|
|
341
|
+
return this;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
*
|
|
345
|
+
* * Pushes a rule to the stylesheet identified by `css_id`.
|
|
346
|
+
* * If the stylesheet does not exist, it is created.
|
|
347
|
+
* * @param css_id - The ID of the CSS file.
|
|
348
|
+
* * @param rule - The rule to append.
|
|
349
|
+
*
|
|
350
|
+
* @param {number} css_id
|
|
351
|
+
* @param {Rule} rule
|
|
352
|
+
*/
|
|
353
|
+
push_rule(css_id, rule) {
|
|
354
|
+
_assertClass(rule, Rule);
|
|
355
|
+
var ptr0 = rule.__destroy_into_raw();
|
|
356
|
+
wasm.rawstyleinfo_push_rule(this.__wbg_ptr, css_id, ptr0);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (Symbol.dispose) RawStyleInfo.prototype[Symbol.dispose] = RawStyleInfo.prototype.free;
|
|
360
|
+
|
|
361
|
+
export class Rule {
|
|
362
|
+
__destroy_into_raw() {
|
|
363
|
+
const ptr = this.__wbg_ptr;
|
|
364
|
+
this.__wbg_ptr = 0;
|
|
365
|
+
RuleFinalization.unregister(this);
|
|
366
|
+
return ptr;
|
|
367
|
+
}
|
|
368
|
+
free() {
|
|
369
|
+
const ptr = this.__destroy_into_raw();
|
|
370
|
+
wasm.__wbg_rule_free(ptr, 0);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
*
|
|
374
|
+
* * Creates a new Rule with the specified type.
|
|
375
|
+
* * @param rule_type - The type of the rule (e.g., "StyleRule", "FontFaceRule", "KeyframesRule").
|
|
376
|
+
*
|
|
377
|
+
* @param {string} rule_type
|
|
378
|
+
*/
|
|
379
|
+
constructor(rule_type) {
|
|
380
|
+
const ptr0 = passStringToWasm0(rule_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
const ret = wasm.rule_new(ptr0, len0);
|
|
383
|
+
if (ret[2]) {
|
|
384
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
385
|
+
}
|
|
386
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
387
|
+
RuleFinalization.register(this, this.__wbg_ptr, this);
|
|
388
|
+
return this;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
*
|
|
392
|
+
* * Pushes a declaration to the rule's declaration block.
|
|
393
|
+
* * @param property_name - The property name.
|
|
394
|
+
* * @param value - The property value.
|
|
395
|
+
*
|
|
396
|
+
* @param {string} property_name
|
|
397
|
+
* @param {string} value
|
|
398
|
+
*/
|
|
399
|
+
push_declaration(property_name, value) {
|
|
400
|
+
const ptr0 = passStringToWasm0(property_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
402
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
+
const len1 = WASM_VECTOR_LEN;
|
|
404
|
+
wasm.rule_push_declaration(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
*
|
|
408
|
+
* * Pushes a nested rule to the rule.
|
|
409
|
+
* * @param rule - The nested rule to add.
|
|
410
|
+
*
|
|
411
|
+
* @param {Rule} rule
|
|
412
|
+
*/
|
|
413
|
+
push_rule_children(rule) {
|
|
414
|
+
_assertClass(rule, Rule);
|
|
415
|
+
var ptr0 = rule.__destroy_into_raw();
|
|
416
|
+
wasm.rule_push_rule_children(this.__wbg_ptr, ptr0);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
*
|
|
420
|
+
* * Sets the prelude for the rule.
|
|
421
|
+
* * @param prelude - The prelude to set (SelectorList or KeyFramesPrelude).
|
|
422
|
+
*
|
|
423
|
+
* @param {RulePrelude} prelude
|
|
424
|
+
*/
|
|
425
|
+
set_prelude(prelude) {
|
|
426
|
+
_assertClass(prelude, RulePrelude);
|
|
427
|
+
var ptr0 = prelude.__destroy_into_raw();
|
|
428
|
+
wasm.rule_set_prelude(this.__wbg_ptr, ptr0);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (Symbol.dispose) Rule.prototype[Symbol.dispose] = Rule.prototype.free;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
*
|
|
435
|
+
* * Either SelectorList or KeyFramesPrelude
|
|
436
|
+
* * Depending on the RuleType
|
|
437
|
+
* * If it is SelectorList, then selectors is a list of Selector
|
|
438
|
+
* * If it is KeyFramesPrelude, then selectors has only one selector which is Prelude text, its simple_selectors is empty
|
|
439
|
+
* * If the parent is FontFace, then selectors is empty
|
|
440
|
+
*
|
|
441
|
+
*/
|
|
442
|
+
export class RulePrelude {
|
|
443
|
+
__destroy_into_raw() {
|
|
444
|
+
const ptr = this.__wbg_ptr;
|
|
445
|
+
this.__wbg_ptr = 0;
|
|
446
|
+
RulePreludeFinalization.unregister(this);
|
|
447
|
+
return ptr;
|
|
448
|
+
}
|
|
449
|
+
free() {
|
|
450
|
+
const ptr = this.__destroy_into_raw();
|
|
451
|
+
wasm.__wbg_ruleprelude_free(ptr, 0);
|
|
452
|
+
}
|
|
453
|
+
constructor() {
|
|
454
|
+
const ret = wasm.ruleprelude_new();
|
|
455
|
+
this.__wbg_ptr = ret >>> 0;
|
|
456
|
+
RulePreludeFinalization.register(this, this.__wbg_ptr, this);
|
|
457
|
+
return this;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
*
|
|
461
|
+
* * Pushes a selector to the list.
|
|
462
|
+
* * @param selector - The selector to add.
|
|
463
|
+
*
|
|
464
|
+
* @param {Selector} selector
|
|
465
|
+
*/
|
|
466
|
+
push_selector(selector) {
|
|
467
|
+
_assertClass(selector, Selector);
|
|
468
|
+
var ptr0 = selector.__destroy_into_raw();
|
|
469
|
+
wasm.ruleprelude_push_selector(this.__wbg_ptr, ptr0);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (Symbol.dispose) RulePrelude.prototype[Symbol.dispose] = RulePrelude.prototype.free;
|
|
473
|
+
|
|
474
|
+
export class Selector {
|
|
475
|
+
__destroy_into_raw() {
|
|
476
|
+
const ptr = this.__wbg_ptr;
|
|
477
|
+
this.__wbg_ptr = 0;
|
|
478
|
+
SelectorFinalization.unregister(this);
|
|
479
|
+
return ptr;
|
|
480
|
+
}
|
|
481
|
+
free() {
|
|
482
|
+
const ptr = this.__destroy_into_raw();
|
|
483
|
+
wasm.__wbg_selector_free(ptr, 0);
|
|
484
|
+
}
|
|
485
|
+
constructor() {
|
|
486
|
+
const ret = wasm.ruleprelude_new();
|
|
487
|
+
this.__wbg_ptr = ret >>> 0;
|
|
488
|
+
SelectorFinalization.register(this, this.__wbg_ptr, this);
|
|
489
|
+
return this;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
*
|
|
493
|
+
* * Pushes a selector section to the selector.
|
|
494
|
+
* * @param selector_type - The type of the selector section (e.g., "ClassSelector", "IdSelector").
|
|
495
|
+
* * @param value - The value of the selector section.
|
|
496
|
+
*
|
|
497
|
+
* @param {string} selector_type
|
|
498
|
+
* @param {string} value
|
|
499
|
+
*/
|
|
500
|
+
push_one_selector_section(selector_type, value) {
|
|
501
|
+
const ptr0 = passStringToWasm0(selector_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
502
|
+
const len0 = WASM_VECTOR_LEN;
|
|
503
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
|
+
const len1 = WASM_VECTOR_LEN;
|
|
505
|
+
const ret = wasm.selector_push_one_selector_section(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
506
|
+
if (ret[1]) {
|
|
507
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if (Symbol.dispose) Selector.prototype[Symbol.dispose] = Selector.prototype.free;
|
|
512
|
+
|
|
513
|
+
export class StyleInfoDecoder {
|
|
514
|
+
__destroy_into_raw() {
|
|
515
|
+
const ptr = this.__wbg_ptr;
|
|
516
|
+
this.__wbg_ptr = 0;
|
|
517
|
+
StyleInfoDecoderFinalization.unregister(this);
|
|
518
|
+
return ptr;
|
|
519
|
+
}
|
|
520
|
+
free() {
|
|
521
|
+
const ptr = this.__destroy_into_raw();
|
|
522
|
+
wasm.__wbg_styleinfodecoder_free(ptr, 0);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (Symbol.dispose) StyleInfoDecoder.prototype[Symbol.dispose] = StyleInfoDecoder.prototype.free;
|
|
526
|
+
|
|
527
|
+
function __wbg_get_imports() {
|
|
528
|
+
const import0 = {
|
|
529
|
+
__proto__: null,
|
|
530
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
531
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
532
|
+
return ret;
|
|
533
|
+
},
|
|
534
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
535
|
+
const obj = arg1;
|
|
536
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
537
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
538
|
+
var len1 = WASM_VECTOR_LEN;
|
|
539
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
540
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
541
|
+
},
|
|
542
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
543
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
544
|
+
},
|
|
545
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
546
|
+
const ret = arg0.length;
|
|
547
|
+
return ret;
|
|
548
|
+
},
|
|
549
|
+
__wbg_new_from_slice_a3d2629dc1826784: function(arg0, arg1) {
|
|
550
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
551
|
+
return ret;
|
|
552
|
+
},
|
|
553
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
554
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
555
|
+
},
|
|
556
|
+
__wbindgen_init_externref_table: function() {
|
|
557
|
+
const table = wasm.__wbindgen_externrefs;
|
|
558
|
+
const offset = table.grow(4);
|
|
559
|
+
table.set(0, undefined);
|
|
560
|
+
table.set(offset + 0, undefined);
|
|
561
|
+
table.set(offset + 1, null);
|
|
562
|
+
table.set(offset + 2, true);
|
|
563
|
+
table.set(offset + 3, false);
|
|
564
|
+
},
|
|
565
|
+
};
|
|
566
|
+
return {
|
|
567
|
+
__proto__: null,
|
|
568
|
+
"./encode_bg.js": import0,
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const DecodedStyleDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
573
|
+
? { register: () => {}, unregister: () => {} }
|
|
574
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodedstyledata_free(ptr >>> 0, 1));
|
|
575
|
+
const ElementTemplateSectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
576
|
+
? { register: () => {}, unregister: () => {} }
|
|
577
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_elementtemplatesection_free(ptr >>> 0, 1));
|
|
578
|
+
const OperationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
579
|
+
? { register: () => {}, unregister: () => {} }
|
|
580
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_operation_free(ptr >>> 0, 1));
|
|
581
|
+
const RawElementTemplateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
582
|
+
? { register: () => {}, unregister: () => {} }
|
|
583
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rawelementtemplate_free(ptr >>> 0, 1));
|
|
584
|
+
const RawStyleInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
585
|
+
? { register: () => {}, unregister: () => {} }
|
|
586
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rawstyleinfo_free(ptr >>> 0, 1));
|
|
587
|
+
const RuleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
588
|
+
? { register: () => {}, unregister: () => {} }
|
|
589
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rule_free(ptr >>> 0, 1));
|
|
590
|
+
const RulePreludeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
591
|
+
? { register: () => {}, unregister: () => {} }
|
|
592
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ruleprelude_free(ptr >>> 0, 1));
|
|
593
|
+
const SelectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
594
|
+
? { register: () => {}, unregister: () => {} }
|
|
595
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_selector_free(ptr >>> 0, 1));
|
|
596
|
+
const StyleInfoDecoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
597
|
+
? { register: () => {}, unregister: () => {} }
|
|
598
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_styleinfodecoder_free(ptr >>> 0, 1));
|
|
599
|
+
|
|
600
|
+
function addToExternrefTable0(obj) {
|
|
601
|
+
const idx = wasm.__externref_table_alloc();
|
|
602
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
603
|
+
return idx;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
function _assertClass(instance, klass) {
|
|
607
|
+
if (!(instance instanceof klass)) {
|
|
608
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
613
|
+
ptr = ptr >>> 0;
|
|
614
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
let cachedDataViewMemory0 = null;
|
|
618
|
+
function getDataViewMemory0() {
|
|
619
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
620
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
621
|
+
}
|
|
622
|
+
return cachedDataViewMemory0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function getStringFromWasm0(ptr, len) {
|
|
626
|
+
ptr = ptr >>> 0;
|
|
627
|
+
return decodeText(ptr, len);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
let cachedUint8ArrayMemory0 = null;
|
|
631
|
+
function getUint8ArrayMemory0() {
|
|
632
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
633
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
634
|
+
}
|
|
635
|
+
return cachedUint8ArrayMemory0;
|
|
636
|
+
}
|
|
7
637
|
|
|
638
|
+
function isLikeNone(x) {
|
|
639
|
+
return x === undefined || x === null;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
643
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
644
|
+
for (let i = 0; i < array.length; i++) {
|
|
645
|
+
const add = addToExternrefTable0(array[i]);
|
|
646
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
647
|
+
}
|
|
648
|
+
WASM_VECTOR_LEN = array.length;
|
|
649
|
+
return ptr;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
653
|
+
if (realloc === undefined) {
|
|
654
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
655
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
656
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
657
|
+
WASM_VECTOR_LEN = buf.length;
|
|
658
|
+
return ptr;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
let len = arg.length;
|
|
662
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
663
|
+
|
|
664
|
+
const mem = getUint8ArrayMemory0();
|
|
665
|
+
|
|
666
|
+
let offset = 0;
|
|
667
|
+
|
|
668
|
+
for (; offset < len; offset++) {
|
|
669
|
+
const code = arg.charCodeAt(offset);
|
|
670
|
+
if (code > 0x7F) break;
|
|
671
|
+
mem[ptr + offset] = code;
|
|
672
|
+
}
|
|
673
|
+
if (offset !== len) {
|
|
674
|
+
if (offset !== 0) {
|
|
675
|
+
arg = arg.slice(offset);
|
|
676
|
+
}
|
|
677
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
678
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
679
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
680
|
+
|
|
681
|
+
offset += ret.written;
|
|
682
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
WASM_VECTOR_LEN = offset;
|
|
686
|
+
return ptr;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function takeFromExternrefTable0(idx) {
|
|
690
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
691
|
+
wasm.__externref_table_dealloc(idx);
|
|
692
|
+
return value;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
696
|
+
cachedTextDecoder.decode();
|
|
697
|
+
function decodeText(ptr, len) {
|
|
698
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const cachedTextEncoder = new TextEncoder();
|
|
702
|
+
|
|
703
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
704
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
705
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
706
|
+
view.set(buf);
|
|
707
|
+
return {
|
|
708
|
+
read: arg.length,
|
|
709
|
+
written: buf.length
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
let WASM_VECTOR_LEN = 0;
|
|
715
|
+
|
|
716
|
+
import { readFileSync } from 'node:fs';
|
|
8
717
|
const wasmUrl = new URL('encode_bg.wasm', import.meta.url);
|
|
9
718
|
const wasmBytes = readFileSync(wasmUrl);
|
|
10
719
|
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
11
|
-
const wasm = new WebAssembly.Instance(wasmModule,
|
|
12
|
-
export { wasm as __wasm };
|
|
13
|
-
|
|
14
|
-
imports["./encode_bg.js"].__wbg_set_wasm(wasm, wasmModule);
|
|
720
|
+
const wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
15
721
|
wasm.__wbindgen_start();
|
|
16
|
-
|
|
17
|
-
export * from "./encode_bg.js";
|