@await-widget/runtime 0.0.15 → 0.0.17
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/bridge.d.ts +8 -4
- package/types/model.d.ts +58 -9
package/package.json
CHANGED
package/types/bridge.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare const AwaitWeather: {
|
|
|
48
48
|
};
|
|
49
49
|
export declare const AwaitHealth: {
|
|
50
50
|
get(): Promise<AwaitHealthInfo | undefined>;
|
|
51
|
+
get(config: AwaitHealthConfig): Promise<AwaitHealthRangeInfo | undefined>;
|
|
51
52
|
};
|
|
52
53
|
export declare const AwaitLocation: {
|
|
53
54
|
get(config?: AwaitLocationConfig): Promise<AwaitLocationInfo | undefined>;
|
|
@@ -118,7 +119,7 @@ export declare const AwaitUI: {
|
|
|
118
119
|
readonly displayScale: number;
|
|
119
120
|
haptic(type: string): void;
|
|
120
121
|
};
|
|
121
|
-
type AwaitDefineConfig<
|
|
122
|
+
type AwaitDefineConfig<T extends Record<string, unknown>, Intents> = {
|
|
122
123
|
widget: (entry: WidgetEntry<T>) => NativeView;
|
|
123
124
|
widgetTimeline?: (
|
|
124
125
|
context: TimelineContext,
|
|
@@ -140,10 +141,13 @@ type AwaitDefineResult<Intents> = {
|
|
|
140
141
|
? (...args: IntentArguments) => IntentInfo
|
|
141
142
|
: never;
|
|
142
143
|
};
|
|
144
|
+
type AwaitDefineShape = {
|
|
145
|
+
widgetIntents?: Record<string, (...args: any[]) => void>;
|
|
146
|
+
};
|
|
143
147
|
export declare const Await: {
|
|
144
|
-
define<
|
|
145
|
-
config: AwaitDefineConfig<
|
|
146
|
-
): AwaitDefineResult<
|
|
148
|
+
define<T extends Record<string, unknown>, Config extends AwaitDefineShape>(
|
|
149
|
+
config: Config & AwaitDefineConfig<T, Config['widgetIntents']>,
|
|
150
|
+
): AwaitDefineResult<Config['widgetIntents']>;
|
|
147
151
|
};
|
|
148
152
|
export declare const AwaitLaunch: {
|
|
149
153
|
start(bundleId: string): any;
|
package/types/model.d.ts
CHANGED
|
@@ -117,23 +117,67 @@ type AwaitWeatherResult = {
|
|
|
117
117
|
daily: AwaitWeatherDaily[];
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
type AwaitHealthConfig = {
|
|
121
|
+
start: Date;
|
|
122
|
+
end: Date;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
type AwaitHealthFitnessInfo = {
|
|
126
|
+
activeEnergyBurned?: number;
|
|
127
|
+
activeEnergyBurnedGoal?: number;
|
|
128
|
+
exerciseTime?: number;
|
|
129
|
+
exerciseTimeGoal?: number;
|
|
130
|
+
standHours?: number;
|
|
131
|
+
standHoursGoal?: number;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
type AwaitHealthQuantitySample = {
|
|
135
|
+
value: number;
|
|
136
|
+
startDate: Date;
|
|
137
|
+
endDate: Date;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
type AwaitHealthSleepAnalysisValue =
|
|
141
|
+
| 'inBed'
|
|
142
|
+
| 'awake'
|
|
143
|
+
| 'asleepCore'
|
|
144
|
+
| 'asleepDeep'
|
|
145
|
+
| 'asleepREM'
|
|
146
|
+
| 'asleepUnspecified';
|
|
147
|
+
|
|
148
|
+
type AwaitHealthSleepAnalysisSample = {
|
|
149
|
+
value: AwaitHealthSleepAnalysisValue;
|
|
150
|
+
startDate: Date;
|
|
151
|
+
endDate: Date;
|
|
152
|
+
};
|
|
153
|
+
|
|
120
154
|
type AwaitHealthInfo = {
|
|
121
155
|
stepCount?: number;
|
|
122
156
|
distanceWalkingRunning?: number;
|
|
123
157
|
flightsClimbed?: number;
|
|
124
|
-
fitness?:
|
|
125
|
-
activeEnergyBurned?: number;
|
|
126
|
-
activeEnergyBurnedGoal?: number;
|
|
127
|
-
exerciseTime?: number;
|
|
128
|
-
exerciseTimeGoal?: number;
|
|
129
|
-
standHours?: number;
|
|
130
|
-
standHoursGoal?: number;
|
|
131
|
-
};
|
|
158
|
+
fitness?: AwaitHealthFitnessInfo;
|
|
132
159
|
heartRate?: number;
|
|
133
160
|
restingHeartRate?: number;
|
|
134
161
|
oxygenSaturation?: number;
|
|
135
162
|
};
|
|
136
163
|
|
|
164
|
+
type AwaitHealthRangeFitnessInfo = AwaitHealthFitnessInfo & {
|
|
165
|
+
date: Date;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
type AwaitHealthRangeInfo = {
|
|
169
|
+
stepCount?: AwaitHealthQuantitySample[];
|
|
170
|
+
distanceWalkingRunning?: AwaitHealthQuantitySample[];
|
|
171
|
+
flightsClimbed?: AwaitHealthQuantitySample[];
|
|
172
|
+
fitness?: AwaitHealthRangeFitnessInfo[];
|
|
173
|
+
heartRate?: AwaitHealthQuantitySample[];
|
|
174
|
+
restingHeartRate?: AwaitHealthQuantitySample[];
|
|
175
|
+
oxygenSaturation?: AwaitHealthQuantitySample[];
|
|
176
|
+
respiratoryRate?: AwaitHealthQuantitySample[];
|
|
177
|
+
appleSleepingWristTemperature?: AwaitHealthQuantitySample[];
|
|
178
|
+
sleepAnalysis?: AwaitHealthSleepAnalysisSample[];
|
|
179
|
+
};
|
|
180
|
+
|
|
137
181
|
type AwaitLocationConfig = {
|
|
138
182
|
desiredAccuracyMeters?: number;
|
|
139
183
|
timeoutSeconds?: number;
|
|
@@ -301,9 +345,14 @@ type AwaitAlarmScheduleConfig = {
|
|
|
301
345
|
tint?: Color;
|
|
302
346
|
};
|
|
303
347
|
|
|
348
|
+
type WidgetEntryData<T extends Record<string, unknown>> = Omit<
|
|
349
|
+
T,
|
|
350
|
+
keyof TimelineContext | 'date' | 'colorScheme' | 'renderingMode'
|
|
351
|
+
>;
|
|
352
|
+
|
|
304
353
|
type WidgetEntry<T extends Record<string, unknown> = Record<string, unknown>> =
|
|
305
354
|
TimelineContext &
|
|
306
|
-
T & {
|
|
355
|
+
WidgetEntryData<T> & {
|
|
307
356
|
date: Date;
|
|
308
357
|
colorScheme: ColorScheme;
|
|
309
358
|
renderingMode: RenderingMode;
|