@await-widget/runtime 0.0.5 → 0.0.7

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,414 @@
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 Size = {
215
+ width: number;
216
+ height: number;
217
+ };
218
+
219
+ type TemplateRenderingMode = 'original' | 'template';
220
+
221
+ type AspectRatio =
222
+ | 'fill'
223
+ | 'fit'
224
+ | [aspectRatio: number, contentMode: 'fill' | 'fit'];
225
+
226
+ type IntentInfo = {
227
+ name: string;
228
+ args: Encodable[];
229
+ };
230
+
231
+ type Encodable =
232
+ | string
233
+ | number
234
+ | boolean
235
+ | undefined
236
+ | Encodable[]
237
+ | {
238
+ [key: string]: Encodable;
239
+ };
240
+
241
+ type ID = {
242
+ id?: Encodable;
243
+ };
244
+
245
+ type TextAlignment = 'center' | 'leading' | 'trailing';
246
+
247
+ type FontDesign = 'monospaced' | 'rounded' | 'serif' | 'default';
248
+
249
+ type FontWeight =
250
+ | 100
251
+ | 'ultraLight'
252
+ | 200
253
+ | 'thin'
254
+ | 300
255
+ | 'light'
256
+ | 400
257
+ | 'regular'
258
+ | 500
259
+ | 'medium'
260
+ | 600
261
+ | 'semibold'
262
+ | 700
263
+ | 'bold'
264
+ | 800
265
+ | 'heavy'
266
+ | 900
267
+ | 'black';
268
+
269
+ type FontWidth = 'compressed' | 'condensed' | 'standard' | 'expanded' | number;
270
+
271
+ type Interpolation = 'none' | 'low' | 'medium' | 'high';
272
+
273
+ type Resizable = boolean | 'stretch' | 'tile';
274
+
275
+ type Point =
276
+ | number
277
+ | {
278
+ x?: number;
279
+ y?: number;
280
+ };
281
+
282
+ type ScaleEffect =
283
+ | number
284
+ | {
285
+ scale?: number;
286
+ anchor?: UnitPoint;
287
+ }
288
+ | {
289
+ x?: number;
290
+ y?: number;
291
+ anchor?: UnitPoint;
292
+ };
293
+
294
+ type Font = {
295
+ name: string;
296
+ size: number;
297
+ wght?: number;
298
+ wdth?: number;
299
+ opsz?: number;
300
+ slnt?: number;
301
+ ital?: number;
302
+
303
+ GRAD?: number;
304
+ HGHT?: number;
305
+ SOFT?: number;
306
+
307
+ monospacedDigit?: boolean;
308
+ features?: string[] | string;
309
+ };
310
+
311
+ type Rotation3DEffect = {
312
+ angle: number;
313
+ x?: number;
314
+ y?: number;
315
+ z?: number;
316
+ anchor?: UnitPoint;
317
+ anchorZ?: number;
318
+ perspective?: number;
319
+ };
320
+
321
+ type RotationEffect =
322
+ | number
323
+ | {
324
+ angle: number;
325
+ anchor: UnitPoint;
326
+ };
327
+
328
+ type Frame =
329
+ | {
330
+ maxWidth?: Dimension;
331
+ maxHeight?: Dimension;
332
+ alignment?: Alignment;
333
+ }
334
+ | {
335
+ width?: number;
336
+ height?: number;
337
+ alignment?: Alignment;
338
+ };
339
+
340
+ type Shadow = {
341
+ color?: Color;
342
+ x?: number;
343
+ y?: number;
344
+ blur?: number;
345
+ };
346
+
347
+ type Pattern = 'dash' | 'dashDot' | 'dashDotDot' | 'dot' | 'solid';
348
+
349
+ type BlendMode =
350
+ | 'normal'
351
+ | 'multiply'
352
+ | 'screen'
353
+ | 'overlay'
354
+ | 'darken'
355
+ | 'lighten'
356
+ | 'colorDodge'
357
+ | 'colorBurn'
358
+ | 'softLight'
359
+ | 'hardLight'
360
+ | 'difference'
361
+ | 'exclusion'
362
+ | 'hue'
363
+ | 'saturation'
364
+ | 'color'
365
+ | 'luminosity'
366
+ | 'sourceAtop'
367
+ | 'destinationOver'
368
+ | 'destinationOut'
369
+ | 'plusDarker'
370
+ | 'plusLighter';
371
+
372
+ type ButtonStyle =
373
+ | 'automatic'
374
+ | 'bordered'
375
+ | 'borderedProminent'
376
+ | 'borderless'
377
+ | 'plain'
378
+ | CustomButtonStyle;
379
+
380
+ type CustomButtonStyle = {
381
+ press: NativeView;
382
+ normal: NativeView;
383
+ };
384
+
385
+ type GifDuration = 2 | 4 | 6 | 10 | 12 | 20 | 30 | 60;
386
+
387
+ type LineHeight =
388
+ | number
389
+ | 'loose'
390
+ | 'normal'
391
+ | 'tight'
392
+ | 'variable'
393
+ | [type: 'multiple' | 'leading', value: number];
394
+
395
+ type Blur =
396
+ | number
397
+ | {
398
+ blur: number;
399
+ opaque?: boolean;
400
+ };
401
+
402
+ type FixedSize =
403
+ | boolean
404
+ | {
405
+ horizontal?: boolean;
406
+ vertical?: boolean;
407
+ };
408
+
409
+ type strikethrough =
410
+ | boolean
411
+ | {
412
+ isActive?: boolean;
413
+ color?: Color;
414
+ };
@@ -0,0 +1,274 @@
1
+ type AudioOption = 'mix' | 'duckOthers' | 'solo';
2
+
3
+ type ColorScheme = 'light' | 'dark';
4
+
5
+ type RenderingMode = 'fullColor' | 'accented' | 'vibrant';
6
+
7
+ type Update = Date | 'end' | 'rapid' | 'never';
8
+
9
+ type WidgetFamily =
10
+ | 'small'
11
+ | 'medium'
12
+ | 'large'
13
+ | 'extraLarge'
14
+ | 'extraLargePortrait'
15
+ | 'accessoryInline'
16
+ | 'accessoryCircular'
17
+ | 'accessoryRectangular'
18
+ | 'unknown';
19
+
20
+ type SingleNativeView =
21
+ | string
22
+ | number
23
+ | undefined
24
+ | {
25
+ kind: string;
26
+ flat?: unknown[];
27
+ children?: NativeView;
28
+ };
29
+
30
+ type NativeView = SingleNativeView | NativeView[];
31
+
32
+ type AudioConfig = {
33
+ soundFont?: string;
34
+ volume?: number;
35
+ duration?: number;
36
+ delay?: number;
37
+ velocity?: number;
38
+ preset?: number;
39
+ bank?: number;
40
+ loop?: boolean;
41
+ audioOption?: AudioOption;
42
+ };
43
+
44
+ type SoundFontManualMapping = {
45
+ path: string;
46
+ key: number;
47
+ };
48
+
49
+ type SoundFontBuildConfig = {
50
+ savePath: string;
51
+ dataSizeLimitMB?: number;
52
+ mediaFiles?: string[];
53
+ mappings?: SoundFontManualMapping[];
54
+ };
55
+
56
+ type SoundFontCompressConfig = {
57
+ fromPath: string;
58
+ savePath: string;
59
+ dataSizeLimitMB?: number;
60
+ };
61
+
62
+ type SoundFontBuildResult = {
63
+ ok: true;
64
+ output: string;
65
+ resolvedOutput: string;
66
+ sizeBytes: number;
67
+ };
68
+
69
+ type AwaitWeatherConfig = {
70
+ latitude?: number;
71
+ longitude?: number;
72
+ hourlyLimit?: number;
73
+ dailyLimit?: number;
74
+ };
75
+
76
+ type AwaitWeatherCurrent = {
77
+ date: string;
78
+ condition: string;
79
+ symbolName: string;
80
+ temperatureCelsius: number;
81
+ apparentTemperatureCelsius: number;
82
+ humidity: number;
83
+ uvIndex: number;
84
+ windSpeedMetersPerSecond: number;
85
+ windDirectionDegrees: number;
86
+ pressureHectopascals: number;
87
+ visibilityKilometers: number;
88
+ };
89
+
90
+ type AwaitWeatherHourly = {
91
+ date: string;
92
+ condition: string;
93
+ symbolName: string;
94
+ temperatureCelsius: number;
95
+ humidity: number;
96
+ uvIndex: number;
97
+ windSpeedMetersPerSecond: number;
98
+ precipitationChance: number;
99
+ };
100
+
101
+ type AwaitWeatherDaily = {
102
+ date: string;
103
+ condition: string;
104
+ symbolName: string;
105
+ highTemperatureCelsius: number;
106
+ lowTemperatureCelsius: number;
107
+ precipitationChance: number;
108
+ uvIndex: number;
109
+ };
110
+
111
+ type AwaitWeatherResult = {
112
+ location: {
113
+ latitude: number;
114
+ longitude: number;
115
+ };
116
+ current: AwaitWeatherCurrent;
117
+ hourly: AwaitWeatherHourly[];
118
+ daily: AwaitWeatherDaily[];
119
+ };
120
+
121
+ type AwaitHealthInfo = {
122
+ stepCount?: number;
123
+ distanceWalkingRunning?: number;
124
+ flightsClimbed?: number;
125
+ };
126
+
127
+ type AwaitLocationConfig = {
128
+ desiredAccuracyMeters?: number;
129
+ timeoutSeconds?: number;
130
+ };
131
+
132
+ type AwaitLocationInfo = {
133
+ latitude: number;
134
+ longitude: number;
135
+ date: Date;
136
+ altitudeMeters?: number;
137
+ speedMetersPerSecond?: number;
138
+ courseDegrees?: number;
139
+ };
140
+
141
+ type AwaitNowPlayingConfig = {
142
+ artworkSize?: number;
143
+ };
144
+
145
+ type AwaitNowPlayingInfo = {
146
+ state?:
147
+ | 'playing'
148
+ | 'paused'
149
+ | 'stopped'
150
+ | 'interrupted'
151
+ | 'seekingForward'
152
+ | 'seekingBackward';
153
+ sourceConfig?: AwaitMediaPlayConfig;
154
+ id?: string;
155
+ title?: string;
156
+ artistName?: string;
157
+ albumTitle?: string;
158
+ artworkURL?: string;
159
+ maximumWidth?: number;
160
+ maximumHeight?: number;
161
+ backgroundColor?: Color;
162
+ primaryTextColor?: Color;
163
+ secondaryTextColor?: Color;
164
+ tertiaryTextColor?: Color;
165
+ quaternaryTextColor?: Color;
166
+ };
167
+
168
+ type AwaitMusicPlayerCommand = 'start' | 'toggle' | 'next' | 'previous';
169
+
170
+ type AwaitMediaPlayConfig =
171
+ | {
172
+ source: 'song';
173
+ id?: string;
174
+ query?: string;
175
+ limit?: number;
176
+ shuffle?: boolean;
177
+ loop?: boolean;
178
+ offset?: number;
179
+ }
180
+ | {
181
+ source: 'album';
182
+ id?: string;
183
+ query?: string;
184
+ shuffle?: boolean;
185
+ loop?: boolean;
186
+ }
187
+ | {
188
+ source: 'station';
189
+ query?: string;
190
+ type?: 'discovery' | 'user';
191
+ id?: string;
192
+ };
193
+
194
+ type AwaitCalendarConfig = {
195
+ start?: Date;
196
+ end?: Date;
197
+ limit?: number;
198
+ };
199
+
200
+ type AwaitCalendarItem = {
201
+ calendarTitle: string;
202
+ title: string;
203
+ startDate: Date;
204
+ endDate: Date;
205
+ isAllDay: boolean;
206
+ location?: string;
207
+ notes?: string;
208
+ url?: string;
209
+ };
210
+
211
+ type AwaitReminderConfig = {
212
+ type?: 'all' | 'incomplete' | 'completed';
213
+ limit?: number;
214
+ };
215
+
216
+ type AwaitReminderItem = {
217
+ calendarTitle: string;
218
+ title: string;
219
+ notes?: string;
220
+ isCompleted: boolean;
221
+ priority: number;
222
+ startDate?: Date;
223
+ dueDate?: Date;
224
+ completionDate?: Date;
225
+ };
226
+
227
+ type AwaitSystemInfo = {
228
+ battery: {
229
+ state: 'charging' | 'full' | 'unplugged' | 'unknown';
230
+ percent: number;
231
+ lowPowerMode: boolean;
232
+ };
233
+ memory?: {
234
+ used: number;
235
+ free: number;
236
+ total: number;
237
+ percent: number;
238
+ };
239
+ cpu: {
240
+ percent?: number;
241
+ };
242
+ storage?: {
243
+ total: number;
244
+ free: number;
245
+ used: number;
246
+ percent: number;
247
+ };
248
+ };
249
+
250
+ type AwaitAlarmScheduleConfig = {
251
+ title?: string;
252
+ duration?: number;
253
+ date?: Date;
254
+ tint?: Color;
255
+ };
256
+
257
+ type WidgetEntry<T extends Record<string, unknown> = Record<string, unknown>> =
258
+ TimelineContext &
259
+ T & {
260
+ date: Date;
261
+ colorScheme: ColorScheme;
262
+ renderingMode: RenderingMode;
263
+ };
264
+
265
+ type TimelineContext = {
266
+ size: Size;
267
+ family: WidgetFamily;
268
+ };
269
+
270
+ type Timeline<T extends Record<string, unknown> = Record<string, unknown>> = {
271
+ entries: Array<{date: Date} & T>;
272
+ update?: Update;
273
+ skipOnPlayingNote?: boolean;
274
+ };