@takumi-rs/helpers 0.23.0 → 0.24.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/README.md +2 -23
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +20 -570
- package/dist/index.js +1 -1
- package/dist/jsx/jsx.cjs +1 -0
- package/dist/jsx/jsx.d.cts +6 -0
- package/dist/jsx/jsx.d.ts +3 -470
- package/dist/jsx/jsx.js +1 -13
- package/dist/types-C93nbSJX.d.cts +586 -0
- package/dist/types-C93nbSJX.d.ts +586 -0
- package/package.json +13 -9
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines how flex items are aligned along the cross axis.
|
|
3
|
+
*
|
|
4
|
+
* This enum determines how items are aligned within the flex container
|
|
5
|
+
* along the cross axis (perpendicular to the main axis).
|
|
6
|
+
*/
|
|
7
|
+
type AlignItems = "start" | "end" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a color with 8-bit RGBA components.
|
|
11
|
+
*/
|
|
12
|
+
type Color = [number, number, number] | [number, number, number, number] | number | string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents a value that can be a specific length, percentage, or automatic.
|
|
16
|
+
*
|
|
17
|
+
* This corresponds to CSS values that can be specified as pixels, percentages,
|
|
18
|
+
* or the 'auto' keyword for automatic sizing.
|
|
19
|
+
*/
|
|
20
|
+
type LengthUnit = "auto" | "min-content" | "max-content" | {
|
|
21
|
+
"percentage": number;
|
|
22
|
+
} | {
|
|
23
|
+
"rem": number;
|
|
24
|
+
} | {
|
|
25
|
+
"em": number;
|
|
26
|
+
} | {
|
|
27
|
+
"vh": number;
|
|
28
|
+
} | {
|
|
29
|
+
"vw": number;
|
|
30
|
+
} | number | string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Represents a box shadow with all its properties.
|
|
34
|
+
*
|
|
35
|
+
* Box shadows can be either outset (default) or inset, and consist of:
|
|
36
|
+
* - Horizontal and vertical offsets
|
|
37
|
+
* - Blur radius (optional, defaults to 0)
|
|
38
|
+
* - Spread radius (optional, defaults to 0)
|
|
39
|
+
* - Color (optional, defaults to transparent)
|
|
40
|
+
*/
|
|
41
|
+
type BoxShadow = {
|
|
42
|
+
/**
|
|
43
|
+
* Whether the shadow is inset (inside the element) or outset (outside the element).
|
|
44
|
+
*/
|
|
45
|
+
inset: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Horizontal offset of the shadow.
|
|
48
|
+
*/
|
|
49
|
+
offsetX: LengthUnit;
|
|
50
|
+
/**
|
|
51
|
+
* Vertical offset of the shadow.
|
|
52
|
+
*/
|
|
53
|
+
offsetY: LengthUnit;
|
|
54
|
+
/**
|
|
55
|
+
* Blur radius of the shadow. Higher values create a more blurred shadow.
|
|
56
|
+
*/
|
|
57
|
+
blurRadius: LengthUnit;
|
|
58
|
+
/**
|
|
59
|
+
* Spread radius of the shadow. Positive values expand the shadow, negative values shrink it.
|
|
60
|
+
*/
|
|
61
|
+
spreadRadius: LengthUnit;
|
|
62
|
+
/**
|
|
63
|
+
* Color of the shadow.
|
|
64
|
+
*/
|
|
65
|
+
color: Color;
|
|
66
|
+
} | string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Represents a collection of box shadows, have custom `FromCss` implementation for comma-separated values.
|
|
70
|
+
*/
|
|
71
|
+
type BoxShadows = Array<BoxShadow>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* This enum determines the layout algorithm used for the children of a node.
|
|
75
|
+
*/
|
|
76
|
+
type Display = "flex" | "grid";
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Defines the direction of flex items within a flex container.
|
|
80
|
+
*
|
|
81
|
+
* This enum determines how flex items are laid out along the main axis.
|
|
82
|
+
*/
|
|
83
|
+
type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Defines how flex items should wrap.
|
|
87
|
+
*
|
|
88
|
+
* This enum determines how flex items should wrap within the flex container.
|
|
89
|
+
*/
|
|
90
|
+
type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Represents a font family for text rendering.
|
|
94
|
+
* Use only the family name (no style suffixes like "Bold", "Italic", "Regular").
|
|
95
|
+
* Multi-word names are allowed (e.g., "Noto Sans") and should be provided as-is without quotes.
|
|
96
|
+
*/
|
|
97
|
+
type FontFamily = "sans-serif" | "serif" | "monospace" | "cursive" | "fantasy" | string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Represents font weight as a numeric value.
|
|
101
|
+
*
|
|
102
|
+
* This wraps a u16 value that corresponds to CSS font-weight values.
|
|
103
|
+
* Common values include 100 (thin), 200 (extra light), 300 (light),
|
|
104
|
+
* 400 (normal), 500 (medium), 600 (semi bold), 700 (bold),
|
|
105
|
+
* 800 (extra bold), 900 (black).
|
|
106
|
+
*/
|
|
107
|
+
type FontWeight = number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Represents spacing between flex items.
|
|
111
|
+
*
|
|
112
|
+
* Can be either a single value applied to both axes, or separate values
|
|
113
|
+
* for horizontal and vertical spacing.
|
|
114
|
+
*/
|
|
115
|
+
type Gap = LengthUnit | [LengthUnit, LengthUnit] | string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Represents the grid auto flow with serde support
|
|
119
|
+
*/
|
|
120
|
+
type GridAutoFlow = "row" | "column" | "row dense" | "column dense";
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Represents a grid placement with serde support
|
|
124
|
+
*/
|
|
125
|
+
type GridPlacement = "auto" | {
|
|
126
|
+
"span": number;
|
|
127
|
+
} | number | string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Represents a grid line placement with serde support
|
|
131
|
+
*/
|
|
132
|
+
type GridLine = {
|
|
133
|
+
/**
|
|
134
|
+
* The start line placement
|
|
135
|
+
*/
|
|
136
|
+
start: GridPlacement | null;
|
|
137
|
+
/**
|
|
138
|
+
* The end line placement
|
|
139
|
+
*/
|
|
140
|
+
end: GridPlacement | null;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Represents a grid track sizing function with serde support
|
|
145
|
+
*/
|
|
146
|
+
type GridLengthUnit = {
|
|
147
|
+
"fr": number;
|
|
148
|
+
} | LengthUnit | string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Represents a grid minmax()
|
|
152
|
+
*/
|
|
153
|
+
type GridMinMaxSize = {
|
|
154
|
+
/**
|
|
155
|
+
* The minimum size of the grid item
|
|
156
|
+
*/
|
|
157
|
+
min: GridLengthUnit;
|
|
158
|
+
/**
|
|
159
|
+
* The maximum size of the grid item
|
|
160
|
+
*/
|
|
161
|
+
max: GridLengthUnit;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Represents a grid track size
|
|
166
|
+
*/
|
|
167
|
+
type GridTrackSize = GridMinMaxSize | GridLengthUnit;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Represents a grid repeat track
|
|
171
|
+
*/
|
|
172
|
+
type GridRepeatTrack = {
|
|
173
|
+
/**
|
|
174
|
+
* The size of the grid track
|
|
175
|
+
*/
|
|
176
|
+
size: GridTrackSize;
|
|
177
|
+
/**
|
|
178
|
+
* The names of the grid lines
|
|
179
|
+
*/
|
|
180
|
+
names: Array<string>;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Represents a grid track repetition pattern
|
|
185
|
+
*/
|
|
186
|
+
type GridRepetitionCount = "auto-fill" | "auto-fit" | number;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Represents a track sizing function
|
|
190
|
+
*/
|
|
191
|
+
type GridTemplateComponent = {
|
|
192
|
+
"single": GridTrackSize;
|
|
193
|
+
} | {
|
|
194
|
+
"repeat": [GridRepetitionCount, Array<GridRepeatTrack>];
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Defines how images should be scaled when rendered.
|
|
199
|
+
*/
|
|
200
|
+
type ImageScalingAlgorithm = "auto" | "smooth" | "pixelated";
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Defines how flex items are aligned along the main axis.
|
|
204
|
+
*
|
|
205
|
+
* This enum determines how space is distributed between and around flex items
|
|
206
|
+
* along the main axis of the flex container.
|
|
207
|
+
*/
|
|
208
|
+
type JustifyContent = "start" | "end" | "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-evenly" | "space-around";
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Represents an angle value in degrees.
|
|
212
|
+
*/
|
|
213
|
+
type Angle = number;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Represents a gradient stop.
|
|
217
|
+
*/
|
|
218
|
+
type GradientStop = {
|
|
219
|
+
/**
|
|
220
|
+
* The color of the gradient stop.
|
|
221
|
+
*/
|
|
222
|
+
color: Color;
|
|
223
|
+
/**
|
|
224
|
+
* The position of the gradient stop (0% to 100%).
|
|
225
|
+
*/
|
|
226
|
+
hint: number | null;
|
|
227
|
+
} | number;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Represents a linear gradient.
|
|
231
|
+
*/
|
|
232
|
+
type LinearGradient = {
|
|
233
|
+
/**
|
|
234
|
+
* The angle of the gradient.
|
|
235
|
+
*/
|
|
236
|
+
angle: Angle;
|
|
237
|
+
/**
|
|
238
|
+
* The steps of the gradient.
|
|
239
|
+
*/
|
|
240
|
+
stops: Array<GradientStop>;
|
|
241
|
+
} | string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Represents either a linear gradient or a solid color.
|
|
245
|
+
*/
|
|
246
|
+
type LinearGradientOrColor = LinearGradient | Color;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A collection of linear gradients.
|
|
250
|
+
*/
|
|
251
|
+
type LinearGradients = Array<LinearGradient> | string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Defines how an image should be resized to fit its container.
|
|
255
|
+
*
|
|
256
|
+
* Similar to CSS object-fit property.
|
|
257
|
+
*/
|
|
258
|
+
type ObjectFit = "fill" | "contain" | "cover" | "scale-down" | "none";
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Defines the positioning method for an element.
|
|
262
|
+
*
|
|
263
|
+
* This enum determines how an element is positioned within its containing element.
|
|
264
|
+
*/
|
|
265
|
+
type Position = "relative" | "absolute";
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Represents the values for the four sides of a box (top, right, bottom, left).
|
|
269
|
+
*/
|
|
270
|
+
type Sides<T> = T | [T, T] | [T, T, T, T] | string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Text alignment options for text rendering.
|
|
274
|
+
*
|
|
275
|
+
* Corresponds to CSS text-align property values.
|
|
276
|
+
*/
|
|
277
|
+
type TextAlign = "left" | "right" | "center" | "justify" | "start" | "end";
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Defines how text should be overflowed.
|
|
281
|
+
*
|
|
282
|
+
* This enum determines how text should be handled when it exceeds the container width.
|
|
283
|
+
*/
|
|
284
|
+
type TextOverflow = "ellipsis" | "clip";
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Main styling structure that contains all layout and visual properties.
|
|
288
|
+
*/
|
|
289
|
+
type Style = {
|
|
290
|
+
/**
|
|
291
|
+
* Display algorithm to use for the element.
|
|
292
|
+
*/
|
|
293
|
+
display: Display;
|
|
294
|
+
/**
|
|
295
|
+
* Width of the element.
|
|
296
|
+
*/
|
|
297
|
+
width: LengthUnit;
|
|
298
|
+
/**
|
|
299
|
+
* Height of the element.
|
|
300
|
+
*/
|
|
301
|
+
height: LengthUnit;
|
|
302
|
+
/**
|
|
303
|
+
* Max width of the element.
|
|
304
|
+
*/
|
|
305
|
+
maxWidth: LengthUnit;
|
|
306
|
+
/**
|
|
307
|
+
* Max height of the element.
|
|
308
|
+
*/
|
|
309
|
+
maxHeight: LengthUnit;
|
|
310
|
+
/**
|
|
311
|
+
* Min width of the element.
|
|
312
|
+
*/
|
|
313
|
+
minWidth: LengthUnit;
|
|
314
|
+
/**
|
|
315
|
+
* Min height of the element.
|
|
316
|
+
*/
|
|
317
|
+
minHeight: LengthUnit;
|
|
318
|
+
/**
|
|
319
|
+
* Aspect ratio of the element (width/height).
|
|
320
|
+
*/
|
|
321
|
+
aspectRatio?: number;
|
|
322
|
+
/**
|
|
323
|
+
* Internal spacing around the element's content (top, right, bottom, left).
|
|
324
|
+
*/
|
|
325
|
+
padding: Sides<LengthUnit>;
|
|
326
|
+
/**
|
|
327
|
+
* Longhand: top padding. Overrides `padding` top value.
|
|
328
|
+
*/
|
|
329
|
+
paddingTop?: LengthUnit;
|
|
330
|
+
/**
|
|
331
|
+
* Longhand: right padding. Overrides `padding` right value.
|
|
332
|
+
*/
|
|
333
|
+
paddingRight?: LengthUnit;
|
|
334
|
+
/**
|
|
335
|
+
* Longhand: bottom padding. Overrides `padding` bottom value.
|
|
336
|
+
*/
|
|
337
|
+
paddingBottom?: LengthUnit;
|
|
338
|
+
/**
|
|
339
|
+
* Longhand: left padding. Overrides `padding` left value.
|
|
340
|
+
*/
|
|
341
|
+
paddingLeft?: LengthUnit;
|
|
342
|
+
/**
|
|
343
|
+
* External spacing around the element (top, right, bottom, left).
|
|
344
|
+
*/
|
|
345
|
+
margin: Sides<LengthUnit>;
|
|
346
|
+
/**
|
|
347
|
+
* Longhand: top margin. Overrides `margin` top value.
|
|
348
|
+
*/
|
|
349
|
+
marginTop?: LengthUnit;
|
|
350
|
+
/**
|
|
351
|
+
* Longhand: right margin. Overrides `margin` right value.
|
|
352
|
+
*/
|
|
353
|
+
marginRight?: LengthUnit;
|
|
354
|
+
/**
|
|
355
|
+
* Longhand: bottom margin. Overrides `margin` bottom value.
|
|
356
|
+
*/
|
|
357
|
+
marginBottom?: LengthUnit;
|
|
358
|
+
/**
|
|
359
|
+
* Longhand: left margin. Overrides `margin` left value.
|
|
360
|
+
*/
|
|
361
|
+
marginLeft?: LengthUnit;
|
|
362
|
+
/**
|
|
363
|
+
* Positioning offsets (top, right, bottom, left) from the element's normal position.
|
|
364
|
+
*/
|
|
365
|
+
inset: Sides<LengthUnit>;
|
|
366
|
+
/**
|
|
367
|
+
* Longhand: top offset. Overrides `inset` top value.
|
|
368
|
+
*/
|
|
369
|
+
top?: LengthUnit;
|
|
370
|
+
/**
|
|
371
|
+
* Longhand: right offset. Overrides `inset` right value.
|
|
372
|
+
*/
|
|
373
|
+
right?: LengthUnit;
|
|
374
|
+
/**
|
|
375
|
+
* Longhand: bottom offset. Overrides `inset` bottom value.
|
|
376
|
+
*/
|
|
377
|
+
bottom?: LengthUnit;
|
|
378
|
+
/**
|
|
379
|
+
* Longhand: left offset. Overrides `inset` left value.
|
|
380
|
+
*/
|
|
381
|
+
left?: LengthUnit;
|
|
382
|
+
/**
|
|
383
|
+
* Direction of flex layout (row or column).
|
|
384
|
+
*/
|
|
385
|
+
flexDirection: FlexDirection;
|
|
386
|
+
/**
|
|
387
|
+
* How a single grid item is aligned along the inline (row) axis, overriding the container's justify-items value.
|
|
388
|
+
*/
|
|
389
|
+
justifySelf?: AlignItems;
|
|
390
|
+
/**
|
|
391
|
+
* How items are aligned along the main axis.
|
|
392
|
+
*/
|
|
393
|
+
justifyContent?: JustifyContent;
|
|
394
|
+
/**
|
|
395
|
+
* How lines are aligned within the flex container when there's extra space in the cross axis.
|
|
396
|
+
*/
|
|
397
|
+
alignContent?: JustifyContent;
|
|
398
|
+
/**
|
|
399
|
+
* How grid items are aligned along the inline (row) axis within their grid areas.
|
|
400
|
+
*/
|
|
401
|
+
justifyItems?: AlignItems;
|
|
402
|
+
/**
|
|
403
|
+
* How items are aligned along the cross axis.
|
|
404
|
+
*/
|
|
405
|
+
alignItems?: AlignItems;
|
|
406
|
+
/**
|
|
407
|
+
* How a single item is aligned along the cross axis, overriding the container's align-items value.
|
|
408
|
+
*/
|
|
409
|
+
alignSelf?: AlignItems;
|
|
410
|
+
/**
|
|
411
|
+
* How flex items should wrap.
|
|
412
|
+
*/
|
|
413
|
+
flexWrap: FlexWrap;
|
|
414
|
+
/**
|
|
415
|
+
* The initial main size of the flex item before growing or shrinking.
|
|
416
|
+
*/
|
|
417
|
+
flexBasis: LengthUnit;
|
|
418
|
+
/**
|
|
419
|
+
* Positioning method (relative, absolute, etc.).
|
|
420
|
+
*/
|
|
421
|
+
position: Position;
|
|
422
|
+
/**
|
|
423
|
+
* Spacing between rows and columns in flex or grid layouts.
|
|
424
|
+
*/
|
|
425
|
+
gap: Gap;
|
|
426
|
+
/**
|
|
427
|
+
* How much the flex item should grow relative to other flex items when positive free space is distributed.
|
|
428
|
+
*/
|
|
429
|
+
flexGrow: number;
|
|
430
|
+
/**
|
|
431
|
+
* How much the flex item should shrink relative to other flex items when negative free space is distributed.
|
|
432
|
+
*/
|
|
433
|
+
flexShrink: number;
|
|
434
|
+
/**
|
|
435
|
+
* Width of the element's border on each side (top, right, bottom, left).
|
|
436
|
+
*/
|
|
437
|
+
borderWidth: Sides<LengthUnit>;
|
|
438
|
+
/**
|
|
439
|
+
* Longhand: top border width. Overrides `border_width` top value.
|
|
440
|
+
*/
|
|
441
|
+
borderWidthTop?: LengthUnit;
|
|
442
|
+
/**
|
|
443
|
+
* Longhand: right border width. Overrides `border_width` right value.
|
|
444
|
+
*/
|
|
445
|
+
borderWidthRight?: LengthUnit;
|
|
446
|
+
/**
|
|
447
|
+
* Longhand: bottom border width. Overrides `border_width` bottom value.
|
|
448
|
+
*/
|
|
449
|
+
borderWidthBottom?: LengthUnit;
|
|
450
|
+
/**
|
|
451
|
+
* Longhand: left border width. Overrides `border_width` left value.
|
|
452
|
+
*/
|
|
453
|
+
borderWidthLeft?: LengthUnit;
|
|
454
|
+
/**
|
|
455
|
+
* How images should be fitted within their container.
|
|
456
|
+
*/
|
|
457
|
+
objectFit: ObjectFit;
|
|
458
|
+
/**
|
|
459
|
+
* Background gradient(s).
|
|
460
|
+
*/
|
|
461
|
+
backgroundImage?: LinearGradients;
|
|
462
|
+
/**
|
|
463
|
+
* Background color for the element.
|
|
464
|
+
*/
|
|
465
|
+
backgroundColor?: Color;
|
|
466
|
+
/**
|
|
467
|
+
* Box shadow effect for the element.
|
|
468
|
+
*/
|
|
469
|
+
boxShadow?: BoxShadows;
|
|
470
|
+
/**
|
|
471
|
+
* Controls the size of implicitly-created grid columns.
|
|
472
|
+
*/
|
|
473
|
+
gridAutoColumns?: Array<GridTrackSize>;
|
|
474
|
+
/**
|
|
475
|
+
* Controls the size of implicitly-created grid rows.
|
|
476
|
+
*/
|
|
477
|
+
gridAutoRows?: Array<GridTrackSize>;
|
|
478
|
+
/**
|
|
479
|
+
* Controls how auto-placed items are inserted in the grid.
|
|
480
|
+
*/
|
|
481
|
+
gridAutoFlow?: GridAutoFlow;
|
|
482
|
+
/**
|
|
483
|
+
* Specifies a grid item's size and location within the grid column.
|
|
484
|
+
*/
|
|
485
|
+
gridColumn?: GridLine;
|
|
486
|
+
/**
|
|
487
|
+
* Specifies a grid item's size and location within the grid row.
|
|
488
|
+
*/
|
|
489
|
+
gridRow?: GridLine;
|
|
490
|
+
/**
|
|
491
|
+
* Defines the line names and track sizing functions of the grid columns.
|
|
492
|
+
*/
|
|
493
|
+
gridTemplateColumns?: Array<GridTemplateComponent>;
|
|
494
|
+
/**
|
|
495
|
+
* Defines the line names and track sizing functions of the grid rows.
|
|
496
|
+
*/
|
|
497
|
+
gridTemplateRows?: Array<GridTemplateComponent>;
|
|
498
|
+
/**
|
|
499
|
+
* How text should be overflowed.
|
|
500
|
+
*/
|
|
501
|
+
textOverflow?: TextOverflow;
|
|
502
|
+
/**
|
|
503
|
+
* Color of the element's border.
|
|
504
|
+
*/
|
|
505
|
+
borderColor?: Color;
|
|
506
|
+
/**
|
|
507
|
+
* Text color for child text elements.
|
|
508
|
+
*/
|
|
509
|
+
color?: LinearGradientOrColor;
|
|
510
|
+
/**
|
|
511
|
+
* Font size for text rendering.
|
|
512
|
+
*/
|
|
513
|
+
fontSize?: LengthUnit;
|
|
514
|
+
/**
|
|
515
|
+
* Font family name for text rendering.
|
|
516
|
+
*/
|
|
517
|
+
fontFamily?: FontFamily;
|
|
518
|
+
/**
|
|
519
|
+
* Line height for text spacing.
|
|
520
|
+
*/
|
|
521
|
+
lineHeight?: LengthUnit;
|
|
522
|
+
/**
|
|
523
|
+
* Font weight for text rendering.
|
|
524
|
+
*/
|
|
525
|
+
fontWeight?: FontWeight;
|
|
526
|
+
/**
|
|
527
|
+
* Maximum number of lines for text before truncation.
|
|
528
|
+
*/
|
|
529
|
+
lineClamp?: number;
|
|
530
|
+
/**
|
|
531
|
+
* Shorthand border radius (top, right, bottom, left).
|
|
532
|
+
*/
|
|
533
|
+
borderRadius?: Sides<LengthUnit>;
|
|
534
|
+
/**
|
|
535
|
+
* Longhand: top border radius. Overrides `border_radius` top value.
|
|
536
|
+
*/
|
|
537
|
+
borderRadiusTop?: LengthUnit;
|
|
538
|
+
/**
|
|
539
|
+
* Longhand: right border radius. Overrides `border_radius` right value.
|
|
540
|
+
*/
|
|
541
|
+
borderRadiusRight?: LengthUnit;
|
|
542
|
+
/**
|
|
543
|
+
* Longhand: bottom border radius. Overrides `border_radius` bottom value.
|
|
544
|
+
*/
|
|
545
|
+
borderRadiusBottom?: LengthUnit;
|
|
546
|
+
/**
|
|
547
|
+
* Longhand: left border radius. Overrides `border_radius` left value.
|
|
548
|
+
*/
|
|
549
|
+
borderRadiusLeft?: LengthUnit;
|
|
550
|
+
/**
|
|
551
|
+
* Text alignment within the element.
|
|
552
|
+
*/
|
|
553
|
+
textAlign?: TextAlign;
|
|
554
|
+
/**
|
|
555
|
+
* Additional spacing between characters in text.
|
|
556
|
+
*/
|
|
557
|
+
letterSpacing?: LengthUnit;
|
|
558
|
+
/**
|
|
559
|
+
* Controls how images are scaled when rendered.
|
|
560
|
+
*/
|
|
561
|
+
imageRendering?: ImageScalingAlgorithm;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
565
|
+
[key: string]: JsonValue;
|
|
566
|
+
};
|
|
567
|
+
type AnyNode = {
|
|
568
|
+
type: string;
|
|
569
|
+
[key: string]: JsonValue;
|
|
570
|
+
};
|
|
571
|
+
type PartialStyle = Partial<Style>;
|
|
572
|
+
type Node = ContainerNode | TextNode | ImageNode | AnyNode;
|
|
573
|
+
type ContainerNode = PartialStyle & {
|
|
574
|
+
type: "container";
|
|
575
|
+
children?: Node[];
|
|
576
|
+
};
|
|
577
|
+
type TextNode = PartialStyle & {
|
|
578
|
+
type: "text";
|
|
579
|
+
text: string;
|
|
580
|
+
};
|
|
581
|
+
type ImageNode = PartialStyle & {
|
|
582
|
+
type: "image";
|
|
583
|
+
src: string;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
export type { ContainerNode as C, ImageNode as I, Node as N, PartialStyle as P, Style as S, TextNode as T, Color as a };
|