flexily 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +16 -16
  2. package/package.json +24 -24
  3. package/src/CLAUDE.md +36 -21
  4. package/src/classic/layout.ts +107 -47
  5. package/src/classic/node.ts +60 -0
  6. package/src/constants.ts +2 -1
  7. package/src/index-classic.ts +1 -1
  8. package/src/index.ts +1 -1
  9. package/src/layout-flex-lines.ts +70 -3
  10. package/src/layout-helpers.ts +29 -9
  11. package/src/layout-stats.ts +0 -2
  12. package/src/layout-zero.ts +587 -160
  13. package/src/node-zero.ts +98 -2
  14. package/src/testing.ts +20 -14
  15. package/src/types.ts +22 -15
  16. package/src/utils.ts +47 -21
  17. package/dist/classic/layout.d.ts +0 -57
  18. package/dist/classic/layout.d.ts.map +0 -1
  19. package/dist/classic/layout.js +0 -1558
  20. package/dist/classic/layout.js.map +0 -1
  21. package/dist/classic/node.d.ts +0 -648
  22. package/dist/classic/node.d.ts.map +0 -1
  23. package/dist/classic/node.js +0 -1002
  24. package/dist/classic/node.js.map +0 -1
  25. package/dist/constants.d.ts +0 -58
  26. package/dist/constants.d.ts.map +0 -1
  27. package/dist/constants.js +0 -70
  28. package/dist/constants.js.map +0 -1
  29. package/dist/index-classic.d.ts +0 -30
  30. package/dist/index-classic.d.ts.map +0 -1
  31. package/dist/index-classic.js +0 -57
  32. package/dist/index-classic.js.map +0 -1
  33. package/dist/index.d.ts +0 -30
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/index.js +0 -57
  36. package/dist/index.js.map +0 -1
  37. package/dist/layout-flex-lines.d.ts +0 -77
  38. package/dist/layout-flex-lines.d.ts.map +0 -1
  39. package/dist/layout-flex-lines.js +0 -317
  40. package/dist/layout-flex-lines.js.map +0 -1
  41. package/dist/layout-helpers.d.ts +0 -48
  42. package/dist/layout-helpers.d.ts.map +0 -1
  43. package/dist/layout-helpers.js +0 -108
  44. package/dist/layout-helpers.js.map +0 -1
  45. package/dist/layout-measure.d.ts +0 -25
  46. package/dist/layout-measure.d.ts.map +0 -1
  47. package/dist/layout-measure.js +0 -231
  48. package/dist/layout-measure.js.map +0 -1
  49. package/dist/layout-stats.d.ts +0 -19
  50. package/dist/layout-stats.d.ts.map +0 -1
  51. package/dist/layout-stats.js +0 -37
  52. package/dist/layout-stats.js.map +0 -1
  53. package/dist/layout-traversal.d.ts +0 -28
  54. package/dist/layout-traversal.d.ts.map +0 -1
  55. package/dist/layout-traversal.js +0 -65
  56. package/dist/layout-traversal.js.map +0 -1
  57. package/dist/layout-zero.d.ts +0 -26
  58. package/dist/layout-zero.d.ts.map +0 -1
  59. package/dist/layout-zero.js +0 -1601
  60. package/dist/layout-zero.js.map +0 -1
  61. package/dist/logger.d.ts +0 -14
  62. package/dist/logger.d.ts.map +0 -1
  63. package/dist/logger.js +0 -61
  64. package/dist/logger.js.map +0 -1
  65. package/dist/node-zero.d.ts +0 -702
  66. package/dist/node-zero.d.ts.map +0 -1
  67. package/dist/node-zero.js +0 -1268
  68. package/dist/node-zero.js.map +0 -1
  69. package/dist/testing.d.ts +0 -69
  70. package/dist/testing.d.ts.map +0 -1
  71. package/dist/testing.js +0 -179
  72. package/dist/testing.js.map +0 -1
  73. package/dist/trace.d.ts +0 -74
  74. package/dist/trace.d.ts.map +0 -1
  75. package/dist/trace.js +0 -191
  76. package/dist/trace.js.map +0 -1
  77. package/dist/types.d.ts +0 -170
  78. package/dist/types.d.ts.map +0 -1
  79. package/dist/types.js +0 -43
  80. package/dist/types.js.map +0 -1
  81. package/dist/utils.d.ts +0 -41
  82. package/dist/utils.d.ts.map +0 -1
  83. package/dist/utils.js +0 -197
  84. package/dist/utils.js.map +0 -1
  85. package/src/beorn-logger.d.ts +0 -10
