@await-widget/runtime 0.0.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.
@@ -0,0 +1,569 @@
1
+ type CornerRadiusStyle = "circular" | "continuous";
2
+
3
+ type ShapeStyle =
4
+ | Color
5
+ | Material
6
+ | "primary"
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;
67
+ };
68
+
69
+ type ContentTransition =
70
+ | "identity"
71
+ | "interpolate"
72
+ | "opacity"
73
+ | "symbolEffect"
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];
92
+
93
+ type Padding =
94
+ | {
95
+ left?: number;
96
+ right?: number;
97
+ top?: number;
98
+ bottom?: number;
99
+ vertical?: number;
100
+ horizontal?: number;
101
+ other?: number;
102
+ }
103
+ | number;
104
+
105
+ type UnevenRoundedRectangleValue = {
106
+ rectRadius?: {
107
+ topLeft?: Dimension;
108
+ topRight?: Dimension;
109
+ bottomRight?: Dimension;
110
+ bottomLeft?: Dimension;
111
+ bottom?: Dimension;
112
+ top?: Dimension;
113
+ left?: Dimension;
114
+ right?: Dimension;
115
+ };
116
+ style?: CornerRadiusStyle;
117
+ };
118
+
119
+ type ShapeValue = {
120
+ fill?: ShapeStyle;
121
+ stroke?: {
122
+ color?: Color;
123
+ lineWidth?: number;
124
+ lineCap?: string;
125
+ lineJoin?: string;
126
+ miterLimit?: number;
127
+ dash?: number[];
128
+ dashPhase?: number;
129
+ };
130
+ shape?: {
131
+ trim?: [number, number];
132
+ rotation?: RotationEffect;
133
+ offset?: Point;
134
+ scale?: ScaleEffect;
135
+ in?: {
136
+ x: number;
137
+ y: number;
138
+ width: number;
139
+ height: number;
140
+ };
141
+ };
142
+ };
143
+
144
+ type RoundedRectangleValue = {
145
+ rectRadius?: Dimension;
146
+ style?: CornerRadiusStyle;
147
+ };
148
+
149
+ type VStackValue = {
150
+ spacing?: number;
151
+ alignment?: HorizontalAlignment;
152
+ };
153
+
154
+ type HStackValue = {
155
+ spacing?: number;
156
+ alignment?: VerticalAlignment;
157
+ };
158
+
159
+ type ZStackValue = {
160
+ alignment?: Alignment;
161
+ };
162
+
163
+ type LinkValue = {
164
+ url?: string;
165
+ };
166
+
167
+ type ButtonValue = {
168
+ intent?: IntentInfo;
169
+ fast?: boolean;
170
+ audio?: boolean;
171
+ url?: string;
172
+ };
173
+
174
+ type ColorValue = {
175
+ value?: Color;
176
+ };
177
+
178
+ type TextValue = {
179
+ value?: Encodable;
180
+ };
181
+
182
+ type ImageValue = {
183
+ url?: string;
184
+ resizable?: Resizable;
185
+ interpolation?: Interpolation;
186
+ style?: TemplateRenderingMode;
187
+ };
188
+
189
+ type IconValue = {
190
+ value?: string;
191
+ };
192
+
193
+ type TimeValueStrict = {
194
+ value?: number;
195
+ style?: "time" | "date" | "relative" | "offset" | "timer";
196
+ };
197
+
198
+ type TimeValue = {
199
+ date?: Date;
200
+ style?: "time" | "date" | "relative" | "offset" | "timer";
201
+ };
202
+
203
+ type SvgValue = {
204
+ url?: string;
205
+ value?: string;
206
+ };
207
+
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
+ type SpacerValue = {
221
+ minLength?: number;
222
+ };
223
+
224
+ type RadialGradient = {
225
+ gradient: "radial";
226
+ colors?: Color[];
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;
246
+ };
247
+
248
+ type UnitPoint =
249
+ | "center"
250
+ | "zero"
251
+ | "leading"
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
+
378
+ type Material = "regular" | "thin" | "thick" | "ultraThin" | "ultraThick";
379
+ type FontWidth =
380
+ | "compressed"
381
+ | "condensed"
382
+ | "standard"
383
+ | "expanded"
384
+ | ""
385
+ | number;
386
+ type Interpolation = "none" | "low" | "medium" | "high";
387
+ type Resizable = boolean | "stretch" | "tile";
388
+
389
+ type Point = { x?: number; y?: number } | number;
390
+ type ScaleEffect =
391
+ | { x?: number; y?: number; anchor?: UnitPoint }
392
+ | { scale?: number; anchor?: UnitPoint }
393
+ | number;
394
+ type Font =
395
+ | {
396
+ name: string;
397
+ size: number;
398
+ wght?: number;
399
+ wdth?: number;
400
+ opsz?: number;
401
+ slnt?: number;
402
+ ital?: number;
403
+
404
+ GRAD?: number;
405
+ HGHT?: number;
406
+ SOFT?: number;
407
+
408
+ monospacedDigit?: boolean;
409
+ features?: string[] | string;
410
+ }
411
+ | "";
412
+ type Rotation3DEffect = {
413
+ angle: number;
414
+ x?: number;
415
+ y?: number;
416
+ z?: number;
417
+ anchor?: UnitPoint;
418
+ anchorZ?: number;
419
+ perspective?: number;
420
+ };
421
+ type RotationEffect = { angle: number; anchor: UnitPoint } | number;
422
+
423
+ type Frame =
424
+ | { maxWidth?: Dimension; maxHeight?: Dimension; alignment?: Alignment }
425
+ | { width?: number; height?: number; alignment?: Alignment };
426
+ type Shadow = {
427
+ color?: Color;
428
+ x?: number;
429
+ y?: number;
430
+ blur?: number;
431
+ };
432
+ type BlendMode =
433
+ | "normal"
434
+ | "multiply"
435
+ | "screen"
436
+ | "overlay"
437
+ | "darken"
438
+ | "lighten"
439
+ | "colorDodge"
440
+ | "colorBurn"
441
+ | "softLight"
442
+ | "hardLight"
443
+ | "difference"
444
+ | "exclusion"
445
+ | "hue"
446
+ | "saturation"
447
+ | "color"
448
+ | "luminosity"
449
+ | "sourceAtop"
450
+ | "destinationOver"
451
+ | "destinationOut"
452
+ | "plusDarker"
453
+ | "plusLighter";
454
+
455
+ type ButtonStyle =
456
+ | "automatic"
457
+ | "bordered"
458
+ | "borderedProminent"
459
+ | "borderless"
460
+ | "plain"
461
+ | CustomButtonStyle;
462
+
463
+ type CustomButtonStyle = {
464
+ press: NativeView;
465
+ normal: NativeView;
466
+ };
467
+
468
+ type LineHeight =
469
+ | number
470
+ | [type: "multiple" | "leading", value: number]
471
+ | "loose"
472
+ | "normal"
473
+ | "tight"
474
+ | "variable";
475
+
476
+ type BaseMods = {
477
+ animation?: NativeAnimation | number;
478
+ aspectRatio?: AspectRatio;
479
+ background?:
480
+ | ShapeStyle
481
+ | NativeView
482
+ | { alignment: Alignment; content: NativeView };
483
+ baselineOffset?: number;
484
+ blendMode?: BlendMode;
485
+ blur?: number | { blur: number; opaque: boolean };
486
+ brightness?: number;
487
+ buttonStyle?: ButtonStyle;
488
+ clipped?: boolean;
489
+ clipShape?: NativeView | "";
490
+ colorInvert?: boolean;
491
+ colorMultiply?: Color;
492
+ compositingGroup?: boolean;
493
+ contentShape?: NativeView | "";
494
+ contentTransition?: ContentTransition;
495
+ contrast?: number;
496
+ cornerRadius?: number;
497
+ debug?: boolean;
498
+ disable?: boolean;
499
+ drawingGroup?: boolean;
500
+ fixedSize?: boolean | { horizontal?: boolean; vertical?: boolean };
501
+ font?: Font;
502
+ fontDesign?: FontDesign;
503
+ fontSize?: number;
504
+ fontWeight?: FontWeight;
505
+ fontWidth?: FontWidth;
506
+ foreground?: ShapeStyle;
507
+ frame?: Frame;
508
+ geometryGroup?: boolean;
509
+ grayscale?: number;
510
+ height?: number;
511
+ hidden?: boolean;
512
+ hueRotation?: number;
513
+ ignoresSafeArea?: boolean;
514
+ italic?: boolean;
515
+ kerning?: number;
516
+ layoutPriority?: number;
517
+ lineLimit?: number | "";
518
+ lineSpacing?: number;
519
+ lineHeight?: LineHeight;
520
+ luminanceToAlpha?: boolean;
521
+ mask?: NativeView;
522
+ maxHeight?: Dimension | boolean;
523
+ maxSides?: Dimension | boolean;
524
+ maxWidth?: Dimension | boolean;
525
+ minimumScaleFactor?: number;
526
+ monospaced?: boolean;
527
+ monospacedDigit?: boolean;
528
+ offset?: Point;
529
+ offsetX?: number;
530
+ offsetY?: number;
531
+ opacity?: number;
532
+ overlay?:
533
+ | ShapeStyle
534
+ | NativeView
535
+ | { alignment: Alignment; content: NativeView };
536
+ padding?: Padding | boolean;
537
+ pixelPerfectCenter?: boolean | Point;
538
+ position?: Point;
539
+ reverseMask?: NativeView;
540
+ rotation3DEffect?: Rotation3DEffect;
541
+ rotationEffect?: RotationEffect;
542
+ saturation?: number;
543
+ scaleEffect?: ScaleEffect;
544
+ shadow?: Shadow;
545
+ sides?: number;
546
+ strikethrough?: boolean;
547
+ test?: unknown;
548
+ textAlignment?: TextAlignment;
549
+ tint?: ShapeStyle;
550
+ tracking?: number;
551
+ transform?: number[];
552
+ transition?: Transition;
553
+ truncationMode?: "head" | "middle" | "tail";
554
+ underline?: boolean;
555
+ width?: number;
556
+ zIndex?: number;
557
+ };
558
+
559
+ type Mods = {
560
+ [K in keyof BaseMods]?: BaseMods[K];
561
+ } & {
562
+ [K in keyof BaseMods as `${K & string}_${string}`]?: BaseMods[K];
563
+ };
564
+
565
+ type ObjectToTuple<T> = {
566
+ [K in keyof T]: [K, T[K]];
567
+ }[keyof T];
568
+
569
+ type ModTuple = ObjectToTuple<BaseMods>;