@await-widget/runtime 0.0.5 → 0.0.6
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/package.json +1 -1
- package/types/await.d.ts +8 -0
- package/types/bridge.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/meta.d.ts +392 -0
- package/types/prop.d.ts +67 -399
package/package.json
CHANGED
package/types/await.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference path="./global.d.ts" />
|
|
2
2
|
/// <reference path="./prop.d.ts" />
|
|
3
3
|
/// <reference path="./jsx.d.ts" />
|
|
4
|
+
/// <reference path="./meta.d.ts" />
|
|
4
5
|
/// <reference path="./bridge.d.ts" />
|
|
5
6
|
declare module "await" {
|
|
6
7
|
export const Fragment: ({ children }: { children: NativeView }) => NativeView;
|
|
@@ -191,6 +192,13 @@ declare module "await" {
|
|
|
191
192
|
children?: never;
|
|
192
193
|
},
|
|
193
194
|
): NativeView;
|
|
195
|
+
export function Gif(
|
|
196
|
+
props: GifValue &
|
|
197
|
+
ID &
|
|
198
|
+
Mods & {
|
|
199
|
+
children: NativeView[];
|
|
200
|
+
},
|
|
201
|
+
): NativeView;
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
declare module "await/jsx-runtime" {
|
package/types/bridge.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/types/meta.d.ts
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
type CornerRadiusStyle = "circular" | "continuous";
|
|
2
|
+
|
|
3
|
+
type TimeStyle = "time" | "date" | "relative" | "offset" | "timer";
|
|
4
|
+
|
|
5
|
+
type Material = "regular" | "thin" | "thick" | "ultraThin" | "ultraThick";
|
|
6
|
+
|
|
7
|
+
type ShapeStyle =
|
|
8
|
+
| Color
|
|
9
|
+
| Material
|
|
10
|
+
| LinearGradient
|
|
11
|
+
| RadialGradient
|
|
12
|
+
| AngularGradient
|
|
13
|
+
| "primary"
|
|
14
|
+
| "secondary"
|
|
15
|
+
| "tertiary"
|
|
16
|
+
| "quaternary"
|
|
17
|
+
| "quinary";
|
|
18
|
+
|
|
19
|
+
type NativeAnimation = (
|
|
20
|
+
| {
|
|
21
|
+
type?:
|
|
22
|
+
| "linear"
|
|
23
|
+
| "default"
|
|
24
|
+
| "easeIn"
|
|
25
|
+
| "easeInOut"
|
|
26
|
+
| "easeOut"
|
|
27
|
+
| "circularEaseIn"
|
|
28
|
+
| "circularEaseInOut"
|
|
29
|
+
| "circularEaseOut";
|
|
30
|
+
duration?: number;
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
type: "interactiveSpring";
|
|
34
|
+
blendDuration?: number;
|
|
35
|
+
duration?: number;
|
|
36
|
+
bounce?: number;
|
|
37
|
+
}
|
|
38
|
+
| {
|
|
39
|
+
type: "bouncy";
|
|
40
|
+
bounce?: number;
|
|
41
|
+
duration?: number;
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
type: "smooth";
|
|
45
|
+
duration?: number;
|
|
46
|
+
bounce?: number;
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
type: "spring";
|
|
50
|
+
blendDuration?: number;
|
|
51
|
+
duration?: number;
|
|
52
|
+
bounce?: number;
|
|
53
|
+
}
|
|
54
|
+
| {
|
|
55
|
+
type: "timingCurve";
|
|
56
|
+
start: UnitPoint;
|
|
57
|
+
end: UnitPoint;
|
|
58
|
+
duration?: number;
|
|
59
|
+
}
|
|
60
|
+
| {
|
|
61
|
+
type: "snappy";
|
|
62
|
+
bounce?: number;
|
|
63
|
+
duration?: number;
|
|
64
|
+
}
|
|
65
|
+
) & {
|
|
66
|
+
value?: unknown;
|
|
67
|
+
delay?: number;
|
|
68
|
+
autoreverses?: boolean;
|
|
69
|
+
speed?: number;
|
|
70
|
+
loop?: boolean | number;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type ContentTransition =
|
|
74
|
+
| "identity"
|
|
75
|
+
| "interpolate"
|
|
76
|
+
| "opacity"
|
|
77
|
+
| "symbolEffect"
|
|
78
|
+
| "numericText"
|
|
79
|
+
| ["numericText", boolean]
|
|
80
|
+
| ["numericText", number];
|
|
81
|
+
|
|
82
|
+
type Edge = "top" | "bottom" | "leading" | "trailing";
|
|
83
|
+
|
|
84
|
+
type RawTransition =
|
|
85
|
+
| "identity"
|
|
86
|
+
| "blurReplace"
|
|
87
|
+
| "opacity"
|
|
88
|
+
| "slide"
|
|
89
|
+
| "scale"
|
|
90
|
+
| ["scale", number, UnitPoint?]
|
|
91
|
+
| ["push", Edge]
|
|
92
|
+
| ["offset", number, number]
|
|
93
|
+
| ["move", Edge];
|
|
94
|
+
|
|
95
|
+
type Transition = RawTransition | [RawTransition, RawTransition];
|
|
96
|
+
|
|
97
|
+
type Padding =
|
|
98
|
+
| number
|
|
99
|
+
| {
|
|
100
|
+
left?: number;
|
|
101
|
+
right?: number;
|
|
102
|
+
top?: number;
|
|
103
|
+
bottom?: number;
|
|
104
|
+
vertical?: number;
|
|
105
|
+
horizontal?: number;
|
|
106
|
+
other?: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
type RadialGradient = {
|
|
110
|
+
gradient: "radial";
|
|
111
|
+
colors?: Color[];
|
|
112
|
+
stops?: Array<[Color, number]>;
|
|
113
|
+
startRadius?: number;
|
|
114
|
+
endRadius?: number;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
type AngularGradient = {
|
|
118
|
+
gradient: "angular";
|
|
119
|
+
colors?: Color[];
|
|
120
|
+
stops?: Array<[Color, number]>;
|
|
121
|
+
angle?: number;
|
|
122
|
+
center?: UnitPoint;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
type LinearGradient = {
|
|
126
|
+
gradient: "linear";
|
|
127
|
+
colors?: Color[];
|
|
128
|
+
stops?: Stop[];
|
|
129
|
+
startPoint?: UnitPoint;
|
|
130
|
+
endPoint?: UnitPoint;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
type UnitPoint =
|
|
134
|
+
| "center"
|
|
135
|
+
| "zero"
|
|
136
|
+
| "leading"
|
|
137
|
+
| "trailing"
|
|
138
|
+
| "top"
|
|
139
|
+
| "topLeading"
|
|
140
|
+
| "topTrailing"
|
|
141
|
+
| "bottom"
|
|
142
|
+
| "bottomLeading"
|
|
143
|
+
| "bottomTrailing"
|
|
144
|
+
| Point;
|
|
145
|
+
|
|
146
|
+
type Stop = [Color, number];
|
|
147
|
+
|
|
148
|
+
type RawColor =
|
|
149
|
+
| ""
|
|
150
|
+
| "background"
|
|
151
|
+
| "black"
|
|
152
|
+
| "blue"
|
|
153
|
+
| "brown"
|
|
154
|
+
| "cyan"
|
|
155
|
+
| "gray"
|
|
156
|
+
| "green"
|
|
157
|
+
| "indigo"
|
|
158
|
+
| "magenta"
|
|
159
|
+
| "mint"
|
|
160
|
+
| "orange"
|
|
161
|
+
| "pink"
|
|
162
|
+
| "primary"
|
|
163
|
+
| "purple"
|
|
164
|
+
| "red"
|
|
165
|
+
| "secondary"
|
|
166
|
+
| "teal"
|
|
167
|
+
| "white"
|
|
168
|
+
| "yellow"
|
|
169
|
+
| string
|
|
170
|
+
| number;
|
|
171
|
+
|
|
172
|
+
type RawThemeColor = RawColor | [RawColor, number];
|
|
173
|
+
|
|
174
|
+
type Color =
|
|
175
|
+
| RawThemeColor
|
|
176
|
+
| {
|
|
177
|
+
dark?: RawThemeColor;
|
|
178
|
+
light?: RawThemeColor;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
type VerticalAlignment =
|
|
182
|
+
| "firstTextBaseline"
|
|
183
|
+
| "lastTextBaseline"
|
|
184
|
+
| "top"
|
|
185
|
+
| "bottom"
|
|
186
|
+
| "center";
|
|
187
|
+
|
|
188
|
+
type HorizontalAlignment =
|
|
189
|
+
| "listRowSeparatorLeading"
|
|
190
|
+
| "listRowSeparatorTrailing"
|
|
191
|
+
| "leading"
|
|
192
|
+
| "trailing"
|
|
193
|
+
| "center";
|
|
194
|
+
|
|
195
|
+
type Alignment =
|
|
196
|
+
| "leading"
|
|
197
|
+
| "trailing"
|
|
198
|
+
| "top"
|
|
199
|
+
| "bottom"
|
|
200
|
+
| "topLeading"
|
|
201
|
+
| "topTrailing"
|
|
202
|
+
| "bottomLeading"
|
|
203
|
+
| "bottomTrailing"
|
|
204
|
+
| "center"
|
|
205
|
+
| "trailingFirstTextBaseline"
|
|
206
|
+
| "leadingLastTextBaseline"
|
|
207
|
+
| "leadingFirstTextBaseline"
|
|
208
|
+
| "centerLastTextBaseline"
|
|
209
|
+
| "centerFirstTextBaseline"
|
|
210
|
+
| "trailingLastTextBaseline";
|
|
211
|
+
|
|
212
|
+
type Dimension = "max" | number;
|
|
213
|
+
|
|
214
|
+
type AspectRatio =
|
|
215
|
+
| "fill"
|
|
216
|
+
| "fit"
|
|
217
|
+
| [aspectRatio: number, contentMode: "fill" | "fit"];
|
|
218
|
+
|
|
219
|
+
type ID = {
|
|
220
|
+
id?: Encodable;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
type TextAlignment = "center" | "leading" | "trailing";
|
|
224
|
+
|
|
225
|
+
type FontDesign = "monospaced" | "rounded" | "serif" | "default";
|
|
226
|
+
|
|
227
|
+
type FontWeight =
|
|
228
|
+
| 100
|
|
229
|
+
| "ultraLight"
|
|
230
|
+
| 200
|
|
231
|
+
| "thin"
|
|
232
|
+
| 300
|
|
233
|
+
| "light"
|
|
234
|
+
| 400
|
|
235
|
+
| "regular"
|
|
236
|
+
| 500
|
|
237
|
+
| "medium"
|
|
238
|
+
| 600
|
|
239
|
+
| "semibold"
|
|
240
|
+
| 700
|
|
241
|
+
| "bold"
|
|
242
|
+
| 800
|
|
243
|
+
| "heavy"
|
|
244
|
+
| 900
|
|
245
|
+
| "black";
|
|
246
|
+
|
|
247
|
+
type FontWidth = "compressed" | "condensed" | "standard" | "expanded" | number;
|
|
248
|
+
|
|
249
|
+
type Interpolation = "none" | "low" | "medium" | "high";
|
|
250
|
+
|
|
251
|
+
type Resizable = boolean | "stretch" | "tile";
|
|
252
|
+
|
|
253
|
+
type Point =
|
|
254
|
+
| number
|
|
255
|
+
| {
|
|
256
|
+
x?: number;
|
|
257
|
+
y?: number;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
type ScaleEffect =
|
|
261
|
+
| number
|
|
262
|
+
| {
|
|
263
|
+
scale?: number;
|
|
264
|
+
anchor?: UnitPoint;
|
|
265
|
+
}
|
|
266
|
+
| {
|
|
267
|
+
x?: number;
|
|
268
|
+
y?: number;
|
|
269
|
+
anchor?: UnitPoint;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
type Font = {
|
|
273
|
+
name: string;
|
|
274
|
+
size: number;
|
|
275
|
+
wght?: number;
|
|
276
|
+
wdth?: number;
|
|
277
|
+
opsz?: number;
|
|
278
|
+
slnt?: number;
|
|
279
|
+
ital?: number;
|
|
280
|
+
|
|
281
|
+
GRAD?: number;
|
|
282
|
+
HGHT?: number;
|
|
283
|
+
SOFT?: number;
|
|
284
|
+
|
|
285
|
+
monospacedDigit?: boolean;
|
|
286
|
+
features?: string[] | string;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
type Rotation3DEffect = {
|
|
290
|
+
angle: number;
|
|
291
|
+
x?: number;
|
|
292
|
+
y?: number;
|
|
293
|
+
z?: number;
|
|
294
|
+
anchor?: UnitPoint;
|
|
295
|
+
anchorZ?: number;
|
|
296
|
+
perspective?: number;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
type RotationEffect =
|
|
300
|
+
| number
|
|
301
|
+
| {
|
|
302
|
+
angle: number;
|
|
303
|
+
anchor: UnitPoint;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
type Frame =
|
|
307
|
+
| {
|
|
308
|
+
maxWidth?: Dimension;
|
|
309
|
+
maxHeight?: Dimension;
|
|
310
|
+
alignment?: Alignment;
|
|
311
|
+
}
|
|
312
|
+
| {
|
|
313
|
+
width?: number;
|
|
314
|
+
height?: number;
|
|
315
|
+
alignment?: Alignment;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type Shadow = {
|
|
319
|
+
color?: Color;
|
|
320
|
+
x?: number;
|
|
321
|
+
y?: number;
|
|
322
|
+
blur?: number;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
type Pattern = "dash" | "dashDot" | "dashDotDot" | "dot" | "solid";
|
|
326
|
+
|
|
327
|
+
type BlendMode =
|
|
328
|
+
| "normal"
|
|
329
|
+
| "multiply"
|
|
330
|
+
| "screen"
|
|
331
|
+
| "overlay"
|
|
332
|
+
| "darken"
|
|
333
|
+
| "lighten"
|
|
334
|
+
| "colorDodge"
|
|
335
|
+
| "colorBurn"
|
|
336
|
+
| "softLight"
|
|
337
|
+
| "hardLight"
|
|
338
|
+
| "difference"
|
|
339
|
+
| "exclusion"
|
|
340
|
+
| "hue"
|
|
341
|
+
| "saturation"
|
|
342
|
+
| "color"
|
|
343
|
+
| "luminosity"
|
|
344
|
+
| "sourceAtop"
|
|
345
|
+
| "destinationOver"
|
|
346
|
+
| "destinationOut"
|
|
347
|
+
| "plusDarker"
|
|
348
|
+
| "plusLighter";
|
|
349
|
+
|
|
350
|
+
type ButtonStyle =
|
|
351
|
+
| "automatic"
|
|
352
|
+
| "bordered"
|
|
353
|
+
| "borderedProminent"
|
|
354
|
+
| "borderless"
|
|
355
|
+
| "plain"
|
|
356
|
+
| CustomButtonStyle;
|
|
357
|
+
|
|
358
|
+
type CustomButtonStyle = {
|
|
359
|
+
press: NativeView;
|
|
360
|
+
normal: NativeView;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
type GifDuration = 2 | 4 | 6 | 10 | 12 | 20 | 30 | 60;
|
|
364
|
+
|
|
365
|
+
type LineHeight =
|
|
366
|
+
| number
|
|
367
|
+
| "loose"
|
|
368
|
+
| "normal"
|
|
369
|
+
| "tight"
|
|
370
|
+
| "variable"
|
|
371
|
+
| [type: "multiple" | "leading", value: number];
|
|
372
|
+
|
|
373
|
+
type Blur =
|
|
374
|
+
| number
|
|
375
|
+
| {
|
|
376
|
+
blur: number;
|
|
377
|
+
opaque?: boolean;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
type FixedSize =
|
|
381
|
+
| boolean
|
|
382
|
+
| {
|
|
383
|
+
horizontal?: boolean;
|
|
384
|
+
vertical?: boolean;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
type strikethrough =
|
|
388
|
+
| boolean
|
|
389
|
+
| {
|
|
390
|
+
isActive?: boolean;
|
|
391
|
+
color?: Color;
|
|
392
|
+
};
|
package/types/prop.d.ts
CHANGED
|
@@ -1,123 +1,36 @@
|
|
|
1
|
-
type
|
|
1
|
+
type Props = Record<string, unknown>;
|
|
2
2
|
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
| "secondary"
|
|
8
|
-
| "tertiary"
|
|
9
|
-
| "quaternary"
|
|
10
|
-
| "quinary"
|
|
11
|
-
| LinearGradient
|
|
12
|
-
| RadialGradient
|
|
13
|
-
| AngularGradient;
|
|
14
|
-
|
|
15
|
-
type NativeAnimation = (
|
|
16
|
-
| {
|
|
17
|
-
type?:
|
|
18
|
-
| "linear"
|
|
19
|
-
| "default"
|
|
20
|
-
| "easeIn"
|
|
21
|
-
| "easeInOut"
|
|
22
|
-
| "easeOut"
|
|
23
|
-
| "circularEaseIn"
|
|
24
|
-
| "circularEaseInOut"
|
|
25
|
-
| "circularEaseOut";
|
|
26
|
-
duration?: number;
|
|
27
|
-
}
|
|
28
|
-
| {
|
|
29
|
-
type: "interactiveSpring";
|
|
30
|
-
blendDuration?: number;
|
|
31
|
-
duration?: number;
|
|
32
|
-
bounce?: number;
|
|
33
|
-
}
|
|
34
|
-
| {
|
|
35
|
-
type: "bouncy";
|
|
36
|
-
bounce?: number;
|
|
37
|
-
duration?: number;
|
|
38
|
-
}
|
|
39
|
-
| {
|
|
40
|
-
type: "smooth";
|
|
41
|
-
duration?: number;
|
|
42
|
-
bounce?: number;
|
|
43
|
-
}
|
|
44
|
-
| {
|
|
45
|
-
type: "spring";
|
|
46
|
-
blendDuration?: number;
|
|
47
|
-
duration?: number;
|
|
48
|
-
bounce?: number;
|
|
49
|
-
}
|
|
50
|
-
| {
|
|
51
|
-
type: "timingCurve";
|
|
52
|
-
start: UnitPoint;
|
|
53
|
-
end: UnitPoint;
|
|
54
|
-
duration?: number;
|
|
55
|
-
}
|
|
56
|
-
| {
|
|
57
|
-
type: "snappy";
|
|
58
|
-
bounce?: number;
|
|
59
|
-
duration?: number;
|
|
60
|
-
}
|
|
61
|
-
) & {
|
|
62
|
-
value?: unknown;
|
|
63
|
-
delay?: number;
|
|
64
|
-
autoreverses?: boolean;
|
|
65
|
-
speed?: number;
|
|
66
|
-
loop?: boolean | number;
|
|
3
|
+
type VStackValue = {
|
|
4
|
+
spacing?: number;
|
|
5
|
+
/** Horizontal alignment for child views. */
|
|
6
|
+
alignment?: HorizontalAlignment;
|
|
67
7
|
};
|
|
68
8
|
|
|
69
|
-
type
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
| "numericText"
|
|
75
|
-
| ["numericText", boolean]
|
|
76
|
-
| ["numericText", number];
|
|
77
|
-
|
|
78
|
-
type Edge = "top" | "bottom" | "leading" | "trailing";
|
|
79
|
-
|
|
80
|
-
type RawTransition =
|
|
81
|
-
| "identity"
|
|
82
|
-
| "blurReplace"
|
|
83
|
-
| "opacity"
|
|
84
|
-
| "slide"
|
|
85
|
-
| "scale"
|
|
86
|
-
| ["scale", number, UnitPoint?]
|
|
87
|
-
| ["push", Edge]
|
|
88
|
-
| ["offset", number, number]
|
|
89
|
-
| ["move", Edge];
|
|
90
|
-
|
|
91
|
-
type Transition = RawTransition | [RawTransition, RawTransition];
|
|
9
|
+
type HStackValue = {
|
|
10
|
+
spacing?: number;
|
|
11
|
+
/** Vertical alignment for child views. */
|
|
12
|
+
alignment?: VerticalAlignment;
|
|
13
|
+
};
|
|
92
14
|
|
|
93
|
-
type
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
top?: number;
|
|
98
|
-
bottom?: number;
|
|
99
|
-
vertical?: number;
|
|
100
|
-
horizontal?: number;
|
|
101
|
-
other?: number;
|
|
102
|
-
}
|
|
103
|
-
| number;
|
|
15
|
+
type ZStackValue = {
|
|
16
|
+
/** Horizontal and vertical alignment for child views. */
|
|
17
|
+
alignment?: Alignment;
|
|
18
|
+
};
|
|
104
19
|
|
|
105
|
-
type
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
right?: Dimension;
|
|
115
|
-
};
|
|
116
|
-
style?: CornerRadiusStyle;
|
|
20
|
+
type ButtonValue = {
|
|
21
|
+
/** Intent returned by `Await.define(...)`, used to run a registered widget intent when the button is tapped. */
|
|
22
|
+
intent?: IntentInfo;
|
|
23
|
+
/** Only applies in the app; triggers the button as soon as the touch begins. */
|
|
24
|
+
fast?: boolean;
|
|
25
|
+
/** Requests permission to play audio. */
|
|
26
|
+
audio?: boolean;
|
|
27
|
+
/** Opens a universal link directly, such as `https://github.com/await-widget/skills`. */
|
|
28
|
+
url?: string;
|
|
117
29
|
};
|
|
118
30
|
|
|
119
31
|
type ShapeValue = {
|
|
120
32
|
fill?: ShapeStyle;
|
|
33
|
+
/** Only centered strokes are supported. */
|
|
121
34
|
stroke?: {
|
|
122
35
|
color?: Color;
|
|
123
36
|
lineWidth?: number;
|
|
@@ -146,28 +59,33 @@ type RoundedRectangleValue = {
|
|
|
146
59
|
style?: CornerRadiusStyle;
|
|
147
60
|
};
|
|
148
61
|
|
|
149
|
-
type
|
|
150
|
-
|
|
151
|
-
|
|
62
|
+
type UnevenRoundedRectangleValue = {
|
|
63
|
+
rectRadius?: {
|
|
64
|
+
topLeft?: Dimension;
|
|
65
|
+
topRight?: Dimension;
|
|
66
|
+
bottomRight?: Dimension;
|
|
67
|
+
bottomLeft?: Dimension;
|
|
68
|
+
bottom?: Dimension;
|
|
69
|
+
top?: Dimension;
|
|
70
|
+
left?: Dimension;
|
|
71
|
+
right?: Dimension;
|
|
72
|
+
};
|
|
73
|
+
style?: CornerRadiusStyle;
|
|
152
74
|
};
|
|
153
75
|
|
|
154
|
-
type
|
|
155
|
-
|
|
156
|
-
alignment?: VerticalAlignment;
|
|
76
|
+
type CapsuleValue = {
|
|
77
|
+
style?: CornerRadiusStyle;
|
|
157
78
|
};
|
|
158
79
|
|
|
159
|
-
type
|
|
160
|
-
|
|
80
|
+
type SectorValue = {
|
|
81
|
+
value: [start: number, end: number];
|
|
161
82
|
};
|
|
162
83
|
|
|
163
|
-
type
|
|
164
|
-
|
|
84
|
+
type PolygonValue = {
|
|
85
|
+
value: Array<[x: number, y: number]>;
|
|
165
86
|
};
|
|
166
87
|
|
|
167
|
-
type
|
|
168
|
-
intent?: IntentInfo;
|
|
169
|
-
fast?: boolean;
|
|
170
|
-
audio?: boolean;
|
|
88
|
+
type LinkValue = {
|
|
171
89
|
url?: string;
|
|
172
90
|
};
|
|
173
91
|
|
|
@@ -176,295 +94,54 @@ type ColorValue = {
|
|
|
176
94
|
};
|
|
177
95
|
|
|
178
96
|
type TextValue = {
|
|
97
|
+
/** Text or encodable value rendered by the component. */
|
|
179
98
|
value?: Encodable;
|
|
180
99
|
};
|
|
181
100
|
|
|
182
101
|
type ImageValue = {
|
|
102
|
+
/** Local or remote path such as `img.png` `path/img.png` `https://example.com/img.png` */
|
|
183
103
|
url?: string;
|
|
104
|
+
/** The modes used to resize an image to fit within its containing view. */
|
|
184
105
|
resizable?: Resizable;
|
|
106
|
+
/** The level of quality for rendering an image that requires interpolation, such as a scaled image. */
|
|
185
107
|
interpolation?: Interpolation;
|
|
108
|
+
/** A type that indicates how images are rendered */
|
|
186
109
|
style?: TemplateRenderingMode;
|
|
187
110
|
};
|
|
188
111
|
|
|
189
112
|
type IconValue = {
|
|
113
|
+
/** The name of the system symbol image. Use the SF Symbols app to look up the names of system symbol images. */
|
|
190
114
|
value?: string;
|
|
191
115
|
};
|
|
192
116
|
|
|
193
|
-
type TimeValueStrict = {
|
|
194
|
-
value?: number;
|
|
195
|
-
style?: "time" | "date" | "relative" | "offset" | "timer";
|
|
196
|
-
};
|
|
197
|
-
|
|
198
117
|
type TimeValue = {
|
|
199
118
|
date?: Date;
|
|
200
|
-
|
|
119
|
+
/** Use `timer` to update once per second. */
|
|
120
|
+
style?: TimeStyle;
|
|
201
121
|
};
|
|
202
122
|
|
|
203
123
|
type SvgValue = {
|
|
124
|
+
/** For example, `img.png`, `path/img.png`, or `https://example.com/img.png`. */
|
|
204
125
|
url?: string;
|
|
126
|
+
/** For example, `<svg><path d="M0 0h10v10h-10z"/></svg>`. */
|
|
205
127
|
value?: string;
|
|
206
128
|
};
|
|
207
129
|
|
|
208
|
-
type CapsuleValue = {
|
|
209
|
-
style?: CornerRadiusStyle;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
type SectorValue = {
|
|
213
|
-
value: [start: number, end: number];
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
type PolygonValue = {
|
|
217
|
-
value: Array<[x: number, y: number]>;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
130
|
type SpacerValue = {
|
|
221
131
|
minLength?: number;
|
|
222
132
|
};
|
|
223
133
|
|
|
224
|
-
type
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
stops?: Array<[Color, number]>;
|
|
228
|
-
startRadius?: number;
|
|
229
|
-
endRadius?: number;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
type AngularGradient = {
|
|
233
|
-
gradient: "angular";
|
|
234
|
-
colors?: Color[];
|
|
235
|
-
stops?: Array<[Color, number]>;
|
|
236
|
-
angle?: number;
|
|
237
|
-
center?: UnitPoint;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
type LinearGradient = {
|
|
241
|
-
gradient: "linear";
|
|
242
|
-
colors?: Color[];
|
|
243
|
-
stops?: Stop[];
|
|
244
|
-
startPoint?: UnitPoint;
|
|
245
|
-
endPoint?: UnitPoint;
|
|
134
|
+
type GifValue = {
|
|
135
|
+
size: Size;
|
|
136
|
+
duration: GifDuration;
|
|
246
137
|
};
|
|
247
138
|
|
|
248
|
-
type
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
| "trailing"
|
|
253
|
-
| "top"
|
|
254
|
-
| "topLeading"
|
|
255
|
-
| "topTrailing"
|
|
256
|
-
| "bottom"
|
|
257
|
-
| "bottomLeading"
|
|
258
|
-
| "bottomTrailing"
|
|
259
|
-
| Point;
|
|
260
|
-
|
|
261
|
-
type Stop = [Color, number];
|
|
262
|
-
|
|
263
|
-
type RawColor =
|
|
264
|
-
| ""
|
|
265
|
-
| "background"
|
|
266
|
-
| "black"
|
|
267
|
-
| "blue"
|
|
268
|
-
| "brown"
|
|
269
|
-
| "cyan"
|
|
270
|
-
| "gray"
|
|
271
|
-
| "green"
|
|
272
|
-
| "indigo"
|
|
273
|
-
| "magenta"
|
|
274
|
-
| "mint"
|
|
275
|
-
| "orange"
|
|
276
|
-
| "pink"
|
|
277
|
-
| "primary"
|
|
278
|
-
| "purple"
|
|
279
|
-
| "red"
|
|
280
|
-
| "secondary"
|
|
281
|
-
| "teal"
|
|
282
|
-
| "white"
|
|
283
|
-
| "yellow"
|
|
284
|
-
| string
|
|
285
|
-
| number;
|
|
286
|
-
|
|
287
|
-
type RawThemeColor = RawColor | [RawColor, number];
|
|
288
|
-
|
|
289
|
-
type Color =
|
|
290
|
-
| RawThemeColor
|
|
291
|
-
| {
|
|
292
|
-
dark?: RawThemeColor;
|
|
293
|
-
light?: RawThemeColor;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
type VerticalAlignment =
|
|
297
|
-
| "firstTextBaseline"
|
|
298
|
-
| "lastTextBaseline"
|
|
299
|
-
| "top"
|
|
300
|
-
| "bottom"
|
|
301
|
-
| "center";
|
|
302
|
-
|
|
303
|
-
type HorizontalAlignment =
|
|
304
|
-
| "listRowSeparatorLeading"
|
|
305
|
-
| "listRowSeparatorTrailing"
|
|
306
|
-
| "leading"
|
|
307
|
-
| "trailing"
|
|
308
|
-
| "center";
|
|
309
|
-
|
|
310
|
-
type Alignment =
|
|
311
|
-
| "leading"
|
|
312
|
-
| "trailing"
|
|
313
|
-
| "top"
|
|
314
|
-
| "bottom"
|
|
315
|
-
| "topLeading"
|
|
316
|
-
| "topTrailing"
|
|
317
|
-
| "bottomLeading"
|
|
318
|
-
| "bottomTrailing"
|
|
319
|
-
| "center"
|
|
320
|
-
| "trailingFirstTextBaseline"
|
|
321
|
-
| "leadingLastTextBaseline"
|
|
322
|
-
| "leadingFirstTextBaseline"
|
|
323
|
-
| "centerLastTextBaseline"
|
|
324
|
-
| "centerFirstTextBaseline"
|
|
325
|
-
| "trailingLastTextBaseline";
|
|
326
|
-
|
|
327
|
-
type Dimension = "max" | number;
|
|
328
|
-
type AspectRatio =
|
|
329
|
-
| "fill"
|
|
330
|
-
| "fit"
|
|
331
|
-
| [aspectRatio: number, contentMode: "fill" | "fit"];
|
|
332
|
-
|
|
333
|
-
type LooseValues = {
|
|
334
|
-
[P in keyof (ButtonValue &
|
|
335
|
-
HStackValue &
|
|
336
|
-
VStackValue &
|
|
337
|
-
ZStackValue &
|
|
338
|
-
ColorValue &
|
|
339
|
-
ImageValue &
|
|
340
|
-
LinkValue &
|
|
341
|
-
SpacerValue &
|
|
342
|
-
SvgValue &
|
|
343
|
-
IconValue &
|
|
344
|
-
TextValue &
|
|
345
|
-
TimeValueStrict &
|
|
346
|
-
CapsuleValue &
|
|
347
|
-
RoundedRectangleValue &
|
|
348
|
-
SectorValue &
|
|
349
|
-
ShapeValue &
|
|
350
|
-
UnevenRoundedRectangleValue)]?: unknown;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
type Props = ID & Mods & LooseValues & { children?: NativeView };
|
|
354
|
-
type ID = { id?: Encodable };
|
|
355
|
-
type TextAlignment = "center" | "leading" | "trailing";
|
|
356
|
-
type FontDesign = "monospaced" | "rounded" | "serif" | "default";
|
|
357
|
-
type FontWeight =
|
|
358
|
-
| "black"
|
|
359
|
-
| 900
|
|
360
|
-
| "heavy"
|
|
361
|
-
| 800
|
|
362
|
-
| "bold"
|
|
363
|
-
| 700
|
|
364
|
-
| "semibold"
|
|
365
|
-
| 600
|
|
366
|
-
| "medium"
|
|
367
|
-
| 500
|
|
368
|
-
| "light"
|
|
369
|
-
| 300
|
|
370
|
-
| "thin"
|
|
371
|
-
| 200
|
|
372
|
-
| "ultraLight"
|
|
373
|
-
| 100
|
|
374
|
-
| "regular"
|
|
375
|
-
| 400;
|
|
376
|
-
|
|
377
|
-
type Material = "regular" | "thin" | "thick" | "ultraThin" | "ultraThick";
|
|
378
|
-
type FontWidth = "compressed" | "condensed" | "standard" | "expanded" | number;
|
|
379
|
-
type Interpolation = "none" | "low" | "medium" | "high";
|
|
380
|
-
type Resizable = boolean | "stretch" | "tile";
|
|
381
|
-
|
|
382
|
-
type Point = { x?: number; y?: number } | number;
|
|
383
|
-
type ScaleEffect =
|
|
384
|
-
| { x?: number; y?: number; anchor?: UnitPoint }
|
|
385
|
-
| { scale?: number; anchor?: UnitPoint }
|
|
386
|
-
| number;
|
|
387
|
-
type Font = {
|
|
388
|
-
name: string;
|
|
389
|
-
size: number;
|
|
390
|
-
wght?: number;
|
|
391
|
-
wdth?: number;
|
|
392
|
-
opsz?: number;
|
|
393
|
-
slnt?: number;
|
|
394
|
-
ital?: number;
|
|
395
|
-
|
|
396
|
-
GRAD?: number;
|
|
397
|
-
HGHT?: number;
|
|
398
|
-
SOFT?: number;
|
|
399
|
-
|
|
400
|
-
monospacedDigit?: boolean;
|
|
401
|
-
features?: string[] | string;
|
|
402
|
-
};
|
|
403
|
-
type Rotation3DEffect = {
|
|
404
|
-
angle: number;
|
|
405
|
-
x?: number;
|
|
406
|
-
y?: number;
|
|
407
|
-
z?: number;
|
|
408
|
-
anchor?: UnitPoint;
|
|
409
|
-
anchorZ?: number;
|
|
410
|
-
perspective?: number;
|
|
411
|
-
};
|
|
412
|
-
type RotationEffect = { angle: number; anchor: UnitPoint } | number;
|
|
413
|
-
|
|
414
|
-
type Frame =
|
|
415
|
-
| { maxWidth?: Dimension; maxHeight?: Dimension; alignment?: Alignment }
|
|
416
|
-
| { width?: number; height?: number; alignment?: Alignment };
|
|
417
|
-
type Shadow = {
|
|
418
|
-
color?: Color;
|
|
419
|
-
x?: number;
|
|
420
|
-
y?: number;
|
|
421
|
-
blur?: number;
|
|
422
|
-
};
|
|
423
|
-
type Pattern = "dash" | "dashDot" | "dashDotDot" | "dot" | "solid";
|
|
424
|
-
type BlendMode =
|
|
425
|
-
| "normal"
|
|
426
|
-
| "multiply"
|
|
427
|
-
| "screen"
|
|
428
|
-
| "overlay"
|
|
429
|
-
| "darken"
|
|
430
|
-
| "lighten"
|
|
431
|
-
| "colorDodge"
|
|
432
|
-
| "colorBurn"
|
|
433
|
-
| "softLight"
|
|
434
|
-
| "hardLight"
|
|
435
|
-
| "difference"
|
|
436
|
-
| "exclusion"
|
|
437
|
-
| "hue"
|
|
438
|
-
| "saturation"
|
|
439
|
-
| "color"
|
|
440
|
-
| "luminosity"
|
|
441
|
-
| "sourceAtop"
|
|
442
|
-
| "destinationOver"
|
|
443
|
-
| "destinationOut"
|
|
444
|
-
| "plusDarker"
|
|
445
|
-
| "plusLighter";
|
|
446
|
-
|
|
447
|
-
type ButtonStyle =
|
|
448
|
-
| "automatic"
|
|
449
|
-
| "bordered"
|
|
450
|
-
| "borderedProminent"
|
|
451
|
-
| "borderless"
|
|
452
|
-
| "plain"
|
|
453
|
-
| CustomButtonStyle;
|
|
454
|
-
|
|
455
|
-
type CustomButtonStyle = {
|
|
456
|
-
press: NativeView;
|
|
457
|
-
normal: NativeView;
|
|
139
|
+
type Mods = {
|
|
140
|
+
[K in keyof BaseMods]?: BaseMods[K];
|
|
141
|
+
} & {
|
|
142
|
+
[K in keyof BaseMods as `${K & string}_${string}`]?: BaseMods[K];
|
|
458
143
|
};
|
|
459
144
|
|
|
460
|
-
type LineHeight =
|
|
461
|
-
| number
|
|
462
|
-
| [type: "multiple" | "leading", value: number]
|
|
463
|
-
| "loose"
|
|
464
|
-
| "normal"
|
|
465
|
-
| "tight"
|
|
466
|
-
| "variable";
|
|
467
|
-
|
|
468
145
|
type BaseMods = {
|
|
469
146
|
animation?: NativeAnimation | number | "";
|
|
470
147
|
aspectRatio?: AspectRatio;
|
|
@@ -474,7 +151,7 @@ type BaseMods = {
|
|
|
474
151
|
| { alignment: Alignment; content: NativeView };
|
|
475
152
|
baselineOffset?: number;
|
|
476
153
|
blendMode?: BlendMode;
|
|
477
|
-
blur?:
|
|
154
|
+
blur?: Blur;
|
|
478
155
|
brightness?: number;
|
|
479
156
|
buttonStyle?: ButtonStyle;
|
|
480
157
|
clipped?: boolean;
|
|
@@ -489,7 +166,7 @@ type BaseMods = {
|
|
|
489
166
|
debug?: boolean;
|
|
490
167
|
disable?: boolean;
|
|
491
168
|
drawingGroup?: boolean;
|
|
492
|
-
fixedSize?:
|
|
169
|
+
fixedSize?: FixedSize;
|
|
493
170
|
font?: Font | "";
|
|
494
171
|
fontDesign?: FontDesign | "";
|
|
495
172
|
fontSize?: number;
|
|
@@ -506,9 +183,9 @@ type BaseMods = {
|
|
|
506
183
|
italic?: boolean;
|
|
507
184
|
kerning?: number;
|
|
508
185
|
layoutPriority?: number;
|
|
186
|
+
lineHeight?: LineHeight | "";
|
|
509
187
|
lineLimit?: number | "";
|
|
510
188
|
lineSpacing?: number;
|
|
511
|
-
lineHeight?: LineHeight | "";
|
|
512
189
|
luminanceToAlpha?: boolean;
|
|
513
190
|
mask?: NativeView;
|
|
514
191
|
maxHeight?: Dimension | boolean;
|
|
@@ -535,7 +212,9 @@ type BaseMods = {
|
|
|
535
212
|
scaleEffect?: ScaleEffect;
|
|
536
213
|
shadow?: Shadow;
|
|
537
214
|
sides?: number;
|
|
538
|
-
strikethrough?:
|
|
215
|
+
strikethrough?:
|
|
216
|
+
| boolean
|
|
217
|
+
| { isActive?: boolean; pattern?: Pattern; color?: Color };
|
|
539
218
|
test?: unknown;
|
|
540
219
|
textAlignment?: TextAlignment;
|
|
541
220
|
tint?: ShapeStyle;
|
|
@@ -543,21 +222,10 @@ type BaseMods = {
|
|
|
543
222
|
transform?: [number, number, number, number, number, number];
|
|
544
223
|
transition?: Transition;
|
|
545
224
|
truncationMode?: "head" | "middle" | "tail";
|
|
225
|
+
typesettingLanguage?: string;
|
|
546
226
|
underline?:
|
|
547
227
|
| boolean
|
|
548
228
|
| { isActive?: boolean; pattern?: Pattern; color?: Color };
|
|
549
229
|
width?: number;
|
|
550
230
|
zIndex?: number;
|
|
551
231
|
};
|
|
552
|
-
|
|
553
|
-
type Mods = {
|
|
554
|
-
[K in keyof BaseMods]?: BaseMods[K];
|
|
555
|
-
} & {
|
|
556
|
-
[K in keyof BaseMods as `${K & string}_${string}`]?: BaseMods[K];
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
type ObjectToTuple<T> = {
|
|
560
|
-
[K in keyof T]: [K, T[K]];
|
|
561
|
-
}[keyof T];
|
|
562
|
-
|
|
563
|
-
type ModTuple = ObjectToTuple<BaseMods>;
|