taffy-js 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/taffy_js.js DELETED
@@ -1,2731 +0,0 @@
1
- let wasm;
2
-
3
- function addToExternrefTable0(obj) {
4
- const idx = wasm.__externref_table_alloc();
5
- wasm.__wbindgen_externrefs.set(idx, obj);
6
- return idx;
7
- }
8
-
9
- function _assertClass(instance, klass) {
10
- if (!(instance instanceof klass)) {
11
- throw new Error(`expected instance of ${klass.name}`);
12
- }
13
- }
14
-
15
- function debugString(val) {
16
- // primitive types
17
- const type = typeof val;
18
- if (type == 'number' || type == 'boolean' || val == null) {
19
- return `${val}`;
20
- }
21
- if (type == 'string') {
22
- return `"${val}"`;
23
- }
24
- if (type == 'symbol') {
25
- const description = val.description;
26
- if (description == null) {
27
- return 'Symbol';
28
- } else {
29
- return `Symbol(${description})`;
30
- }
31
- }
32
- if (type == 'function') {
33
- const name = val.name;
34
- if (typeof name == 'string' && name.length > 0) {
35
- return `Function(${name})`;
36
- } else {
37
- return 'Function';
38
- }
39
- }
40
- // objects
41
- if (Array.isArray(val)) {
42
- const length = val.length;
43
- let debug = '[';
44
- if (length > 0) {
45
- debug += debugString(val[0]);
46
- }
47
- for(let i = 1; i < length; i++) {
48
- debug += ', ' + debugString(val[i]);
49
- }
50
- debug += ']';
51
- return debug;
52
- }
53
- // Test for built-in
54
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
55
- let className;
56
- if (builtInMatches && builtInMatches.length > 1) {
57
- className = builtInMatches[1];
58
- } else {
59
- // Failed to match the standard '[object ClassName]'
60
- return toString.call(val);
61
- }
62
- if (className == 'Object') {
63
- // we're a user defined class or Object
64
- // JSON.stringify avoids problems with cycles, and is generally much
65
- // easier than looping through ownProperties of `val`.
66
- try {
67
- return 'Object(' + JSON.stringify(val) + ')';
68
- } catch (_) {
69
- return 'Object';
70
- }
71
- }
72
- // errors
73
- if (val instanceof Error) {
74
- return `${val.name}: ${val.message}\n${val.stack}`;
75
- }
76
- // TODO we could test for more things here, like `Set`s and `Map`s.
77
- return className;
78
- }
79
-
80
- function getArrayU64FromWasm0(ptr, len) {
81
- ptr = ptr >>> 0;
82
- return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
83
- }
84
-
85
- function getArrayU8FromWasm0(ptr, len) {
86
- ptr = ptr >>> 0;
87
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
88
- }
89
-
90
- let cachedBigUint64ArrayMemory0 = null;
91
- function getBigUint64ArrayMemory0() {
92
- if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
93
- cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
94
- }
95
- return cachedBigUint64ArrayMemory0;
96
- }
97
-
98
- let cachedDataViewMemory0 = null;
99
- function getDataViewMemory0() {
100
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
101
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
102
- }
103
- return cachedDataViewMemory0;
104
- }
105
-
106
- function getStringFromWasm0(ptr, len) {
107
- ptr = ptr >>> 0;
108
- return decodeText(ptr, len);
109
- }
110
-
111
- let cachedUint8ArrayMemory0 = null;
112
- function getUint8ArrayMemory0() {
113
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
114
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
115
- }
116
- return cachedUint8ArrayMemory0;
117
- }
118
-
119
- function handleError(f, args) {
120
- try {
121
- return f.apply(this, args);
122
- } catch (e) {
123
- const idx = addToExternrefTable0(e);
124
- wasm.__wbindgen_exn_store(idx);
125
- }
126
- }
127
-
128
- function isLikeNone(x) {
129
- return x === undefined || x === null;
130
- }
131
-
132
- function passArray64ToWasm0(arg, malloc) {
133
- const ptr = malloc(arg.length * 8, 8) >>> 0;
134
- getBigUint64ArrayMemory0().set(arg, ptr / 8);
135
- WASM_VECTOR_LEN = arg.length;
136
- return ptr;
137
- }
138
-
139
- function passStringToWasm0(arg, malloc, realloc) {
140
- if (realloc === undefined) {
141
- const buf = cachedTextEncoder.encode(arg);
142
- const ptr = malloc(buf.length, 1) >>> 0;
143
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
144
- WASM_VECTOR_LEN = buf.length;
145
- return ptr;
146
- }
147
-
148
- let len = arg.length;
149
- let ptr = malloc(len, 1) >>> 0;
150
-
151
- const mem = getUint8ArrayMemory0();
152
-
153
- let offset = 0;
154
-
155
- for (; offset < len; offset++) {
156
- const code = arg.charCodeAt(offset);
157
- if (code > 0x7F) break;
158
- mem[ptr + offset] = code;
159
- }
160
- if (offset !== len) {
161
- if (offset !== 0) {
162
- arg = arg.slice(offset);
163
- }
164
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
165
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
166
- const ret = cachedTextEncoder.encodeInto(arg, view);
167
-
168
- offset += ret.written;
169
- ptr = realloc(ptr, len, offset, 1) >>> 0;
170
- }
171
-
172
- WASM_VECTOR_LEN = offset;
173
- return ptr;
174
- }
175
-
176
- function takeFromExternrefTable0(idx) {
177
- const value = wasm.__wbindgen_externrefs.get(idx);
178
- wasm.__externref_table_dealloc(idx);
179
- return value;
180
- }
181
-
182
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
183
- cachedTextDecoder.decode();
184
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
185
- let numBytesDecoded = 0;
186
- function decodeText(ptr, len) {
187
- numBytesDecoded += len;
188
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
189
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
190
- cachedTextDecoder.decode();
191
- numBytesDecoded = len;
192
- }
193
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
194
- }
195
-
196
- const cachedTextEncoder = new TextEncoder();
197
-
198
- if (!('encodeInto' in cachedTextEncoder)) {
199
- cachedTextEncoder.encodeInto = function (arg, view) {
200
- const buf = cachedTextEncoder.encode(arg);
201
- view.set(buf);
202
- return {
203
- read: arg.length,
204
- written: buf.length
205
- };
206
- }
207
- }
208
-
209
- let WASM_VECTOR_LEN = 0;
210
-
211
- const AvailableSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
212
- ? { register: () => {}, unregister: () => {} }
213
- : new FinalizationRegistry(ptr => wasm.__wbg_availablespace_free(ptr >>> 0, 1));
214
-
215
- const DimensionFinalization = (typeof FinalizationRegistry === 'undefined')
216
- ? { register: () => {}, unregister: () => {} }
217
- : new FinalizationRegistry(ptr => wasm.__wbg_dimension_free(ptr >>> 0, 1));
218
-
219
- const LayoutFinalization = (typeof FinalizationRegistry === 'undefined')
220
- ? { register: () => {}, unregister: () => {} }
221
- : new FinalizationRegistry(ptr => wasm.__wbg_layout_free(ptr >>> 0, 1));
222
-
223
- const LineFinalization = (typeof FinalizationRegistry === 'undefined')
224
- ? { register: () => {}, unregister: () => {} }
225
- : new FinalizationRegistry(ptr => wasm.__wbg_line_free(ptr >>> 0, 1));
226
-
227
- const PointFinalization = (typeof FinalizationRegistry === 'undefined')
228
- ? { register: () => {}, unregister: () => {} }
229
- : new FinalizationRegistry(ptr => wasm.__wbg_point_free(ptr >>> 0, 1));
230
-
231
- const RectFinalization = (typeof FinalizationRegistry === 'undefined')
232
- ? { register: () => {}, unregister: () => {} }
233
- : new FinalizationRegistry(ptr => wasm.__wbg_rect_free(ptr >>> 0, 1));
234
-
235
- const SizeFinalization = (typeof FinalizationRegistry === 'undefined')
236
- ? { register: () => {}, unregister: () => {} }
237
- : new FinalizationRegistry(ptr => wasm.__wbg_size_free(ptr >>> 0, 1));
238
-
239
- const StyleFinalization = (typeof FinalizationRegistry === 'undefined')
240
- ? { register: () => {}, unregister: () => {} }
241
- : new FinalizationRegistry(ptr => wasm.__wbg_style_free(ptr >>> 0, 1));
242
-
243
- const TaffyNodeFinalization = (typeof FinalizationRegistry === 'undefined')
244
- ? { register: () => {}, unregister: () => {} }
245
- : new FinalizationRegistry(ptr => wasm.__wbg_taffynode_free(ptr >>> 0, 1));
246
-
247
- const TrackDefinitionFinalization = (typeof FinalizationRegistry === 'undefined')
248
- ? { register: () => {}, unregister: () => {} }
249
- : new FinalizationRegistry(ptr => wasm.__wbg_trackdefinition_free(ptr >>> 0, 1));
250
-
251
- /**
252
- * How lines of content are aligned along the cross axis when there is extra space.
253
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
254
- */
255
- export const AlignContent = Object.freeze({
256
- /**
257
- * Lines are packed toward the start of the cross axis.
258
- */
259
- Start: 0, "0": "Start",
260
- /**
261
- * Lines are packed toward the end of the cross axis.
262
- */
263
- End: 1, "1": "End",
264
- /**
265
- * Lines are packed toward the start of the flex-direction cross axis.
266
- */
267
- FlexStart: 2, "2": "FlexStart",
268
- /**
269
- * Lines are packed toward the end of the flex-direction cross axis.
270
- */
271
- FlexEnd: 3, "3": "FlexEnd",
272
- /**
273
- * Lines are packed toward the center of the cross axis.
274
- */
275
- Center: 4, "4": "Center",
276
- /**
277
- * Lines are evenly distributed; the first line is at the start, the last at the end.
278
- */
279
- SpaceBetween: 5, "5": "SpaceBetween",
280
- /**
281
- * Lines are evenly distributed with equal space around them.
282
- */
283
- SpaceAround: 6, "6": "SpaceAround",
284
- /**
285
- * Lines are evenly distributed with equal space between them.
286
- */
287
- SpaceEvenly: 7, "7": "SpaceEvenly",
288
- /**
289
- * Lines are stretched to take up the remaining space.
290
- */
291
- Stretch: 8, "8": "Stretch",
292
- });
293
-
294
- /**
295
- * How items are aligned along the cross axis.
296
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
297
- */
298
- export const AlignItems = Object.freeze({
299
- /**
300
- * Items are aligned at the start of the cross axis.
301
- */
302
- Start: 0, "0": "Start",
303
- /**
304
- * Items are aligned at the end of the cross axis.
305
- */
306
- End: 1, "1": "End",
307
- /**
308
- * Items are aligned at the start of the flex-direction cross axis.
309
- */
310
- FlexStart: 2, "2": "FlexStart",
311
- /**
312
- * Items are aligned at the end of the flex-direction cross axis.
313
- */
314
- FlexEnd: 3, "3": "FlexEnd",
315
- /**
316
- * Items are aligned at the center of the cross axis.
317
- */
318
- Center: 4, "4": "Center",
319
- /**
320
- * Items are aligned based on their baselines.
321
- */
322
- Baseline: 5, "5": "Baseline",
323
- /**
324
- * Items are stretched to fill the container along the cross axis.
325
- */
326
- Stretch: 6, "6": "Stretch",
327
- });
328
-
329
- /**
330
- * How a single item is aligned along the cross axis, overriding `AlignItems`.
331
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
332
- */
333
- export const AlignSelf = Object.freeze({
334
- /**
335
- * Auto
336
- */
337
- Auto: 0, "0": "Auto",
338
- /**
339
- * items are aligned at the start of the cross axis.
340
- */
341
- Start: 1, "1": "Start",
342
- /**
343
- * Items are aligned at the end of the cross axis.
344
- */
345
- End: 2, "2": "End",
346
- /**
347
- * Items are aligned at the start of the flex-direction cross axis.
348
- */
349
- FlexStart: 3, "3": "FlexStart",
350
- /**
351
- * Items are aligned at the end of the flex-direction cross axis.
352
- */
353
- FlexEnd: 4, "4": "FlexEnd",
354
- /**
355
- * Items are aligned at the center of the cross axis.
356
- */
357
- Center: 5, "5": "Center",
358
- /**
359
- * Items are aligned based on their baselines.
360
- */
361
- Baseline: 6, "6": "Baseline",
362
- /**
363
- * Items are stretched to fill the container along the cross axis.
364
- */
365
- Stretch: 7, "7": "Stretch",
366
- });
367
-
368
- /**
369
- * The available space for layout computation.
370
- */
371
- export class AvailableSpace {
372
- __destroy_into_raw() {
373
- const ptr = this.__wbg_ptr;
374
- this.__wbg_ptr = 0;
375
- AvailableSpaceFinalization.unregister(this);
376
- return ptr;
377
- }
378
- free() {
379
- const ptr = this.__destroy_into_raw();
380
- wasm.__wbg_availablespace_free(ptr, 0);
381
- }
382
- /**
383
- * The available width (None means undefined/max-content).
384
- * @returns {number | undefined}
385
- */
386
- get width() {
387
- const ret = wasm.__wbg_get_availablespace_width(this.__wbg_ptr);
388
- return ret === 0x100000001 ? undefined : ret;
389
- }
390
- /**
391
- * The available width (None means undefined/max-content).
392
- * @param {number | null} [arg0]
393
- */
394
- set width(arg0) {
395
- wasm.__wbg_set_availablespace_width(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : Math.fround(arg0));
396
- }
397
- /**
398
- * The available height (None means undefined/max-content).
399
- * @returns {number | undefined}
400
- */
401
- get height() {
402
- const ret = wasm.__wbg_get_availablespace_height(this.__wbg_ptr);
403
- return ret === 0x100000001 ? undefined : ret;
404
- }
405
- /**
406
- * The available height (None means undefined/max-content).
407
- * @param {number | null} [arg0]
408
- */
409
- set height(arg0) {
410
- wasm.__wbg_set_availablespace_height(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : Math.fround(arg0));
411
- }
412
- }
413
- if (Symbol.dispose) AvailableSpace.prototype[Symbol.dispose] = AvailableSpace.prototype.free;
414
-
415
- /**
416
- * Represents a length value in CSS.
417
- * Represents a length value in CSS.
418
- *
419
- * This struct corresponds to a dimension value that can be specified in pixels, percentage, or auto.
420
- */
421
- export class Dimension {
422
- static __wrap(ptr) {
423
- ptr = ptr >>> 0;
424
- const obj = Object.create(Dimension.prototype);
425
- obj.__wbg_ptr = ptr;
426
- DimensionFinalization.register(obj, obj.__wbg_ptr, obj);
427
- return obj;
428
- }
429
- __destroy_into_raw() {
430
- const ptr = this.__wbg_ptr;
431
- this.__wbg_ptr = 0;
432
- DimensionFinalization.unregister(this);
433
- return ptr;
434
- }
435
- free() {
436
- const ptr = this.__destroy_into_raw();
437
- wasm.__wbg_dimension_free(ptr, 0);
438
- }
439
- /**
440
- * The numeric value of the dimension.
441
- * - For `Pixels`, this is the number of pixels.
442
- * - For `Percent`, this is the percentage value (0.0 to 100.0, or sometimes 0.0 to 1.0 depending on context, handled by internal logic).
443
- * - For `Auto`, this value is typically ignored.
444
- * @returns {number}
445
- */
446
- get value() {
447
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
448
- return ret;
449
- }
450
- /**
451
- * The numeric value of the dimension.
452
- * - For `Pixels`, this is the number of pixels.
453
- * - For `Percent`, this is the percentage value (0.0 to 100.0, or sometimes 0.0 to 1.0 depending on context, handled by internal logic).
454
- * - For `Auto`, this value is typically ignored.
455
- * @param {number} arg0
456
- */
457
- set value(arg0) {
458
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
459
- }
460
- /**
461
- * The unit of the dimension.
462
- * @returns {DimensionUnit}
463
- */
464
- get unit() {
465
- const ret = wasm.__wbg_get_dimension_unit(this.__wbg_ptr);
466
- return ret;
467
- }
468
- /**
469
- * The unit of the dimension.
470
- * @param {DimensionUnit} arg0
471
- */
472
- set unit(arg0) {
473
- wasm.__wbg_set_dimension_unit(this.__wbg_ptr, arg0);
474
- }
475
- }
476
- if (Symbol.dispose) Dimension.prototype[Symbol.dispose] = Dimension.prototype.free;
477
-
478
- /**
479
- * The unit of a dimension.
480
- * @enum {0 | 1 | 2}
481
- */
482
- export const DimensionUnit = Object.freeze({
483
- /**
484
- * The dimension is specified in logical pixels.
485
- */
486
- Pixels: 0, "0": "Pixels",
487
- /**
488
- * The dimension is specified as a percentage of the parent's size.
489
- */
490
- Percent: 1, "1": "Percent",
491
- /**
492
- * The dimension is determined automatically based on content or context.
493
- */
494
- Auto: 2, "2": "Auto",
495
- });
496
-
497
- /**
498
- * The display style of a node.
499
- * @enum {0 | 1 | 2 | 3}
500
- */
501
- export const Display = Object.freeze({
502
- /**
503
- * The node is hidden and does not take up space.
504
- */
505
- None: 0, "0": "None",
506
- /**
507
- * The node behaves as a flex container.
508
- */
509
- Flex: 1, "1": "Flex",
510
- /**
511
- * The node behaves as a grid container.
512
- */
513
- Grid: 2, "2": "Grid",
514
- /**
515
- * The node behaves as a block element.
516
- */
517
- Block: 3, "3": "Block",
518
- });
519
-
520
- /**
521
- * Start and End are used for logical positioning (e.g. paddingStart).
522
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
523
- */
524
- export const Edge = Object.freeze({
525
- Left: 0, "0": "Left",
526
- Right: 1, "1": "Right",
527
- Top: 2, "2": "Top",
528
- Bottom: 3, "3": "Bottom",
529
- Start: 4, "4": "Start",
530
- End: 5, "5": "End",
531
- Horizontal: 6, "6": "Horizontal",
532
- Vertical: 7, "7": "Vertical",
533
- All: 8, "8": "All",
534
- });
535
-
536
- /**
537
- * The direction of the main axis for a flex container.
538
- * @enum {0 | 1 | 2 | 3}
539
- */
540
- export const FlexDirection = Object.freeze({
541
- /**
542
- * Items are placed horizontally from left to right.
543
- */
544
- Row: 0, "0": "Row",
545
- /**
546
- * Items are placed vertically from top to bottom.
547
- */
548
- Column: 1, "1": "Column",
549
- /**
550
- * Items are placed horizontally from right to left.
551
- */
552
- RowReverse: 2, "2": "RowReverse",
553
- /**
554
- * Items are placed vertically from bottom to top.
555
- */
556
- ColumnReverse: 3, "3": "ColumnReverse",
557
- });
558
-
559
- /**
560
- * Whether flex items are forced into a single line or can wrap onto multiple lines.
561
- * @enum {0 | 1 | 2}
562
- */
563
- export const FlexWrap = Object.freeze({
564
- /**
565
- * Items are forced into a single line.
566
- */
567
- NoWrap: 0, "0": "NoWrap",
568
- /**
569
- * Items wrap onto multiple lines.
570
- */
571
- Wrap: 1, "1": "Wrap",
572
- /**
573
- * Items wrap onto multiple lines in reverse order.
574
- */
575
- WrapReverse: 2, "2": "WrapReverse",
576
- });
577
-
578
- /**
579
- * Grid auto-placement algorithm controls how auto-placed items get flowed into the grid.
580
- * @enum {0 | 1 | 2 | 3}
581
- */
582
- export const GridAutoFlow = Object.freeze({
583
- /**
584
- * Items are placed by filling each row in turn, adding new rows as necessary.
585
- */
586
- Row: 0, "0": "Row",
587
- /**
588
- * Items are placed by filling each column in turn, adding new columns as necessary.
589
- */
590
- Column: 1, "1": "Column",
591
- /**
592
- * Items are placed by filling each row, attempting to fill holes earlier in the grid.
593
- */
594
- RowDense: 2, "2": "RowDense",
595
- /**
596
- * Items are placed by filling each column, attempting to fill holes earlier in the grid.
597
- */
598
- ColumnDense: 3, "3": "ColumnDense",
599
- });
600
-
601
- /**
602
- * @enum {0 | 1 | 2}
603
- */
604
- export const Gutter = Object.freeze({
605
- Column: 0, "0": "Column",
606
- Row: 1, "1": "Row",
607
- All: 2, "2": "All",
608
- });
609
-
610
- /**
611
- * How items are distributed along the main axis.
612
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
613
- */
614
- export const JustifyContent = Object.freeze({
615
- /**
616
- * Items are packed toward the start of the layout direction.
617
- */
618
- Start: 0, "0": "Start",
619
- /**
620
- * Items are packed toward the end of the layout direction.
621
- */
622
- End: 1, "1": "End",
623
- /**
624
- * Items are packed toward the start of the flex-direction.
625
- */
626
- FlexStart: 2, "2": "FlexStart",
627
- /**
628
- * Items are packed toward the end of the flex-direction.
629
- */
630
- FlexEnd: 3, "3": "FlexEnd",
631
- /**
632
- * Items are centered along the line.
633
- */
634
- Center: 4, "4": "Center",
635
- /**
636
- * Items are evenly distributed; the first item is at the start, the last at the end.
637
- */
638
- SpaceBetween: 5, "5": "SpaceBetween",
639
- /**
640
- * Items are evenly distributed with equal space around them.
641
- */
642
- SpaceAround: 6, "6": "SpaceAround",
643
- /**
644
- * Items are evenly distributed with equal space between them using the same gap at ends.
645
- */
646
- SpaceEvenly: 7, "7": "SpaceEvenly",
647
- });
648
-
649
- /**
650
- * Represents the computed layout of a node.
651
- *
652
- * This struct contains the final position and size of a node after layout computation.
653
- */
654
- export class Layout {
655
- static __wrap(ptr) {
656
- ptr = ptr >>> 0;
657
- const obj = Object.create(Layout.prototype);
658
- obj.__wbg_ptr = ptr;
659
- LayoutFinalization.register(obj, obj.__wbg_ptr, obj);
660
- return obj;
661
- }
662
- __destroy_into_raw() {
663
- const ptr = this.__wbg_ptr;
664
- this.__wbg_ptr = 0;
665
- LayoutFinalization.unregister(this);
666
- return ptr;
667
- }
668
- free() {
669
- const ptr = this.__destroy_into_raw();
670
- wasm.__wbg_layout_free(ptr, 0);
671
- }
672
- /**
673
- * The absolute x-coordinate of the node relative to its parent.
674
- * @returns {number}
675
- */
676
- get x() {
677
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
678
- return ret;
679
- }
680
- /**
681
- * The absolute x-coordinate of the node relative to its parent.
682
- * @param {number} arg0
683
- */
684
- set x(arg0) {
685
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
686
- }
687
- /**
688
- * The absolute y-coordinate of the node relative to its parent.
689
- * @returns {number}
690
- */
691
- get y() {
692
- const ret = wasm.__wbg_get_layout_y(this.__wbg_ptr);
693
- return ret;
694
- }
695
- /**
696
- * The absolute y-coordinate of the node relative to its parent.
697
- * @param {number} arg0
698
- */
699
- set y(arg0) {
700
- wasm.__wbg_set_layout_y(this.__wbg_ptr, arg0);
701
- }
702
- /**
703
- * The computed width of the node.
704
- * @returns {number}
705
- */
706
- get width() {
707
- const ret = wasm.__wbg_get_layout_width(this.__wbg_ptr);
708
- return ret;
709
- }
710
- /**
711
- * The computed width of the node.
712
- * @param {number} arg0
713
- */
714
- set width(arg0) {
715
- wasm.__wbg_set_layout_width(this.__wbg_ptr, arg0);
716
- }
717
- /**
718
- * The computed height of the node.
719
- * @returns {number}
720
- */
721
- get height() {
722
- const ret = wasm.__wbg_get_layout_height(this.__wbg_ptr);
723
- return ret;
724
- }
725
- /**
726
- * The computed height of the node.
727
- * @param {number} arg0
728
- */
729
- set height(arg0) {
730
- wasm.__wbg_set_layout_height(this.__wbg_ptr, arg0);
731
- }
732
- }
733
- if (Symbol.dispose) Layout.prototype[Symbol.dispose] = Layout.prototype.free;
734
-
735
- /**
736
- * Represents a grid line placement (start and end).
737
- */
738
- export class Line {
739
- __destroy_into_raw() {
740
- const ptr = this.__wbg_ptr;
741
- this.__wbg_ptr = 0;
742
- LineFinalization.unregister(this);
743
- return ptr;
744
- }
745
- free() {
746
- const ptr = this.__destroy_into_raw();
747
- wasm.__wbg_line_free(ptr, 0);
748
- }
749
- /**
750
- * The start line index (1-based).
751
- * @returns {number | undefined}
752
- */
753
- get start() {
754
- const ret = wasm.__wbg_get_line_start(this.__wbg_ptr);
755
- return ret === 0xFFFFFF ? undefined : ret;
756
- }
757
- /**
758
- * The start line index (1-based).
759
- * @param {number | null} [arg0]
760
- */
761
- set start(arg0) {
762
- wasm.__wbg_set_line_start(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0);
763
- }
764
- /**
765
- * The end line index (1-based).
766
- * @returns {number | undefined}
767
- */
768
- get end() {
769
- const ret = wasm.__wbg_get_line_end(this.__wbg_ptr);
770
- return ret === 0xFFFFFF ? undefined : ret;
771
- }
772
- /**
773
- * The end line index (1-based).
774
- * @param {number | null} [arg0]
775
- */
776
- set end(arg0) {
777
- wasm.__wbg_set_line_end(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0);
778
- }
779
- }
780
- if (Symbol.dispose) Line.prototype[Symbol.dispose] = Line.prototype.free;
781
-
782
- /**
783
- * Represents a point in 2D space.
784
- *
785
- * Typically used for coordinates like absolute positioning offsets.
786
- */
787
- export class Point {
788
- __destroy_into_raw() {
789
- const ptr = this.__wbg_ptr;
790
- this.__wbg_ptr = 0;
791
- PointFinalization.unregister(this);
792
- return ptr;
793
- }
794
- free() {
795
- const ptr = this.__destroy_into_raw();
796
- wasm.__wbg_point_free(ptr, 0);
797
- }
798
- /**
799
- * The x-coordinate (horizontal).
800
- * @returns {number}
801
- */
802
- get x() {
803
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
804
- return ret;
805
- }
806
- /**
807
- * The x-coordinate (horizontal).
808
- * @param {number} arg0
809
- */
810
- set x(arg0) {
811
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
812
- }
813
- /**
814
- * The y-coordinate (vertical).
815
- * @returns {number}
816
- */
817
- get y() {
818
- const ret = wasm.__wbg_get_layout_y(this.__wbg_ptr);
819
- return ret;
820
- }
821
- /**
822
- * The y-coordinate (vertical).
823
- * @param {number} arg0
824
- */
825
- set y(arg0) {
826
- wasm.__wbg_set_layout_y(this.__wbg_ptr, arg0);
827
- }
828
- }
829
- if (Symbol.dispose) Point.prototype[Symbol.dispose] = Point.prototype.free;
830
-
831
- /**
832
- * Positioning strategy for a node.
833
- * @enum {0 | 1 | 2}
834
- */
835
- export const Position = Object.freeze({
836
- /**
837
- * Relative to its normal position in the flow.
838
- */
839
- Static: 0, "0": "Static",
840
- /**
841
- * Relative to its normal position in the flow.
842
- */
843
- Relative: 1, "1": "Relative",
844
- /**
845
- * Removed from the flow and positioned relative to its containing block.
846
- */
847
- Absolute: 2, "2": "Absolute",
848
- });
849
-
850
- /**
851
- * Represents a rectangle defined by its edges.
852
- *
853
- * Used for padding, margin, properties.
854
- */
855
- export class Rect {
856
- __destroy_into_raw() {
857
- const ptr = this.__wbg_ptr;
858
- this.__wbg_ptr = 0;
859
- RectFinalization.unregister(this);
860
- return ptr;
861
- }
862
- free() {
863
- const ptr = this.__destroy_into_raw();
864
- wasm.__wbg_rect_free(ptr, 0);
865
- }
866
- /**
867
- * The left edge value.
868
- * @returns {number}
869
- */
870
- get left() {
871
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
872
- return ret;
873
- }
874
- /**
875
- * The left edge value.
876
- * @param {number} arg0
877
- */
878
- set left(arg0) {
879
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
880
- }
881
- /**
882
- * The right edge value.
883
- * @returns {number}
884
- */
885
- get right() {
886
- const ret = wasm.__wbg_get_layout_y(this.__wbg_ptr);
887
- return ret;
888
- }
889
- /**
890
- * The right edge value.
891
- * @param {number} arg0
892
- */
893
- set right(arg0) {
894
- wasm.__wbg_set_layout_y(this.__wbg_ptr, arg0);
895
- }
896
- /**
897
- * The top edge value.
898
- * @returns {number}
899
- */
900
- get top() {
901
- const ret = wasm.__wbg_get_layout_width(this.__wbg_ptr);
902
- return ret;
903
- }
904
- /**
905
- * The top edge value.
906
- * @param {number} arg0
907
- */
908
- set top(arg0) {
909
- wasm.__wbg_set_layout_width(this.__wbg_ptr, arg0);
910
- }
911
- /**
912
- * The bottom edge value.
913
- * @returns {number}
914
- */
915
- get bottom() {
916
- const ret = wasm.__wbg_get_layout_height(this.__wbg_ptr);
917
- return ret;
918
- }
919
- /**
920
- * The bottom edge value.
921
- * @param {number} arg0
922
- */
923
- set bottom(arg0) {
924
- wasm.__wbg_set_layout_height(this.__wbg_ptr, arg0);
925
- }
926
- }
927
- if (Symbol.dispose) Rect.prototype[Symbol.dispose] = Rect.prototype.free;
928
-
929
- /**
930
- * Represents a size in 2D space.
931
- *
932
- * Used for width and height dimensions.
933
- */
934
- export class Size {
935
- __destroy_into_raw() {
936
- const ptr = this.__wbg_ptr;
937
- this.__wbg_ptr = 0;
938
- SizeFinalization.unregister(this);
939
- return ptr;
940
- }
941
- free() {
942
- const ptr = this.__destroy_into_raw();
943
- wasm.__wbg_size_free(ptr, 0);
944
- }
945
- /**
946
- * The width dimension.
947
- * @returns {number}
948
- */
949
- get width() {
950
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
951
- return ret;
952
- }
953
- /**
954
- * The width dimension.
955
- * @param {number} arg0
956
- */
957
- set width(arg0) {
958
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
959
- }
960
- /**
961
- * The height dimension.
962
- * @returns {number}
963
- */
964
- get height() {
965
- const ret = wasm.__wbg_get_layout_y(this.__wbg_ptr);
966
- return ret;
967
- }
968
- /**
969
- * The height dimension.
970
- * @param {number} arg0
971
- */
972
- set height(arg0) {
973
- wasm.__wbg_set_layout_y(this.__wbg_ptr, arg0);
974
- }
975
- }
976
- if (Symbol.dispose) Size.prototype[Symbol.dispose] = Size.prototype.free;
977
-
978
- /**
979
- * Style values for a node.
980
- *
981
- * This struct aggregates all layout styles that can be applied to a node.
982
- * Optional fields allow partial updates or default values.
983
- */
984
- export class Style {
985
- __destroy_into_raw() {
986
- const ptr = this.__wbg_ptr;
987
- this.__wbg_ptr = 0;
988
- StyleFinalization.unregister(this);
989
- return ptr;
990
- }
991
- free() {
992
- const ptr = this.__destroy_into_raw();
993
- wasm.__wbg_style_free(ptr, 0);
994
- }
995
- /**
996
- * The display mode of the node (e.g. Flex, Grid, None).
997
- * @returns {Display | undefined}
998
- */
999
- get display() {
1000
- const ret = wasm.__wbg_get_style_display(this.__wbg_ptr);
1001
- return ret === 4 ? undefined : ret;
1002
- }
1003
- /**
1004
- * The display mode of the node (e.g. Flex, Grid, None).
1005
- * @param {Display | null} [arg0]
1006
- */
1007
- set display(arg0) {
1008
- wasm.__wbg_set_style_display(this.__wbg_ptr, isLikeNone(arg0) ? 4 : arg0);
1009
- }
1010
- /**
1011
- * The positioning strategy (e.g. Relative, Absolute).
1012
- * @returns {Position | undefined}
1013
- */
1014
- get position() {
1015
- const ret = wasm.__wbg_get_style_position(this.__wbg_ptr);
1016
- return ret === 3 ? undefined : ret;
1017
- }
1018
- /**
1019
- * The positioning strategy (e.g. Relative, Absolute).
1020
- * @param {Position | null} [arg0]
1021
- */
1022
- set position(arg0) {
1023
- wasm.__wbg_set_style_position(this.__wbg_ptr, isLikeNone(arg0) ? 3 : arg0);
1024
- }
1025
- /**
1026
- * The width of the node.
1027
- * @returns {Dimension | undefined}
1028
- */
1029
- get width() {
1030
- const ret = wasm.__wbg_get_style_width(this.__wbg_ptr);
1031
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1032
- }
1033
- /**
1034
- * The width of the node.
1035
- * @param {Dimension | null} [arg0]
1036
- */
1037
- set width(arg0) {
1038
- let ptr0 = 0;
1039
- if (!isLikeNone(arg0)) {
1040
- _assertClass(arg0, Dimension);
1041
- ptr0 = arg0.__destroy_into_raw();
1042
- }
1043
- wasm.__wbg_set_style_width(this.__wbg_ptr, ptr0);
1044
- }
1045
- /**
1046
- * The height of the node.
1047
- * @returns {Dimension | undefined}
1048
- */
1049
- get height() {
1050
- const ret = wasm.__wbg_get_style_height(this.__wbg_ptr);
1051
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1052
- }
1053
- /**
1054
- * The height of the node.
1055
- * @param {Dimension | null} [arg0]
1056
- */
1057
- set height(arg0) {
1058
- let ptr0 = 0;
1059
- if (!isLikeNone(arg0)) {
1060
- _assertClass(arg0, Dimension);
1061
- ptr0 = arg0.__destroy_into_raw();
1062
- }
1063
- wasm.__wbg_set_style_height(this.__wbg_ptr, ptr0);
1064
- }
1065
- /**
1066
- * The minimum width of the node.
1067
- * @returns {Dimension | undefined}
1068
- */
1069
- get min_width() {
1070
- const ret = wasm.__wbg_get_style_min_width(this.__wbg_ptr);
1071
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1072
- }
1073
- /**
1074
- * The minimum width of the node.
1075
- * @param {Dimension | null} [arg0]
1076
- */
1077
- set min_width(arg0) {
1078
- let ptr0 = 0;
1079
- if (!isLikeNone(arg0)) {
1080
- _assertClass(arg0, Dimension);
1081
- ptr0 = arg0.__destroy_into_raw();
1082
- }
1083
- wasm.__wbg_set_style_min_width(this.__wbg_ptr, ptr0);
1084
- }
1085
- /**
1086
- * The minimum height of the node.
1087
- * @returns {Dimension | undefined}
1088
- */
1089
- get min_height() {
1090
- const ret = wasm.__wbg_get_style_min_height(this.__wbg_ptr);
1091
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1092
- }
1093
- /**
1094
- * The minimum height of the node.
1095
- * @param {Dimension | null} [arg0]
1096
- */
1097
- set min_height(arg0) {
1098
- let ptr0 = 0;
1099
- if (!isLikeNone(arg0)) {
1100
- _assertClass(arg0, Dimension);
1101
- ptr0 = arg0.__destroy_into_raw();
1102
- }
1103
- wasm.__wbg_set_style_min_height(this.__wbg_ptr, ptr0);
1104
- }
1105
- /**
1106
- * The maximum width of the node.
1107
- * @returns {Dimension | undefined}
1108
- */
1109
- get max_width() {
1110
- const ret = wasm.__wbg_get_style_max_width(this.__wbg_ptr);
1111
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1112
- }
1113
- /**
1114
- * The maximum width of the node.
1115
- * @param {Dimension | null} [arg0]
1116
- */
1117
- set max_width(arg0) {
1118
- let ptr0 = 0;
1119
- if (!isLikeNone(arg0)) {
1120
- _assertClass(arg0, Dimension);
1121
- ptr0 = arg0.__destroy_into_raw();
1122
- }
1123
- wasm.__wbg_set_style_max_width(this.__wbg_ptr, ptr0);
1124
- }
1125
- /**
1126
- * The maximum height of the node.
1127
- * @returns {Dimension | undefined}
1128
- */
1129
- get max_height() {
1130
- const ret = wasm.__wbg_get_style_max_height(this.__wbg_ptr);
1131
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1132
- }
1133
- /**
1134
- * The maximum height of the node.
1135
- * @param {Dimension | null} [arg0]
1136
- */
1137
- set max_height(arg0) {
1138
- let ptr0 = 0;
1139
- if (!isLikeNone(arg0)) {
1140
- _assertClass(arg0, Dimension);
1141
- ptr0 = arg0.__destroy_into_raw();
1142
- }
1143
- wasm.__wbg_set_style_max_height(this.__wbg_ptr, ptr0);
1144
- }
1145
- /**
1146
- * The offset from the left edge (used with Position::Absolute/Relative).
1147
- * @returns {Dimension | undefined}
1148
- */
1149
- get left() {
1150
- const ret = wasm.__wbg_get_style_left(this.__wbg_ptr);
1151
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1152
- }
1153
- /**
1154
- * The offset from the left edge (used with Position::Absolute/Relative).
1155
- * @param {Dimension | null} [arg0]
1156
- */
1157
- set left(arg0) {
1158
- let ptr0 = 0;
1159
- if (!isLikeNone(arg0)) {
1160
- _assertClass(arg0, Dimension);
1161
- ptr0 = arg0.__destroy_into_raw();
1162
- }
1163
- wasm.__wbg_set_style_left(this.__wbg_ptr, ptr0);
1164
- }
1165
- /**
1166
- * The offset from the right edge.
1167
- * @returns {Dimension | undefined}
1168
- */
1169
- get right() {
1170
- const ret = wasm.__wbg_get_style_right(this.__wbg_ptr);
1171
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1172
- }
1173
- /**
1174
- * The offset from the right edge.
1175
- * @param {Dimension | null} [arg0]
1176
- */
1177
- set right(arg0) {
1178
- let ptr0 = 0;
1179
- if (!isLikeNone(arg0)) {
1180
- _assertClass(arg0, Dimension);
1181
- ptr0 = arg0.__destroy_into_raw();
1182
- }
1183
- wasm.__wbg_set_style_right(this.__wbg_ptr, ptr0);
1184
- }
1185
- /**
1186
- * The offset from the top edge.
1187
- * @returns {Dimension | undefined}
1188
- */
1189
- get top() {
1190
- const ret = wasm.__wbg_get_style_top(this.__wbg_ptr);
1191
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1192
- }
1193
- /**
1194
- * The offset from the top edge.
1195
- * @param {Dimension | null} [arg0]
1196
- */
1197
- set top(arg0) {
1198
- let ptr0 = 0;
1199
- if (!isLikeNone(arg0)) {
1200
- _assertClass(arg0, Dimension);
1201
- ptr0 = arg0.__destroy_into_raw();
1202
- }
1203
- wasm.__wbg_set_style_top(this.__wbg_ptr, ptr0);
1204
- }
1205
- /**
1206
- * The offset from the bottom edge.
1207
- * @returns {Dimension | undefined}
1208
- */
1209
- get bottom() {
1210
- const ret = wasm.__wbg_get_style_bottom(this.__wbg_ptr);
1211
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1212
- }
1213
- /**
1214
- * The offset from the bottom edge.
1215
- * @param {Dimension | null} [arg0]
1216
- */
1217
- set bottom(arg0) {
1218
- let ptr0 = 0;
1219
- if (!isLikeNone(arg0)) {
1220
- _assertClass(arg0, Dimension);
1221
- ptr0 = arg0.__destroy_into_raw();
1222
- }
1223
- wasm.__wbg_set_style_bottom(this.__wbg_ptr, ptr0);
1224
- }
1225
- /**
1226
- * The margin on the left side.
1227
- * @returns {Dimension | undefined}
1228
- */
1229
- get margin_left() {
1230
- const ret = wasm.__wbg_get_style_margin_left(this.__wbg_ptr);
1231
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1232
- }
1233
- /**
1234
- * The margin on the left side.
1235
- * @param {Dimension | null} [arg0]
1236
- */
1237
- set margin_left(arg0) {
1238
- let ptr0 = 0;
1239
- if (!isLikeNone(arg0)) {
1240
- _assertClass(arg0, Dimension);
1241
- ptr0 = arg0.__destroy_into_raw();
1242
- }
1243
- wasm.__wbg_set_style_margin_left(this.__wbg_ptr, ptr0);
1244
- }
1245
- /**
1246
- * The margin on the right side.
1247
- * @returns {Dimension | undefined}
1248
- */
1249
- get margin_right() {
1250
- const ret = wasm.__wbg_get_style_margin_right(this.__wbg_ptr);
1251
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1252
- }
1253
- /**
1254
- * The margin on the right side.
1255
- * @param {Dimension | null} [arg0]
1256
- */
1257
- set margin_right(arg0) {
1258
- let ptr0 = 0;
1259
- if (!isLikeNone(arg0)) {
1260
- _assertClass(arg0, Dimension);
1261
- ptr0 = arg0.__destroy_into_raw();
1262
- }
1263
- wasm.__wbg_set_style_margin_right(this.__wbg_ptr, ptr0);
1264
- }
1265
- /**
1266
- * The margin on the top side.
1267
- * @returns {Dimension | undefined}
1268
- */
1269
- get margin_top() {
1270
- const ret = wasm.__wbg_get_style_margin_top(this.__wbg_ptr);
1271
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1272
- }
1273
- /**
1274
- * The margin on the top side.
1275
- * @param {Dimension | null} [arg0]
1276
- */
1277
- set margin_top(arg0) {
1278
- let ptr0 = 0;
1279
- if (!isLikeNone(arg0)) {
1280
- _assertClass(arg0, Dimension);
1281
- ptr0 = arg0.__destroy_into_raw();
1282
- }
1283
- wasm.__wbg_set_style_margin_top(this.__wbg_ptr, ptr0);
1284
- }
1285
- /**
1286
- * The margin on the bottom side.
1287
- * @returns {Dimension | undefined}
1288
- */
1289
- get margin_bottom() {
1290
- const ret = wasm.__wbg_get_style_margin_bottom(this.__wbg_ptr);
1291
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1292
- }
1293
- /**
1294
- * The margin on the bottom side.
1295
- * @param {Dimension | null} [arg0]
1296
- */
1297
- set margin_bottom(arg0) {
1298
- let ptr0 = 0;
1299
- if (!isLikeNone(arg0)) {
1300
- _assertClass(arg0, Dimension);
1301
- ptr0 = arg0.__destroy_into_raw();
1302
- }
1303
- wasm.__wbg_set_style_margin_bottom(this.__wbg_ptr, ptr0);
1304
- }
1305
- /**
1306
- * The padding on the left side.
1307
- * @returns {Dimension | undefined}
1308
- */
1309
- get padding_left() {
1310
- const ret = wasm.__wbg_get_style_padding_left(this.__wbg_ptr);
1311
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1312
- }
1313
- /**
1314
- * The padding on the left side.
1315
- * @param {Dimension | null} [arg0]
1316
- */
1317
- set padding_left(arg0) {
1318
- let ptr0 = 0;
1319
- if (!isLikeNone(arg0)) {
1320
- _assertClass(arg0, Dimension);
1321
- ptr0 = arg0.__destroy_into_raw();
1322
- }
1323
- wasm.__wbg_set_style_padding_left(this.__wbg_ptr, ptr0);
1324
- }
1325
- /**
1326
- * The padding on the right side.
1327
- * @returns {Dimension | undefined}
1328
- */
1329
- get padding_right() {
1330
- const ret = wasm.__wbg_get_style_padding_right(this.__wbg_ptr);
1331
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1332
- }
1333
- /**
1334
- * The padding on the right side.
1335
- * @param {Dimension | null} [arg0]
1336
- */
1337
- set padding_right(arg0) {
1338
- let ptr0 = 0;
1339
- if (!isLikeNone(arg0)) {
1340
- _assertClass(arg0, Dimension);
1341
- ptr0 = arg0.__destroy_into_raw();
1342
- }
1343
- wasm.__wbg_set_style_padding_right(this.__wbg_ptr, ptr0);
1344
- }
1345
- /**
1346
- * The padding on the top side.
1347
- * @returns {Dimension | undefined}
1348
- */
1349
- get padding_top() {
1350
- const ret = wasm.__wbg_get_style_padding_top(this.__wbg_ptr);
1351
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1352
- }
1353
- /**
1354
- * The padding on the top side.
1355
- * @param {Dimension | null} [arg0]
1356
- */
1357
- set padding_top(arg0) {
1358
- let ptr0 = 0;
1359
- if (!isLikeNone(arg0)) {
1360
- _assertClass(arg0, Dimension);
1361
- ptr0 = arg0.__destroy_into_raw();
1362
- }
1363
- wasm.__wbg_set_style_padding_top(this.__wbg_ptr, ptr0);
1364
- }
1365
- /**
1366
- * The padding on the bottom side.
1367
- * @returns {Dimension | undefined}
1368
- */
1369
- get padding_bottom() {
1370
- const ret = wasm.__wbg_get_style_padding_bottom(this.__wbg_ptr);
1371
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1372
- }
1373
- /**
1374
- * The padding on the bottom side.
1375
- * @param {Dimension | null} [arg0]
1376
- */
1377
- set padding_bottom(arg0) {
1378
- let ptr0 = 0;
1379
- if (!isLikeNone(arg0)) {
1380
- _assertClass(arg0, Dimension);
1381
- ptr0 = arg0.__destroy_into_raw();
1382
- }
1383
- wasm.__wbg_set_style_padding_bottom(this.__wbg_ptr, ptr0);
1384
- }
1385
- /**
1386
- * The flex direction (e.g. Row, Column).
1387
- * @returns {FlexDirection | undefined}
1388
- */
1389
- get flex_direction() {
1390
- const ret = wasm.__wbg_get_style_flex_direction(this.__wbg_ptr);
1391
- return ret === 4 ? undefined : ret;
1392
- }
1393
- /**
1394
- * The flex direction (e.g. Row, Column).
1395
- * @param {FlexDirection | null} [arg0]
1396
- */
1397
- set flex_direction(arg0) {
1398
- wasm.__wbg_set_style_flex_direction(this.__wbg_ptr, isLikeNone(arg0) ? 4 : arg0);
1399
- }
1400
- /**
1401
- * Whether flex items should wrap.
1402
- * @returns {FlexWrap | undefined}
1403
- */
1404
- get flex_wrap() {
1405
- const ret = wasm.__wbg_get_style_flex_wrap(this.__wbg_ptr);
1406
- return ret === 3 ? undefined : ret;
1407
- }
1408
- /**
1409
- * Whether flex items should wrap.
1410
- * @param {FlexWrap | null} [arg0]
1411
- */
1412
- set flex_wrap(arg0) {
1413
- wasm.__wbg_set_style_flex_wrap(this.__wbg_ptr, isLikeNone(arg0) ? 3 : arg0);
1414
- }
1415
- /**
1416
- * How much the item will grow relative to the rest of the flexible items.
1417
- * @returns {number | undefined}
1418
- */
1419
- get flex_grow() {
1420
- const ret = wasm.__wbg_get_availablespace_width(this.__wbg_ptr);
1421
- return ret === 0x100000001 ? undefined : ret;
1422
- }
1423
- /**
1424
- * How much the item will grow relative to the rest of the flexible items.
1425
- * @param {number | null} [arg0]
1426
- */
1427
- set flex_grow(arg0) {
1428
- wasm.__wbg_set_availablespace_width(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : Math.fround(arg0));
1429
- }
1430
- /**
1431
- * How much the item will shrink relative to the rest of the flexible items.
1432
- * @returns {number | undefined}
1433
- */
1434
- get flex_shrink() {
1435
- const ret = wasm.__wbg_get_availablespace_height(this.__wbg_ptr);
1436
- return ret === 0x100000001 ? undefined : ret;
1437
- }
1438
- /**
1439
- * How much the item will shrink relative to the rest of the flexible items.
1440
- * @param {number | null} [arg0]
1441
- */
1442
- set flex_shrink(arg0) {
1443
- wasm.__wbg_set_availablespace_height(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : Math.fround(arg0));
1444
- }
1445
- /**
1446
- * The initial main size of a flex item.
1447
- * @returns {Dimension | undefined}
1448
- */
1449
- get flex_basis() {
1450
- const ret = wasm.__wbg_get_style_flex_basis(this.__wbg_ptr);
1451
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1452
- }
1453
- /**
1454
- * The initial main size of a flex item.
1455
- * @param {Dimension | null} [arg0]
1456
- */
1457
- set flex_basis(arg0) {
1458
- let ptr0 = 0;
1459
- if (!isLikeNone(arg0)) {
1460
- _assertClass(arg0, Dimension);
1461
- ptr0 = arg0.__destroy_into_raw();
1462
- }
1463
- wasm.__wbg_set_style_flex_basis(this.__wbg_ptr, ptr0);
1464
- }
1465
- /**
1466
- * How items are distributed along the main axis.
1467
- * @returns {JustifyContent | undefined}
1468
- */
1469
- get justify_content() {
1470
- const ret = wasm.__wbg_get_style_justify_content(this.__wbg_ptr);
1471
- return ret === 8 ? undefined : ret;
1472
- }
1473
- /**
1474
- * How items are distributed along the main axis.
1475
- * @param {JustifyContent | null} [arg0]
1476
- */
1477
- set justify_content(arg0) {
1478
- wasm.__wbg_set_style_justify_content(this.__wbg_ptr, isLikeNone(arg0) ? 8 : arg0);
1479
- }
1480
- /**
1481
- * How items are aligned along the cross axis.
1482
- * @returns {AlignItems | undefined}
1483
- */
1484
- get align_items() {
1485
- const ret = wasm.__wbg_get_style_align_items(this.__wbg_ptr);
1486
- return ret === 7 ? undefined : ret;
1487
- }
1488
- /**
1489
- * How items are aligned along the cross axis.
1490
- * @param {AlignItems | null} [arg0]
1491
- */
1492
- set align_items(arg0) {
1493
- wasm.__wbg_set_style_align_items(this.__wbg_ptr, isLikeNone(arg0) ? 7 : arg0);
1494
- }
1495
- /**
1496
- * How a single item is aligned along the cross axis.
1497
- * @returns {AlignSelf | undefined}
1498
- */
1499
- get align_self() {
1500
- const ret = wasm.__wbg_get_style_align_self(this.__wbg_ptr);
1501
- return ret === 8 ? undefined : ret;
1502
- }
1503
- /**
1504
- * How a single item is aligned along the cross axis.
1505
- * @param {AlignSelf | null} [arg0]
1506
- */
1507
- set align_self(arg0) {
1508
- wasm.__wbg_set_style_align_self(this.__wbg_ptr, isLikeNone(arg0) ? 8 : arg0);
1509
- }
1510
- /**
1511
- * How lines of content are aligned along the cross axis.
1512
- * @returns {AlignContent | undefined}
1513
- */
1514
- get align_content() {
1515
- const ret = wasm.__wbg_get_style_align_content(this.__wbg_ptr);
1516
- return ret === 9 ? undefined : ret;
1517
- }
1518
- /**
1519
- * How lines of content are aligned along the cross axis.
1520
- * @param {AlignContent | null} [arg0]
1521
- */
1522
- set align_content(arg0) {
1523
- wasm.__wbg_set_style_align_content(this.__wbg_ptr, isLikeNone(arg0) ? 9 : arg0);
1524
- }
1525
- /**
1526
- * The gap between rows (flex/grid).
1527
- * @returns {Dimension | undefined}
1528
- */
1529
- get row_gap() {
1530
- const ret = wasm.__wbg_get_style_row_gap(this.__wbg_ptr);
1531
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1532
- }
1533
- /**
1534
- * The gap between rows (flex/grid).
1535
- * @param {Dimension | null} [arg0]
1536
- */
1537
- set row_gap(arg0) {
1538
- let ptr0 = 0;
1539
- if (!isLikeNone(arg0)) {
1540
- _assertClass(arg0, Dimension);
1541
- ptr0 = arg0.__destroy_into_raw();
1542
- }
1543
- wasm.__wbg_set_style_row_gap(this.__wbg_ptr, ptr0);
1544
- }
1545
- /**
1546
- * The gap between columns (flex/grid).
1547
- * @returns {Dimension | undefined}
1548
- */
1549
- get column_gap() {
1550
- const ret = wasm.__wbg_get_style_column_gap(this.__wbg_ptr);
1551
- return ret === 0 ? undefined : Dimension.__wrap(ret);
1552
- }
1553
- /**
1554
- * The gap between columns (flex/grid).
1555
- * @param {Dimension | null} [arg0]
1556
- */
1557
- set column_gap(arg0) {
1558
- let ptr0 = 0;
1559
- if (!isLikeNone(arg0)) {
1560
- _assertClass(arg0, Dimension);
1561
- ptr0 = arg0.__destroy_into_raw();
1562
- }
1563
- wasm.__wbg_set_style_column_gap(this.__wbg_ptr, ptr0);
1564
- }
1565
- /**
1566
- * Algorithm for auto-placing items in the grid.
1567
- * @returns {GridAutoFlow | undefined}
1568
- */
1569
- get grid_auto_flow() {
1570
- const ret = wasm.__wbg_get_style_grid_auto_flow(this.__wbg_ptr);
1571
- return ret === 4 ? undefined : ret;
1572
- }
1573
- /**
1574
- * Algorithm for auto-placing items in the grid.
1575
- * @param {GridAutoFlow | null} [arg0]
1576
- */
1577
- set grid_auto_flow(arg0) {
1578
- wasm.__wbg_set_style_grid_auto_flow(this.__wbg_ptr, isLikeNone(arg0) ? 4 : arg0);
1579
- }
1580
- /**
1581
- * Text alignment.
1582
- * @returns {TextAlign | undefined}
1583
- */
1584
- get text_align() {
1585
- const ret = wasm.__wbg_get_style_text_align(this.__wbg_ptr);
1586
- return ret === 5 ? undefined : ret;
1587
- }
1588
- /**
1589
- * Text alignment.
1590
- * @param {TextAlign | null} [arg0]
1591
- */
1592
- set text_align(arg0) {
1593
- wasm.__wbg_set_style_text_align(this.__wbg_ptr, isLikeNone(arg0) ? 5 : arg0);
1594
- }
1595
- }
1596
- if (Symbol.dispose) Style.prototype[Symbol.dispose] = Style.prototype.free;
1597
-
1598
- export class TaffyNode {
1599
- __destroy_into_raw() {
1600
- const ptr = this.__wbg_ptr;
1601
- this.__wbg_ptr = 0;
1602
- TaffyNodeFinalization.unregister(this);
1603
- return ptr;
1604
- }
1605
- free() {
1606
- const ptr = this.__destroy_into_raw();
1607
- wasm.__wbg_taffynode_free(ptr, 0);
1608
- }
1609
- /**
1610
- * @returns {bigint}
1611
- */
1612
- get id() {
1613
- const ret = wasm.__wbg_get_taffynode_id(this.__wbg_ptr);
1614
- return BigInt.asUintN(64, ret);
1615
- }
1616
- /**
1617
- * @param {bigint} arg0
1618
- */
1619
- set id(arg0) {
1620
- wasm.__wbg_set_taffynode_id(this.__wbg_ptr, arg0);
1621
- }
1622
- /**
1623
- * @returns {Layout}
1624
- */
1625
- getLayout() {
1626
- const ret = wasm.taffynode_getLayout(this.__wbg_ptr);
1627
- if (ret[2]) {
1628
- throw takeFromExternrefTable0(ret[1]);
1629
- }
1630
- return Layout.__wrap(ret[0]);
1631
- }
1632
- markDirty() {
1633
- const ret = wasm.taffynode_markDirty(this.__wbg_ptr);
1634
- if (ret[1]) {
1635
- throw takeFromExternrefTable0(ret[0]);
1636
- }
1637
- }
1638
- /**
1639
- * @param {Edge} edge
1640
- * @param {number} value
1641
- */
1642
- setBorder(edge, value) {
1643
- const ret = wasm.taffynode_setBorder(this.__wbg_ptr, edge, value);
1644
- if (ret[1]) {
1645
- throw takeFromExternrefTable0(ret[0]);
1646
- }
1647
- }
1648
- /**
1649
- * @param {number} value
1650
- */
1651
- setHeight(value) {
1652
- const ret = wasm.taffynode_setHeight(this.__wbg_ptr, value);
1653
- if (ret[1]) {
1654
- throw takeFromExternrefTable0(ret[0]);
1655
- }
1656
- }
1657
- /**
1658
- * @param {Edge} edge
1659
- * @param {number} value
1660
- */
1661
- setMargin(edge, value) {
1662
- const ret = wasm.taffynode_setMargin(this.__wbg_ptr, edge, value);
1663
- if (ret[1]) {
1664
- throw takeFromExternrefTable0(ret[0]);
1665
- }
1666
- }
1667
- /**
1668
- * @param {Display} display
1669
- */
1670
- setDisplay(display) {
1671
- const ret = wasm.taffynode_setDisplay(this.__wbg_ptr, display);
1672
- if (ret[1]) {
1673
- throw takeFromExternrefTable0(ret[0]);
1674
- }
1675
- }
1676
- /**
1677
- * @param {Edge} edge
1678
- * @param {number} value
1679
- */
1680
- setPadding(edge, value) {
1681
- const ret = wasm.taffynode_setPadding(this.__wbg_ptr, edge, value);
1682
- if (ret[1]) {
1683
- throw takeFromExternrefTable0(ret[0]);
1684
- }
1685
- }
1686
- /**
1687
- * @param {TaffyNode} child
1688
- * @param {number} index
1689
- */
1690
- insertChild(child, index) {
1691
- _assertClass(child, TaffyNode);
1692
- const ret = wasm.taffynode_insertChild(this.__wbg_ptr, child.__wbg_ptr, index);
1693
- if (ret[1]) {
1694
- throw takeFromExternrefTable0(ret[0]);
1695
- }
1696
- }
1697
- /**
1698
- * @param {TaffyNode} child
1699
- */
1700
- removeChild(child) {
1701
- _assertClass(child, TaffyNode);
1702
- const ret = wasm.taffynode_removeChild(this.__wbg_ptr, child.__wbg_ptr);
1703
- if (ret[1]) {
1704
- throw takeFromExternrefTable0(ret[0]);
1705
- }
1706
- }
1707
- /**
1708
- * @param {BigUint64Array} children
1709
- */
1710
- setChildren(children) {
1711
- const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
1712
- const len0 = WASM_VECTOR_LEN;
1713
- const ret = wasm.taffynode_setChildren(this.__wbg_ptr, ptr0, len0);
1714
- if (ret[1]) {
1715
- throw takeFromExternrefTable0(ret[0]);
1716
- }
1717
- }
1718
- /**
1719
- * @param {number} value
1720
- */
1721
- setFlexGrow(value) {
1722
- const ret = wasm.taffynode_setFlexGrow(this.__wbg_ptr, value);
1723
- if (ret[1]) {
1724
- throw takeFromExternrefTable0(ret[0]);
1725
- }
1726
- }
1727
- /**
1728
- * @param {FlexWrap} wrap
1729
- */
1730
- setFlexWrap(wrap) {
1731
- const ret = wasm.taffynode_setFlexWrap(this.__wbg_ptr, wrap);
1732
- if (ret[1]) {
1733
- throw takeFromExternrefTable0(ret[0]);
1734
- }
1735
- }
1736
- /**
1737
- * @param {number} value
1738
- */
1739
- setMinWidth(value) {
1740
- const ret = wasm.taffynode_setMinWidth(this.__wbg_ptr, value);
1741
- if (ret[1]) {
1742
- throw takeFromExternrefTable0(ret[0]);
1743
- }
1744
- }
1745
- /**
1746
- * @param {any} available_space
1747
- */
1748
- computeLayout(available_space) {
1749
- const ret = wasm.taffynode_computeLayout(this.__wbg_ptr, available_space);
1750
- if (ret[1]) {
1751
- throw takeFromExternrefTable0(ret[0]);
1752
- }
1753
- }
1754
- /**
1755
- * @param {AlignSelf} align
1756
- */
1757
- setAlignSelf(align) {
1758
- const ret = wasm.taffynode_setAlignSelf(this.__wbg_ptr, align);
1759
- if (ret[1]) {
1760
- throw takeFromExternrefTable0(ret[0]);
1761
- }
1762
- }
1763
- /**
1764
- * @param {number} value
1765
- */
1766
- setFlexBasis(value) {
1767
- const ret = wasm.taffynode_setFlexBasis(this.__wbg_ptr, value);
1768
- if (ret[1]) {
1769
- throw takeFromExternrefTable0(ret[0]);
1770
- }
1771
- }
1772
- /**
1773
- * @param {number} value
1774
- */
1775
- setMinHeight(value) {
1776
- const ret = wasm.taffynode_setMinHeight(this.__wbg_ptr, value);
1777
- if (ret[1]) {
1778
- throw takeFromExternrefTable0(ret[0]);
1779
- }
1780
- }
1781
- setWidthAuto() {
1782
- const ret = wasm.taffynode_setWidthAuto(this.__wbg_ptr);
1783
- if (ret[1]) {
1784
- throw takeFromExternrefTable0(ret[0]);
1785
- }
1786
- }
1787
- /**
1788
- * @param {AlignItems} align
1789
- */
1790
- setAlignItems(align) {
1791
- const ret = wasm.taffynode_setAlignItems(this.__wbg_ptr, align);
1792
- if (ret[1]) {
1793
- throw takeFromExternrefTable0(ret[0]);
1794
- }
1795
- }
1796
- /**
1797
- * @param {number} value
1798
- */
1799
- setFlexShrink(value) {
1800
- const ret = wasm.taffynode_setFlexShrink(this.__wbg_ptr, value);
1801
- if (ret[1]) {
1802
- throw takeFromExternrefTable0(ret[0]);
1803
- }
1804
- }
1805
- setHeightAuto() {
1806
- const ret = wasm.taffynode_setHeightAuto(this.__wbg_ptr);
1807
- if (ret[1]) {
1808
- throw takeFromExternrefTable0(ret[0]);
1809
- }
1810
- }
1811
- /**
1812
- * @param {Edge} edge
1813
- */
1814
- setMarginAuto(edge) {
1815
- const ret = wasm.taffynode_setMarginAuto(this.__wbg_ptr, edge);
1816
- if (ret[1]) {
1817
- throw takeFromExternrefTable0(ret[0]);
1818
- }
1819
- }
1820
- /**
1821
- * @param {Function} js_func
1822
- */
1823
- setMeasureFunc(js_func) {
1824
- const ret = wasm.taffynode_setMeasureFunc(this.__wbg_ptr, js_func);
1825
- if (ret[1]) {
1826
- throw takeFromExternrefTable0(ret[0]);
1827
- }
1828
- }
1829
- /**
1830
- * @param {Position} position
1831
- */
1832
- setPositionType(position) {
1833
- const ret = wasm.taffynode_setPositionType(this.__wbg_ptr, position);
1834
- if (ret[1]) {
1835
- throw takeFromExternrefTable0(ret[0]);
1836
- }
1837
- }
1838
- /**
1839
- * @param {number} value
1840
- */
1841
- setWidthPercent(value) {
1842
- const ret = wasm.taffynode_setWidthPercent(this.__wbg_ptr, value);
1843
- if (ret[1]) {
1844
- throw takeFromExternrefTable0(ret[0]);
1845
- }
1846
- }
1847
- /**
1848
- * @param {FlexDirection} direction
1849
- */
1850
- setFlexDirection(direction) {
1851
- const ret = wasm.taffynode_setFlexDirection(this.__wbg_ptr, direction);
1852
- if (ret[1]) {
1853
- throw takeFromExternrefTable0(ret[0]);
1854
- }
1855
- }
1856
- /**
1857
- * @param {number} value
1858
- */
1859
- setHeightPercent(value) {
1860
- const ret = wasm.taffynode_setHeightPercent(this.__wbg_ptr, value);
1861
- if (ret[1]) {
1862
- throw takeFromExternrefTable0(ret[0]);
1863
- }
1864
- }
1865
- setFlexBasisAuto() {
1866
- const ret = wasm.taffynode_setFlexBasisAuto(this.__wbg_ptr);
1867
- if (ret[1]) {
1868
- throw takeFromExternrefTable0(ret[0]);
1869
- }
1870
- }
1871
- /**
1872
- * @param {JustifyContent} justify
1873
- */
1874
- setJustifyContent(justify) {
1875
- const ret = wasm.taffynode_setJustifyContent(this.__wbg_ptr, justify);
1876
- if (ret[1]) {
1877
- throw takeFromExternrefTable0(ret[0]);
1878
- }
1879
- }
1880
- /**
1881
- * @param {number} value
1882
- */
1883
- setMinWidthPercent(value) {
1884
- const ret = wasm.taffynode_setMinWidthPercent(this.__wbg_ptr, value);
1885
- if (ret[1]) {
1886
- throw takeFromExternrefTable0(ret[0]);
1887
- }
1888
- }
1889
- /**
1890
- * @param {number} value
1891
- */
1892
- setFlexBasisPercent(value) {
1893
- const ret = wasm.taffynode_setFlexBasisPercent(this.__wbg_ptr, value);
1894
- if (ret[1]) {
1895
- throw takeFromExternrefTable0(ret[0]);
1896
- }
1897
- }
1898
- /**
1899
- * @param {number} value
1900
- */
1901
- setMinHeightPercent(value) {
1902
- const ret = wasm.taffynode_setMinHeightPercent(this.__wbg_ptr, value);
1903
- if (ret[1]) {
1904
- throw takeFromExternrefTable0(ret[0]);
1905
- }
1906
- }
1907
- /**
1908
- * @param {any} style
1909
- */
1910
- constructor(style) {
1911
- const ret = wasm.taffynode_new(style);
1912
- if (ret[2]) {
1913
- throw takeFromExternrefTable0(ret[1]);
1914
- }
1915
- this.__wbg_ptr = ret[0] >>> 0;
1916
- TaffyNodeFinalization.register(this, this.__wbg_ptr, this);
1917
- return this;
1918
- }
1919
- free() {
1920
- const ptr = this.__destroy_into_raw();
1921
- const ret = wasm.taffynode_free(ptr);
1922
- if (ret[1]) {
1923
- throw takeFromExternrefTable0(ret[0]);
1924
- }
1925
- }
1926
- /**
1927
- * @returns {any}
1928
- */
1929
- style() {
1930
- const ret = wasm.taffynode_style(this.__wbg_ptr);
1931
- if (ret[2]) {
1932
- throw takeFromExternrefTable0(ret[1]);
1933
- }
1934
- return takeFromExternrefTable0(ret[0]);
1935
- }
1936
- /**
1937
- * @param {Gutter} gutter
1938
- * @param {number} value
1939
- */
1940
- setGap(gutter, value) {
1941
- const ret = wasm.taffynode_setGap(this.__wbg_ptr, gutter, value);
1942
- if (ret[1]) {
1943
- throw takeFromExternrefTable0(ret[0]);
1944
- }
1945
- }
1946
- /**
1947
- * @param {TaffyNode} child
1948
- */
1949
- addChild(child) {
1950
- _assertClass(child, TaffyNode);
1951
- const ret = wasm.taffynode_addChild(this.__wbg_ptr, child.__wbg_ptr);
1952
- if (ret[1]) {
1953
- throw takeFromExternrefTable0(ret[0]);
1954
- }
1955
- }
1956
- /**
1957
- * @param {any} style
1958
- */
1959
- set_style(style) {
1960
- const ret = wasm.taffynode_set_style(this.__wbg_ptr, style);
1961
- if (ret[1]) {
1962
- throw takeFromExternrefTable0(ret[0]);
1963
- }
1964
- }
1965
- /**
1966
- * @param {number} value
1967
- */
1968
- setWidth(value) {
1969
- const ret = wasm.taffynode_setWidth(this.__wbg_ptr, value);
1970
- if (ret[1]) {
1971
- throw takeFromExternrefTable0(ret[0]);
1972
- }
1973
- }
1974
- }
1975
- if (Symbol.dispose) TaffyNode.prototype[Symbol.dispose] = TaffyNode.prototype.free;
1976
-
1977
- /**
1978
- * Text alignment within a node (mostly ignored in flex/grid layout but preserved for compatibility).
1979
- * @enum {0 | 1 | 2 | 3 | 4}
1980
- */
1981
- export const TextAlign = Object.freeze({
1982
- Auto: 0, "0": "Auto",
1983
- Left: 1, "1": "Left",
1984
- Right: 2, "2": "Right",
1985
- Center: 3, "3": "Center",
1986
- Justify: 4, "4": "Justify",
1987
- });
1988
-
1989
- /**
1990
- * Definition of a single grid track (row or column).
1991
- */
1992
- export class TrackDefinition {
1993
- __destroy_into_raw() {
1994
- const ptr = this.__wbg_ptr;
1995
- this.__wbg_ptr = 0;
1996
- TrackDefinitionFinalization.unregister(this);
1997
- return ptr;
1998
- }
1999
- free() {
2000
- const ptr = this.__destroy_into_raw();
2001
- wasm.__wbg_trackdefinition_free(ptr, 0);
2002
- }
2003
- /**
2004
- * The numeric value of the track size.
2005
- * @returns {number}
2006
- */
2007
- get value() {
2008
- const ret = wasm.__wbg_get_dimension_value(this.__wbg_ptr);
2009
- return ret;
2010
- }
2011
- /**
2012
- * The numeric value of the track size.
2013
- * @param {number} arg0
2014
- */
2015
- set value(arg0) {
2016
- wasm.__wbg_set_dimension_value(this.__wbg_ptr, arg0);
2017
- }
2018
- /**
2019
- * The unit of the track size.
2020
- * @returns {TrackUnit}
2021
- */
2022
- get unit() {
2023
- const ret = wasm.__wbg_get_trackdefinition_unit(this.__wbg_ptr);
2024
- return ret;
2025
- }
2026
- /**
2027
- * The unit of the track size.
2028
- * @param {TrackUnit} arg0
2029
- */
2030
- set unit(arg0) {
2031
- wasm.__wbg_set_trackdefinition_unit(this.__wbg_ptr, arg0);
2032
- }
2033
- }
2034
- if (Symbol.dispose) TrackDefinition.prototype[Symbol.dispose] = TrackDefinition.prototype.free;
2035
-
2036
- /**
2037
- * The unit for a grid track definition.
2038
- * @enum {0 | 1 | 2 | 3 | 4 | 5}
2039
- */
2040
- export const TrackUnit = Object.freeze({
2041
- /**
2042
- * The track size is specified in logical pixels.
2043
- */
2044
- Pixels: 0, "0": "Pixels",
2045
- /**
2046
- * The track size is specified as a percentage of the container.
2047
- */
2048
- Percent: 1, "1": "Percent",
2049
- /**
2050
- * The track size is a fraction of the remaining free space (fr unit).
2051
- */
2052
- Fraction: 2, "2": "Fraction",
2053
- /**
2054
- * The track size is determined automatically.
2055
- */
2056
- Auto: 3, "3": "Auto",
2057
- /**
2058
- * The track size is the minimum size needed to fit the content.
2059
- */
2060
- MinContent: 4, "4": "MinContent",
2061
- /**
2062
- * The track size is the maximum size needed to fit the content.
2063
- */
2064
- MaxContent: 5, "5": "MaxContent",
2065
- });
2066
-
2067
- /**
2068
- * Adds a child node to a parent node.
2069
- *
2070
- * # Arguments
2071
- *
2072
- * * `parent` - The ID of the parent node.
2073
- * * `child` - The ID of the child node to add.
2074
- *
2075
- * # Errors
2076
- *
2077
- * Returns a `JsValue` error if the operation fails (e.g., recursive hierarchy).
2078
- * @param {bigint} parent
2079
- * @param {bigint} child
2080
- */
2081
- export function add_child(parent, child) {
2082
- const ret = wasm.add_child(parent, child);
2083
- if (ret[1]) {
2084
- throw takeFromExternrefTable0(ret[0]);
2085
- }
2086
- }
2087
-
2088
- /**
2089
- * Auto dimension constant
2090
- * @returns {Dimension}
2091
- */
2092
- export function auto() {
2093
- const ret = wasm.auto();
2094
- return Dimension.__wrap(ret);
2095
- }
2096
-
2097
- /**
2098
- * Clear all nodes from the layout tree.
2099
- *
2100
- * This removes all nodes and resets the tree to an empty state.
2101
- * Any existing node IDs become invalid after this call.
2102
- */
2103
- export function clear() {
2104
- const ret = wasm.clear();
2105
- if (ret[1]) {
2106
- throw takeFromExternrefTable0(ret[0]);
2107
- }
2108
- }
2109
-
2110
- /**
2111
- * Computes the layout for a tree starting from the specified root node.
2112
- *
2113
- * # Arguments
2114
- *
2115
- * * `root` - The ID of the root node of the tree to lay out.
2116
- * * `available_space` - The available space constraints for the layout.
2117
- *
2118
- * # Errors
2119
- *
2120
- * Returns a `JsValue` error if the layout computation fails.
2121
- * @param {bigint} root
2122
- * @param {any} available_space
2123
- */
2124
- export function compute_layout(root, available_space) {
2125
- const ret = wasm.compute_layout(root, available_space);
2126
- if (ret[1]) {
2127
- throw takeFromExternrefTable0(ret[0]);
2128
- }
2129
- }
2130
-
2131
- /**
2132
- * Helper function to create a dimension
2133
- * @param {number} value
2134
- * @param {DimensionUnit} unit
2135
- * @returns {Dimension}
2136
- */
2137
- export function dimension(value, unit) {
2138
- const ret = wasm.dimension(value, unit);
2139
- return Dimension.__wrap(ret);
2140
- }
2141
-
2142
- /**
2143
- * Retrieves the list of children IDs for a given node.
2144
- *
2145
- * # Arguments
2146
- *
2147
- * * `parent` - The ID of the parent node.
2148
- *
2149
- * # Returns
2150
- *
2151
- * A boxed array of child node IDs (`Box<[u32]>`).
2152
- *
2153
- * # Errors
2154
- *
2155
- * Returns a `JsValue` error if the node does not exist.
2156
- * @param {bigint} parent
2157
- * @returns {BigUint64Array}
2158
- */
2159
- export function get_children(parent) {
2160
- const ret = wasm.get_children(parent);
2161
- if (ret[3]) {
2162
- throw takeFromExternrefTable0(ret[2]);
2163
- }
2164
- var v1 = getArrayU64FromWasm0(ret[0], ret[1]).slice();
2165
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
2166
- return v1;
2167
- }
2168
-
2169
- /**
2170
- * Retrieves the computed layout information for a specific node.
2171
- *
2172
- * # Arguments
2173
- *
2174
- * * `node` - The ID of the node to query.
2175
- *
2176
- * # Returns
2177
- *
2178
- * A `Layout` object containing the x, y, width, and height of the node.
2179
- *
2180
- * # Errors
2181
- *
2182
- * Returns a `JsValue` error if the node does not exist or layout information is unavailable.
2183
- * @param {bigint} node
2184
- * @returns {any}
2185
- */
2186
- export function get_layout(node) {
2187
- const ret = wasm.get_layout(node);
2188
- if (ret[2]) {
2189
- throw takeFromExternrefTable0(ret[1]);
2190
- }
2191
- return takeFromExternrefTable0(ret[0]);
2192
- }
2193
-
2194
- /**
2195
- * Retrieves the parent ID of a given node.
2196
- *
2197
- * # Arguments
2198
- *
2199
- * * `node` - The ID of the node to query.
2200
- *
2201
- * # Returns
2202
- *
2203
- * An `Option<u32>` containing the parent ID if it exists, or `None` if the node is a root or orphan.
2204
- *
2205
- * # Errors
2206
- *
2207
- * Returns a `JsValue` error if internal tree access fails.
2208
- * @param {bigint} node
2209
- * @returns {bigint | undefined}
2210
- */
2211
- export function get_parent(node) {
2212
- const ret = wasm.get_parent(node);
2213
- if (ret[3]) {
2214
- throw takeFromExternrefTable0(ret[2]);
2215
- }
2216
- return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
2217
- }
2218
-
2219
- /**
2220
- * Initialize the WASM module.
2221
- *
2222
- * This function is automatically called when the WASM module is loaded.
2223
- * It sets up the console error panic hook for better error messages in development.
2224
- */
2225
- export function init() {
2226
- wasm.init();
2227
- }
2228
-
2229
- /**
2230
- * Marks a node and its ancestors as dirty, requiring a layout re-computation.
2231
- *
2232
- * # Arguments
2233
- *
2234
- * * `node` - The ID of the node to mark dirty.
2235
- *
2236
- * # Errors
2237
- *
2238
- * Returns a `JsValue` error if the node does not exist.
2239
- * @param {bigint} node
2240
- */
2241
- export function mark_dirty(node) {
2242
- const ret = wasm.mark_dirty(node);
2243
- if (ret[1]) {
2244
- throw takeFromExternrefTable0(ret[0]);
2245
- }
2246
- }
2247
-
2248
- /**
2249
- * Creates a new leaf node with the specified style.
2250
- *
2251
- * # Arguments
2252
- *
2253
- * * `style` - The style object to apply to the new node.
2254
- *
2255
- * # Returns
2256
- *
2257
- * The ID of the created node as a `u32`.
2258
- *
2259
- * # Errors
2260
- *
2261
- * Returns a `JsValue` error if the style cannot be deserialized or if node creation fails.
2262
- * @param {any} style
2263
- * @returns {bigint}
2264
- */
2265
- export function new_leaf(style) {
2266
- const ret = wasm.new_leaf(style);
2267
- if (ret[2]) {
2268
- throw takeFromExternrefTable0(ret[1]);
2269
- }
2270
- return BigInt.asUintN(64, ret[0]);
2271
- }
2272
-
2273
- /**
2274
- * Creates a new node with children and the specified style.
2275
- *
2276
- * # Arguments
2277
- *
2278
- * * `style` - The style object to apply to the new node.
2279
- * * `children` - An array of child node IDs (`u32`) to attach to this node.
2280
- *
2281
- * # Returns
2282
- *
2283
- * The ID of the created node as a `u32`.
2284
- *
2285
- * # Errors
2286
- *
2287
- * Returns a `JsValue` error if the style cannot be deserialized or if node creation fails.
2288
- * @param {any} style
2289
- * @param {BigUint64Array} children
2290
- * @returns {bigint}
2291
- */
2292
- export function new_with_children(style, children) {
2293
- const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
2294
- const len0 = WASM_VECTOR_LEN;
2295
- const ret = wasm.new_with_children(style, ptr0, len0);
2296
- if (ret[2]) {
2297
- throw takeFromExternrefTable0(ret[1]);
2298
- }
2299
- return BigInt.asUintN(64, ret[0]);
2300
- }
2301
-
2302
- /**
2303
- * Get the total number of nodes currently in the layout tree.
2304
- *
2305
- * # Returns
2306
- *
2307
- * The total count of all nodes in the tree.
2308
- * @returns {number}
2309
- */
2310
- export function node_count() {
2311
- const ret = wasm.node_count();
2312
- return ret >>> 0;
2313
- }
2314
-
2315
- /**
2316
- * Helper function to create a percent dimension
2317
- * @param {number} value
2318
- * @returns {Dimension}
2319
- */
2320
- export function percent(value) {
2321
- const ret = wasm.percent(value);
2322
- return Dimension.__wrap(ret);
2323
- }
2324
-
2325
- /**
2326
- * Helper function to create a pixel dimension
2327
- * @param {number} value
2328
- * @returns {Dimension}
2329
- */
2330
- export function px(value) {
2331
- const ret = wasm.px(value);
2332
- return Dimension.__wrap(ret);
2333
- }
2334
-
2335
- /**
2336
- * Removes a child node from a parent node.
2337
- *
2338
- * # Arguments
2339
- *
2340
- * * `parent` - The ID of the parent node.
2341
- * * `child` - The ID of the child node to remove.
2342
- *
2343
- * # Errors
2344
- *
2345
- * Returns a `JsValue` error if the child is not found in the parent.
2346
- * @param {bigint} parent
2347
- * @param {bigint} child
2348
- */
2349
- export function remove_child(parent, child) {
2350
- const ret = wasm.remove_child(parent, child);
2351
- if (ret[1]) {
2352
- throw takeFromExternrefTable0(ret[0]);
2353
- }
2354
- }
2355
-
2356
- /**
2357
- * Removes a node from the tree and frees its resources.
2358
- *
2359
- * # Arguments
2360
- *
2361
- * * `node` - The ID of the node to remove.
2362
- *
2363
- * # Errors
2364
- *
2365
- * Returns a `JsValue` error if the node does not exist or cannot be removed.
2366
- * @param {bigint} node
2367
- */
2368
- export function remove_node(node) {
2369
- const ret = wasm.remove_node(node);
2370
- if (ret[1]) {
2371
- throw takeFromExternrefTable0(ret[0]);
2372
- }
2373
- }
2374
-
2375
- /**
2376
- * Sets the children of a node, replacing any existing children.
2377
- *
2378
- * # Arguments
2379
- *
2380
- * * `parent` - The ID of the parent node.
2381
- * * `children` - An array of child node IDs to set.
2382
- *
2383
- * # Errors
2384
- *
2385
- * Returns a `JsValue` error if the operation fails.
2386
- * @param {bigint} parent
2387
- * @param {BigUint64Array} children
2388
- */
2389
- export function set_children(parent, children) {
2390
- const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
2391
- const len0 = WASM_VECTOR_LEN;
2392
- const ret = wasm.set_children(parent, ptr0, len0);
2393
- if (ret[1]) {
2394
- throw takeFromExternrefTable0(ret[0]);
2395
- }
2396
- }
2397
-
2398
- /**
2399
- * Updates the style of an existing node.
2400
- *
2401
- * # Arguments
2402
- *
2403
- * * `node` - The ID of the node to update.
2404
- * * `style` - The new style object to apply.
2405
- *
2406
- * # Errors
2407
- *
2408
- * Returns a `JsValue` error if the style cannot be deserialized or if the node does not exist.
2409
- * @param {bigint} node
2410
- * @param {any} style
2411
- */
2412
- export function set_style(node, style) {
2413
- const ret = wasm.set_style(node, style);
2414
- if (ret[1]) {
2415
- throw takeFromExternrefTable0(ret[0]);
2416
- }
2417
- }
2418
-
2419
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2420
-
2421
- async function __wbg_load(module, imports) {
2422
- if (typeof Response === 'function' && module instanceof Response) {
2423
- if (typeof WebAssembly.instantiateStreaming === 'function') {
2424
- try {
2425
- return await WebAssembly.instantiateStreaming(module, imports);
2426
- } catch (e) {
2427
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
2428
-
2429
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2430
- 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);
2431
-
2432
- } else {
2433
- throw e;
2434
- }
2435
- }
2436
- }
2437
-
2438
- const bytes = await module.arrayBuffer();
2439
- return await WebAssembly.instantiate(bytes, imports);
2440
- } else {
2441
- const instance = await WebAssembly.instantiate(module, imports);
2442
-
2443
- if (instance instanceof WebAssembly.Instance) {
2444
- return { instance, module };
2445
- } else {
2446
- return instance;
2447
- }
2448
- }
2449
- }
2450
-
2451
- function __wbg_get_imports() {
2452
- const imports = {};
2453
- imports.wbg = {};
2454
- imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
2455
- const ret = Error(getStringFromWasm0(arg0, arg1));
2456
- return ret;
2457
- };
2458
- imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
2459
- const ret = Number(arg0);
2460
- return ret;
2461
- };
2462
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
2463
- const ret = String(arg1);
2464
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2465
- const len1 = WASM_VECTOR_LEN;
2466
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2467
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2468
- };
2469
- imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
2470
- const v = arg0;
2471
- const ret = typeof(v) === 'boolean' ? v : undefined;
2472
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2473
- };
2474
- imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
2475
- const ret = debugString(arg1);
2476
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2477
- const len1 = WASM_VECTOR_LEN;
2478
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2479
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2480
- };
2481
- imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
2482
- const ret = arg0 in arg1;
2483
- return ret;
2484
- };
2485
- imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
2486
- const ret = typeof(arg0) === 'function';
2487
- return ret;
2488
- };
2489
- imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
2490
- const ret = arg0 === null;
2491
- return ret;
2492
- };
2493
- imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
2494
- const val = arg0;
2495
- const ret = typeof(val) === 'object' && val !== null;
2496
- return ret;
2497
- };
2498
- imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
2499
- const ret = typeof(arg0) === 'string';
2500
- return ret;
2501
- };
2502
- imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
2503
- const ret = arg0 === undefined;
2504
- return ret;
2505
- };
2506
- imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
2507
- const ret = arg0 == arg1;
2508
- return ret;
2509
- };
2510
- imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
2511
- const obj = arg1;
2512
- const ret = typeof(obj) === 'number' ? obj : undefined;
2513
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2514
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2515
- };
2516
- imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
2517
- const obj = arg1;
2518
- const ret = typeof(obj) === 'string' ? obj : undefined;
2519
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2520
- var len1 = WASM_VECTOR_LEN;
2521
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2522
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2523
- };
2524
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
2525
- throw new Error(getStringFromWasm0(arg0, arg1));
2526
- };
2527
- imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
2528
- const ret = arg0.call(arg1, arg2);
2529
- return ret;
2530
- }, arguments) };
2531
- imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
2532
- const ret = arg0.call(arg1);
2533
- return ret;
2534
- }, arguments) };
2535
- imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
2536
- const ret = arg0.done;
2537
- return ret;
2538
- };
2539
- imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
2540
- const ret = Object.entries(arg0);
2541
- return ret;
2542
- };
2543
- imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
2544
- let deferred0_0;
2545
- let deferred0_1;
2546
- try {
2547
- deferred0_0 = arg0;
2548
- deferred0_1 = arg1;
2549
- console.error(getStringFromWasm0(arg0, arg1));
2550
- } finally {
2551
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2552
- }
2553
- };
2554
- imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
2555
- console.error(arg0);
2556
- };
2557
- imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
2558
- const ret = arg0[arg1 >>> 0];
2559
- return ret;
2560
- };
2561
- imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
2562
- const ret = Reflect.get(arg0, arg1);
2563
- return ret;
2564
- }, arguments) };
2565
- imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
2566
- const ret = arg0[arg1];
2567
- return ret;
2568
- };
2569
- imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
2570
- let result;
2571
- try {
2572
- result = arg0 instanceof ArrayBuffer;
2573
- } catch (_) {
2574
- result = false;
2575
- }
2576
- const ret = result;
2577
- return ret;
2578
- };
2579
- imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
2580
- let result;
2581
- try {
2582
- result = arg0 instanceof Uint8Array;
2583
- } catch (_) {
2584
- result = false;
2585
- }
2586
- const ret = result;
2587
- return ret;
2588
- };
2589
- imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
2590
- const ret = Array.isArray(arg0);
2591
- return ret;
2592
- };
2593
- imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
2594
- const ret = Number.isSafeInteger(arg0);
2595
- return ret;
2596
- };
2597
- imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
2598
- const ret = Symbol.iterator;
2599
- return ret;
2600
- };
2601
- imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
2602
- const ret = arg0.length;
2603
- return ret;
2604
- };
2605
- imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
2606
- const ret = arg0.length;
2607
- return ret;
2608
- };
2609
- imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
2610
- const ret = new Object();
2611
- return ret;
2612
- };
2613
- imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
2614
- const ret = new Uint8Array(arg0);
2615
- return ret;
2616
- };
2617
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2618
- const ret = new Error();
2619
- return ret;
2620
- };
2621
- imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
2622
- const ret = arg0.next;
2623
- return ret;
2624
- };
2625
- imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
2626
- const ret = arg0.next();
2627
- return ret;
2628
- }, arguments) };
2629
- imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
2630
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
2631
- };
2632
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2633
- arg0[arg1] = arg2;
2634
- };
2635
- imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2636
- const ret = arg1.stack;
2637
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2638
- const len1 = WASM_VECTOR_LEN;
2639
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2640
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2641
- };
2642
- imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
2643
- const ret = arg0.value;
2644
- return ret;
2645
- };
2646
- imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
2647
- console.warn(arg0);
2648
- };
2649
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2650
- // Cast intrinsic for `Ref(String) -> Externref`.
2651
- const ret = getStringFromWasm0(arg0, arg1);
2652
- return ret;
2653
- };
2654
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
2655
- // Cast intrinsic for `F64 -> Externref`.
2656
- const ret = arg0;
2657
- return ret;
2658
- };
2659
- imports.wbg.__wbindgen_init_externref_table = function() {
2660
- const table = wasm.__wbindgen_externrefs;
2661
- const offset = table.grow(4);
2662
- table.set(0, undefined);
2663
- table.set(offset + 0, undefined);
2664
- table.set(offset + 1, null);
2665
- table.set(offset + 2, true);
2666
- table.set(offset + 3, false);
2667
- };
2668
-
2669
- return imports;
2670
- }
2671
-
2672
- function __wbg_finalize_init(instance, module) {
2673
- wasm = instance.exports;
2674
- __wbg_init.__wbindgen_wasm_module = module;
2675
- cachedBigUint64ArrayMemory0 = null;
2676
- cachedDataViewMemory0 = null;
2677
- cachedUint8ArrayMemory0 = null;
2678
-
2679
-
2680
- wasm.__wbindgen_start();
2681
- return wasm;
2682
- }
2683
-
2684
- function initSync(module) {
2685
- if (wasm !== undefined) return wasm;
2686
-
2687
-
2688
- if (typeof module !== 'undefined') {
2689
- if (Object.getPrototypeOf(module) === Object.prototype) {
2690
- ({module} = module)
2691
- } else {
2692
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2693
- }
2694
- }
2695
-
2696
- const imports = __wbg_get_imports();
2697
- if (!(module instanceof WebAssembly.Module)) {
2698
- module = new WebAssembly.Module(module);
2699
- }
2700
- const instance = new WebAssembly.Instance(module, imports);
2701
- return __wbg_finalize_init(instance, module);
2702
- }
2703
-
2704
- async function __wbg_init(module_or_path) {
2705
- if (wasm !== undefined) return wasm;
2706
-
2707
-
2708
- if (typeof module_or_path !== 'undefined') {
2709
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2710
- ({module_or_path} = module_or_path)
2711
- } else {
2712
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2713
- }
2714
- }
2715
-
2716
- if (typeof module_or_path === 'undefined') {
2717
- module_or_path = new URL('taffy_js_bg.wasm', import.meta.url);
2718
- }
2719
- const imports = __wbg_get_imports();
2720
-
2721
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2722
- module_or_path = fetch(module_or_path);
2723
- }
2724
-
2725
- const { instance, module } = await __wbg_load(await module_or_path, imports);
2726
-
2727
- return __wbg_finalize_init(instance, module);
2728
- }
2729
-
2730
- export { initSync };
2731
- export default __wbg_init;