@@ -1,702 +0,0 @@
1
- /**
2
- * Flexily Node
3
- *
4
- * Yoga-compatible Node class for flexbox layout.
5
- */
6
- import { type BaselineFunc, type FlexInfo, type Layout, type MeasureFunc, type Style, type Value } from "./types.js";
7
- /**
8
- * A layout node in the flexbox tree.
9
- */
10
- export declare class Node {
11
- private _parent;
12
- private _children;
13
- private _style;
14
- private _measureFunc;
15
- private _baselineFunc;
16
- private _m0?;
17
- private _m1?;
18
- private _m2?;
19
- private _m3?;
20
- private _lc0?;
21
- private _lc1?;
22
- private _measureResult;
23
- private _layoutResult;
24
- static measureCalls: number;
25
- static measureCacheHits: number;
26
- /**
27
- * Reset measure statistics (call before calculateLayout).
28
- */
29
- static resetMeasureStats(): void;
30
- private _layout;
31
- private _flex;
32
- private _isDirty;
33
- private _hasNewLayout;
34
- private _lastCalcW;
35
- private _lastCalcH;
36
- private _lastCalcDir;
37
- /**
38
- * Create a new layout node.
39
- *
40
- * @returns A new Node instance
41
- * @example
42
- * ```typescript
43
- * const root = Node.create();
44
- * root.setWidth(100);
45
- * root.setHeight(200);
46
- * ```
47
- */
48
- static create(): Node;
49
- /**
50
- * Get the number of child nodes.
51
- *
52
- * @returns The number of children
53
- */
54
- getChildCount(): number;
55
- /**
56
- * Get a child node by index.
57
- *
58
- * @param index - Zero-based child index
59
- * @returns The child node at the given index, or undefined if index is out of bounds
60
- */
61
- getChild(index: number): Node | undefined;
62
- /**
63
- * Get the parent node.
64
- *
65
- * @returns The parent node, or null if this is a root node
66
- */
67
- getParent(): Node | null;
68
- /**
69
- * Insert a child node at the specified index.
70
- * If the child already has a parent, it will be removed from that parent first.
71
- * Marks the node as dirty to trigger layout recalculation.
72
- *
73
- * @param child - The child node to insert
74
- * @param index - The index at which to insert the child
75
- * @example
76
- * ```typescript
77
- * const parent = Node.create();
78
- * const child1 = Node.create();
79
- * const child2 = Node.create();
80
- * parent.insertChild(child1, 0);
81
- * parent.insertChild(child2, 1);
82
- * ```
83
- */
84
- insertChild(child: Node, index: number): void;
85
- /**
86
- * Remove a child node from this node.
87
- * The child's parent reference will be cleared.
88
- * Marks the node as dirty to trigger layout recalculation.
89
- * Invalidates layout validity of remaining siblings whose positions may change.
90
- *
91
- * @param child - The child node to remove
92
- */
93
- removeChild(child: Node): void;
94
- /**
95
- * Free this node and clean up all references.
96
- * Removes the node from its parent, clears all children, and removes the measure function.
97
- * This does not recursively free child nodes.
98
- */
99
- free(): void;
100
- /**
101
- * Dispose the node (calls free)
102
- */
103
- [Symbol.dispose](): void;
104
- /**
105
- * Set a measure function for intrinsic sizing.
106
- * The measure function is called during layout to determine the node's natural size.
107
- * Typically used for text nodes or other content that has an intrinsic size.
108
- * Marks the node as dirty to trigger layout recalculation.
109
- *
110
- * @param measureFunc - Function that returns width and height given available space and constraints
111
- * @example
112
- * ```typescript
113
- * const textNode = Node.create();
114
- * textNode.setMeasureFunc((width, widthMode, height, heightMode) => {
115
- * // Measure text and return dimensions
116
- * return { width: 50, height: 20 };
117
- * });
118
- * ```
119
- */
120
- setMeasureFunc(measureFunc: MeasureFunc): void;
121
- /**
122
- * Remove the measure function from this node.
123
- * Marks the node as dirty to trigger layout recalculation.
124
- */
125
- unsetMeasureFunc(): void;
126
- /**
127
- * Check if this node has a measure function.
128
- *
129
- * @returns True if a measure function is set
130
- */
131
- hasMeasureFunc(): boolean;
132
- /**
133
- * Set a baseline function to determine where this node's text baseline is.
134
- * Used for ALIGN_BASELINE to align text across siblings with different heights.
135
- *
136
- * @param baselineFunc - Function that returns baseline offset from top given width and height
137
- * @example
138
- * ```typescript
139
- * textNode.setBaselineFunc((width, height) => {
140
- * // For a text node, baseline might be at 80% of height
141
- * return height * 0.8;
142
- * });
143
- * ```
144
- */
145
- setBaselineFunc(baselineFunc: BaselineFunc): void;
146
- /**
147
- * Remove the baseline function from this node.
148
- * Marks the node as dirty to trigger layout recalculation.
149
- */
150
- unsetBaselineFunc(): void;
151
- /**
152
- * Check if this node has a baseline function.
153
- *
154
- * @returns True if a baseline function is set
155
- */
156
- hasBaselineFunc(): boolean;
157
- /**
158
- * Call the measure function with caching.
159
- * Uses a 4-entry numeric cache for fast lookup without allocations.
160
- * Cache is cleared when markDirty() is called.
161
- *
162
- * @returns Measured dimensions or null if no measure function
163
- */
164
- cachedMeasure(w: number, wm: number, h: number, hm: number): {
165
- width: number;
166
- height: number;
167
- } | null;
168
- /**
169
- * Check layout cache for a previously computed size with same available dimensions.
170
- * Returns cached (width, height) or null if not found.
171
- *
172
- * NaN dimensions are handled specially via Object.is (NaN === NaN is false, but Object.is(NaN, NaN) is true).
173
- */
174
- getCachedLayout(availW: number, availH: number): {
175
- width: number;
176
- height: number;
177
- } | null;
178
- /**
179
- * Cache a computed layout result for the given available dimensions.
180
- * Zero-allocation: lazily allocates cache entries once, then reuses.
181
- */
182
- setCachedLayout(availW: number, availH: number, computedW: number, computedH: number): void;
183
- /**
184
- * Clear layout cache for this node and all descendants.
185
- * Called at the start of each calculateLayout pass.
186
- * Zero-allocation: invalidates entries (availW = NaN) rather than deallocating.
187
- * Uses iterative traversal to avoid stack overflow on deep trees.
188
- */
189
- resetLayoutCache(): void;
190
- /**
191
- * Check if this node needs layout recalculation.
192
- *
193
- * @returns True if the node is dirty and needs layout
194
- */
195
- isDirty(): boolean;
196
- /**
197
- * Mark this node and all ancestors as dirty.
198
- * A dirty node needs layout recalculation.
199
- * This is automatically called by all style setters and tree operations.
200
- * Uses iterative approach to avoid stack overflow on deep trees.
201
- */
202
- markDirty(): void;
203
- /**
204
- * Check if this node has new layout results since the last check.
205
- *
206
- * @returns True if layout was recalculated since the last call to markLayoutSeen
207
- */
208
- hasNewLayout(): boolean;
209
- /**
210
- * Mark that the current layout has been seen/processed.
211
- * Clears the hasNewLayout flag.
212
- */
213
- markLayoutSeen(): void;
214
- /**
215
- * Calculate layout for this node and all descendants.
216
- * This runs the flexbox layout algorithm to compute positions and sizes.
217
- * Only recalculates if the node is marked as dirty.
218
- *
219
- * @param width - Available width for layout
220
- * @param height - Available height for layout
221
- * @param _direction - Text direction (LTR or RTL), defaults to LTR
222
- * @example
223
- * ```typescript
224
- * const root = Node.create();
225
- * root.setFlexDirection(FLEX_DIRECTION_ROW);
226
- * root.setWidth(100);
227
- * root.setHeight(50);
228
- *
229
- * const child = Node.create();
230
- * child.setFlexGrow(1);
231
- * root.insertChild(child, 0);
232
- *
233
- * root.calculateLayout(100, 50, DIRECTION_LTR);
234
- *
235
- * // Now you can read computed layout
236
- * console.log(child.getComputedWidth());
237
- * ```
238
- */
239
- calculateLayout(width?: number, height?: number, direction?: number): void;
240
- /**
241
- * Get the computed left position after layout.
242
- *
243
- * @returns The left position in points
244
- */
245
- getComputedLeft(): number;
246
- /**
247
- * Get the computed top position after layout.
248
- *
249
- * @returns The top position in points
250
- */
251
- getComputedTop(): number;
252
- /**
253
- * Get the computed width after layout.
254
- *
255
- * @returns The width in points
256
- */
257
- getComputedWidth(): number;
258
- /**
259
- * Get the computed height after layout.
260
- *
261
- * @returns The height in points
262
- */
263
- getComputedHeight(): number;
264
- get children(): readonly Node[];
265
- get style(): Style;
266
- get layout(): Layout;
267
- get measureFunc(): MeasureFunc | null;
268
- get baselineFunc(): BaselineFunc | null;
269
- get flex(): FlexInfo;
270
- /**
271
- * Set the width to a fixed value in points.
272
- *
273
- * @param value - Width in points
274
- */
275
- setWidth(value: number): void;
276
- /**
277
- * Set the width as a percentage of the parent's width.
278
- *
279
- * @param value - Width as a percentage (0-100)
280
- */
281
- setWidthPercent(value: number): void;
282
- /**
283
- * Set the width to auto (determined by layout algorithm).
284
- */
285
- setWidthAuto(): void;
286
- /**
287
- * Set the height to a fixed value in points.
288
- *
289
- * @param value - Height in points
290
- */
291
- setHeight(value: number): void;
292
- /**
293
- * Set the height as a percentage of the parent's height.
294
- *
295
- * @param value - Height as a percentage (0-100)
296
- */
297
- setHeightPercent(value: number): void;
298
- /**
299
- * Set the height to auto (determined by layout algorithm).
300
- */
301
- setHeightAuto(): void;
302
- /**
303
- * Set the minimum width in points.
304
- *
305
- * @param value - Minimum width in points
306
- */
307
- setMinWidth(value: number): void;
308
- /**
309
- * Set the minimum width as a percentage of the parent's width.
310
- *
311
- * @param value - Minimum width as a percentage (0-100)
312
- */
313
- setMinWidthPercent(value: number): void;
314
- /**
315
- * Set the minimum height in points.
316
- *
317
- * @param value - Minimum height in points
318
- */
319
- setMinHeight(value: number): void;
320
- /**
321
- * Set the minimum height as a percentage of the parent's height.
322
- *
323
- * @param value - Minimum height as a percentage (0-100)
324
- */
325
- setMinHeightPercent(value: number): void;
326
- /**
327
- * Set the maximum width in points.
328
- *
329
- * @param value - Maximum width in points
330
- */
331
- setMaxWidth(value: number): void;
332
- /**
333
- * Set the maximum width as a percentage of the parent's width.
334
- *
335
- * @param value - Maximum width as a percentage (0-100)
336
- */
337
- setMaxWidthPercent(value: number): void;
338
- /**
339
- * Set the maximum height in points.
340
- *
341
- * @param value - Maximum height in points
342
- */
343
- setMaxHeight(value: number): void;
344
- /**
345
- * Set the maximum height as a percentage of the parent's height.
346
- *
347
- * @param value - Maximum height as a percentage (0-100)
348
- */
349
- setMaxHeightPercent(value: number): void;
350
- /**
351
- * Set the aspect ratio of the node.
352
- * When set, the node's width/height relationship is constrained.
353
- * If width is defined, height = width / aspectRatio.
354
- * If height is defined, width = height * aspectRatio.
355
- *
356
- * @param value - Aspect ratio (width/height). Use NaN to unset.
357
- */
358
- setAspectRatio(value: number): void;
359
- /**
360
- * Set the flex grow factor.
361
- * Determines how much the node will grow relative to siblings when there is extra space.
362
- *
363
- * @param value - Flex grow factor (typically 0 or 1+)
364
- * @example
365
- * ```typescript
366
- * const child = Node.create();
367
- * child.setFlexGrow(1); // Will grow to fill available space
368
- * ```
369
- */
370
- setFlexGrow(value: number): void;
371
- /**
372
- * Set the flex shrink factor.
373
- * Determines how much the node will shrink relative to siblings when there is insufficient space.
374
- *
375
- * @param value - Flex shrink factor (default is 1)
376
- */
377
- setFlexShrink(value: number): void;
378
- /**
379
- * Set the flex basis to a fixed value in points.
380
- * The initial size of the node before flex grow/shrink is applied.
381
- *
382
- * @param value - Flex basis in points
383
- */
384
- setFlexBasis(value: number): void;
385
- /**
386
- * Set the flex basis as a percentage of the parent's size.
387
- *
388
- * @param value - Flex basis as a percentage (0-100)
389
- */
390
- setFlexBasisPercent(value: number): void;
391
- /**
392
- * Set the flex basis to auto (based on the node's width/height).
393
- */
394
- setFlexBasisAuto(): void;
395
- /**
396
- * Set the flex direction (main axis direction).
397
- *
398
- * @param direction - FLEX_DIRECTION_ROW, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_ROW_REVERSE, or FLEX_DIRECTION_COLUMN_REVERSE
399
- * @example
400
- * ```typescript
401
- * const container = Node.create();
402
- * container.setFlexDirection(FLEX_DIRECTION_ROW); // Lay out children horizontally
403
- * ```
404
- */
405
- setFlexDirection(direction: number): void;
406
- /**
407
- * Set the flex wrap behavior.
408
- *
409
- * @param wrap - WRAP_NO_WRAP, WRAP_WRAP, or WRAP_WRAP_REVERSE
410
- */
411
- setFlexWrap(wrap: number): void;
412
- /**
413
- * Set how children are aligned along the cross axis.
414
- *
415
- * @param align - ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, or ALIGN_BASELINE
416
- * @example
417
- * ```typescript
418
- * const container = Node.create();
419
- * container.setFlexDirection(FLEX_DIRECTION_ROW);
420
- * container.setAlignItems(ALIGN_CENTER); // Center children vertically
421
- * ```
422
- */
423
- setAlignItems(align: number): void;
424
- /**
425
- * Set how this node is aligned along the parent's cross axis.
426
- * Overrides the parent's alignItems for this specific child.
427
- *
428
- * @param align - ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, or ALIGN_BASELINE
429
- */
430
- setAlignSelf(align: number): void;
431
- /**
432
- * Set how lines are aligned in a multi-line flex container.
433
- * Only affects containers with wrap enabled and multiple lines.
434
- *
435
- * @param align - ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_SPACE_BETWEEN, or ALIGN_SPACE_AROUND
436
- */
437
- setAlignContent(align: number): void;
438
- /**
439
- * Set how children are distributed along the main axis.
440
- *
441
- * @param justify - JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, or JUSTIFY_SPACE_EVENLY
442
- * @example
443
- * ```typescript
444
- * const container = Node.create();
445
- * container.setJustifyContent(JUSTIFY_SPACE_BETWEEN); // Space children evenly with edges at start/end
446
- * ```
447
- */
448
- setJustifyContent(justify: number): void;
449
- /**
450
- * Set padding for one or more edges.
451
- *
452
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
453
- * @param value - Padding in points
454
- * @example
455
- * ```typescript
456
- * node.setPadding(EDGE_ALL, 10); // Set 10pt padding on all edges
457
- * node.setPadding(EDGE_HORIZONTAL, 5); // Set 5pt padding on left and right
458
- * ```
459
- */
460
- setPadding(edge: number, value: number): void;
461
- /**
462
- * Set padding as a percentage of the parent's width.
463
- * Per CSS spec, percentage padding always resolves against the containing block's width.
464
- *
465
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
466
- * @param value - Padding as a percentage (0-100)
467
- */
468
- setPaddingPercent(edge: number, value: number): void;
469
- /**
470
- * Set margin for one or more edges.
471
- *
472
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
473
- * @param value - Margin in points
474
- * @example
475
- * ```typescript
476
- * node.setMargin(EDGE_ALL, 5); // Set 5pt margin on all edges
477
- * node.setMargin(EDGE_TOP, 10); // Set 10pt margin on top only
478
- * ```
479
- */
480
- setMargin(edge: number, value: number): void;
481
- /**
482
- * Set margin as a percentage of the parent's size.
483
- *
484
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
485
- * @param value - Margin as a percentage (0-100)
486
- */
487
- setMarginPercent(edge: number, value: number): void;
488
- /**
489
- * Set margin to auto (for centering items with margin: auto).
490
- *
491
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
492
- */
493
- setMarginAuto(edge: number): void;
494
- /**
495
- * Set border width for one or more edges.
496
- *
497
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
498
- * @param value - Border width in points
499
- */
500
- setBorder(edge: number, value: number): void;
501
- /**
502
- * Set gap between flex items.
503
- *
504
- * @param gutter - GUTTER_COLUMN (horizontal gap), GUTTER_ROW (vertical gap), or GUTTER_ALL (both)
505
- * @param value - Gap size in points
506
- * @example
507
- * ```typescript
508
- * container.setGap(GUTTER_ALL, 8); // Set 8pt gap between all items
509
- * container.setGap(GUTTER_COLUMN, 10); // Set 10pt horizontal gap only
510
- * ```
511
- */
512
- setGap(gutter: number, value: number): void;
513
- /**
514
- * Set the position type.
515
- *
516
- * @param positionType - POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, or POSITION_TYPE_ABSOLUTE
517
- * @example
518
- * ```typescript
519
- * node.setPositionType(POSITION_TYPE_ABSOLUTE);
520
- * node.setPosition(EDGE_LEFT, 10);
521
- * node.setPosition(EDGE_TOP, 20);
522
- * ```
523
- */
524
- setPositionType(positionType: number): void;
525
- /**
526
- * Set position offset for one or more edges.
527
- * Only applies when position type is ABSOLUTE or RELATIVE.
528
- *
529
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
530
- * @param value - Position offset in points
531
- */
532
- setPosition(edge: number, value: number): void;
533
- /**
534
- * Set position offset as a percentage.
535
- *
536
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_HORIZONTAL, EDGE_VERTICAL, or EDGE_ALL
537
- * @param value - Position offset as a percentage of parent's corresponding dimension
538
- */
539
- setPositionPercent(edge: number, value: number): void;
540
- /**
541
- * Set the display type.
542
- *
543
- * @param display - DISPLAY_FLEX or DISPLAY_NONE
544
- */
545
- setDisplay(display: number): void;
546
- /**
547
- * Set the overflow behavior.
548
- *
549
- * @param overflow - OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, or OVERFLOW_SCROLL
550
- */
551
- setOverflow(overflow: number): void;
552
- /**
553
- * Get the width style value.
554
- *
555
- * @returns Width value with unit (points, percent, or auto)
556
- */
557
- getWidth(): Value;
558
- /**
559
- * Get the height style value.
560
- *
561
- * @returns Height value with unit (points, percent, or auto)
562
- */
563
- getHeight(): Value;
564
- /**
565
- * Get the minimum width style value.
566
- *
567
- * @returns Minimum width value with unit
568
- */
569
- getMinWidth(): Value;
570
- /**
571
- * Get the minimum height style value.
572
- *
573
- * @returns Minimum height value with unit
574
- */
575
- getMinHeight(): Value;
576
- /**
577
- * Get the maximum width style value.
578
- *
579
- * @returns Maximum width value with unit
580
- */
581
- getMaxWidth(): Value;
582
- /**
583
- * Get the maximum height style value.
584
- *
585
- * @returns Maximum height value with unit
586
- */
587
- getMaxHeight(): Value;
588
- /**
589
- * Get the aspect ratio.
590
- *
591
- * @returns Aspect ratio value (NaN if not set)
592
- */
593
- getAspectRatio(): number;
594
- /**
595
- * Get the flex grow factor.
596
- *
597
- * @returns Flex grow value
598
- */
599
- getFlexGrow(): number;
600
- /**
601
- * Get the flex shrink factor.
602
- *
603
- * @returns Flex shrink value
604
- */
605
- getFlexShrink(): number;
606
- /**
607
- * Get the flex basis style value.
608
- *
609
- * @returns Flex basis value with unit
610
- */
611
- getFlexBasis(): Value;
612
- /**
613
- * Get the flex direction.
614
- *
615
- * @returns Flex direction constant
616
- */
617
- getFlexDirection(): number;
618
- /**
619
- * Get the flex wrap setting.
620
- *
621
- * @returns Flex wrap constant
622
- */
623
- getFlexWrap(): number;
624
- /**
625
- * Get the align items setting.
626
- *
627
- * @returns Align items constant
628
- */
629
- getAlignItems(): number;
630
- /**
631
- * Get the align self setting.
632
- *
633
- * @returns Align self constant
634
- */
635
- getAlignSelf(): number;
636
- /**
637
- * Get the align content setting.
638
- *
639
- * @returns Align content constant
640
- */
641
- getAlignContent(): number;
642
- /**
643
- * Get the justify content setting.
644
- *
645
- * @returns Justify content constant
646
- */
647
- getJustifyContent(): number;
648
- /**
649
- * Get the padding for a specific edge.
650
- *
651
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, or EDGE_BOTTOM
652
- * @returns Padding value with unit
653
- */
654
- getPadding(edge: number): Value;
655
- /**
656
- * Get the margin for a specific edge.
657
- *
658
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, or EDGE_BOTTOM
659
- * @returns Margin value with unit
660
- */
661
- getMargin(edge: number): Value;
662
- /**
663
- * Get the border width for a specific edge.
664
- *
665
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, or EDGE_BOTTOM
666
- * @returns Border width in points
667
- */
668
- getBorder(edge: number): number;
669
- /**
670
- * Get the position offset for a specific edge.
671
- *
672
- * @param edge - EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, or EDGE_BOTTOM
673
- * @returns Position value with unit
674
- */
675
- getPosition(edge: number): Value;
676
- /**
677
- * Get the position type.
678
- *
679
- * @returns Position type constant
680
- */
681
- getPositionType(): number;
682
- /**
683
- * Get the display type.
684
- *
685
- * @returns Display constant
686
- */
687
- getDisplay(): number;
688
- /**
689
- * Get the overflow setting.
690
- *
691
- * @returns Overflow constant
692
- */
693
- getOverflow(): number;
694
- /**
695
- * Get the gap for column or row.
696
- *
697
- * @param gutter - GUTTER_COLUMN or GUTTER_ROW
698
- * @returns Gap size in points
699
- */
700
- getGap(gutter: number): number;
701
- }
702
- //# sourceMappingURL=node-zero.d.ts.map
@@ -1 +0,0 @@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