@kingstinct/react-native-healthkit 4.2.0 → 4.4.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.
- package/README.md +1 -1
- package/ios/ReactNativeHealthkit.m +6 -1
- package/ios/ReactNativeHealthkit.swift +365 -176
- package/lib/commonjs/index.ios.js +129 -105
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +58 -44
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +136 -106
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/example/App.js +197 -0
- package/lib/index.ios.js +310 -0
- package/lib/index.js +44 -0
- package/lib/module/index.ios.js +130 -106
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +52 -37
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +127 -104
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/native-types.js +447 -0
- package/lib/src/index.ios.js +314 -0
- package/lib/src/index.js +45 -0
- package/lib/src/native-types.js +453 -0
- package/lib/src/types.js +1 -0
- package/lib/types.js +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.ios.d.ts +1 -1
- package/lib/typescript/src/native-types.d.ts +458 -205
- package/lib/typescript/src/types.d.ts +87 -81
- package/package.json +21 -35
- package/src/index.ios.tsx +303 -269
- package/src/index.tsx +63 -45
- package/src/native-types.ts +318 -290
- package/src/types.ts +120 -105
- package/.DS_Store +0 -0
- package/.circleci/config.yml +0 -98
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/workflows/main.yml +0 -32
- package/.gitignore +0 -60
- package/CONTRIBUTING.md +0 -184
- package/babel.config.js +0 -3
- package/example-expo/.expo/README.md +0 -15
- package/example-expo/.expo/devices.json +0 -8
- package/example-expo/.expo/packager-info.json +0 -5
- package/example-expo/.expo/settings.json +0 -9
- package/example-expo/.expo-shared/assets.json +0 -4
- package/example-expo/.gitignore +0 -14
- package/example-expo/App.tsx +0 -376
- package/example-expo/app.json +0 -43
- package/example-expo/assets/adaptive-icon.png +0 -0
- package/example-expo/assets/favicon.png +0 -0
- package/example-expo/assets/icon.png +0 -0
- package/example-expo/assets/splash.png +0 -0
- package/example-expo/babel.config.js +0 -8
- package/example-expo/build-1653040579600.ipa +0 -0
- package/example-expo/build-1653041063216.ipa +0 -0
- package/example-expo/eas.json +0 -18
- package/example-expo/package.json +0 -32
- package/example-expo/tsconfig.json +0 -6
- package/example-expo/yarn.lock +0 -6857
- package/lib/typescript/example-expo/App.d.ts +0 -3
- package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
- package/src/__tests__/index.test.tsx +0 -1
- package/tsconfig.json +0 -27
- package/yarn.lock +0 -10241
package/src/types.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
HKCorrelationRaw,
|
|
10
10
|
HKCorrelationTypeIdentifier,
|
|
11
11
|
HKFitzpatrickSkinType,
|
|
12
|
-
MetadataMapperForCategoryIdentifier,
|
|
13
12
|
HKQuantitySampleRaw,
|
|
14
13
|
HKQuantityTypeIdentifier,
|
|
15
14
|
HKSampleTypeIdentifier,
|
|
@@ -17,63 +16,67 @@ import type {
|
|
|
17
16
|
HKUnit,
|
|
18
17
|
HKUnitSI,
|
|
19
18
|
HKUnitSIPrefix,
|
|
19
|
+
HKUpdateFrequency,
|
|
20
20
|
HKWheelchairUse,
|
|
21
21
|
HKWorkoutActivityType,
|
|
22
22
|
HKWorkoutMetadata,
|
|
23
23
|
HKWorkoutRaw,
|
|
24
|
+
MetadataMapperForCategoryIdentifier,
|
|
24
25
|
MetadataMapperForCorrelationIdentifier,
|
|
25
26
|
MetadataMapperForQuantityIdentifier,
|
|
26
27
|
QueryStatisticsResponseRaw,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
WorkoutRoute,
|
|
29
|
+
HealthkitAuthorization,
|
|
30
|
+
} from './native-types'
|
|
31
|
+
import type { ValueOf } from 'type-fest'
|
|
29
32
|
|
|
30
33
|
export interface QueryWorkoutsOptions<
|
|
31
34
|
TEnergy extends HKUnit,
|
|
32
35
|
TDistance extends HKUnit
|
|
33
36
|
> extends GenericQueryOptions {
|
|
34
|
-
energyUnit?: TEnergy;
|
|
35
|
-
distanceUnit?: TDistance;
|
|
37
|
+
readonly energyUnit?: TEnergy;
|
|
38
|
+
readonly distanceUnit?: TDistance;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
export interface HKCategorySample<
|
|
39
42
|
T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier
|
|
40
|
-
> extends Omit<HKCategorySampleRaw<T>, '
|
|
41
|
-
startDate: Date;
|
|
42
|
-
endDate: Date;
|
|
43
|
+
> extends Omit<HKCategorySampleRaw<T>, 'endDate' | 'startDate'> {
|
|
44
|
+
readonly startDate: Date;
|
|
45
|
+
readonly endDate: Date;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export type GenericQueryOptions = {
|
|
46
|
-
from?: Date;
|
|
47
|
-
to?: Date;
|
|
48
|
-
limit?:
|
|
49
|
-
ascending?: boolean;
|
|
49
|
+
readonly from?: Date;
|
|
50
|
+
readonly to?: Date;
|
|
51
|
+
readonly limit?: number;
|
|
52
|
+
readonly ascending?: boolean;
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
export interface HKWorkout<
|
|
53
56
|
TEnergy extends HKUnit = HKUnit,
|
|
54
57
|
TDistance extends HKUnit = HKUnit
|
|
55
|
-
> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, '
|
|
56
|
-
startDate: Date;
|
|
57
|
-
endDate: Date;
|
|
58
|
+
> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {
|
|
59
|
+
readonly startDate: Date;
|
|
60
|
+
readonly endDate: Date;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export interface HKQuantitySample<
|
|
61
64
|
TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,
|
|
62
65
|
TUnit extends HKUnit = HKUnit
|
|
63
66
|
> extends Omit<
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
HKQuantitySampleRaw<TIdentifier, TUnit>,
|
|
68
|
+
'endDate' | 'startDate'
|
|
66
69
|
> {
|
|
67
|
-
startDate: Date;
|
|
68
|
-
endDate: Date;
|
|
70
|
+
readonly startDate: Date;
|
|
71
|
+
readonly endDate: Date;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
export interface QueryStatisticsResponse<T extends HKUnit = HKUnit>
|
|
72
75
|
extends Omit<
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
QueryStatisticsResponseRaw<T>,
|
|
77
|
+
'mostRecentQuantityDateInterval'
|
|
75
78
|
> {
|
|
76
|
-
mostRecentQuantityDateInterval?: { from: Date; to: Date };
|
|
79
|
+
readonly mostRecentQuantityDateInterval?: { readonly from: Date; readonly to: Date };
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
type UnsubscribeFunction = () => Promise<boolean>;
|
|
@@ -89,7 +92,7 @@ export type GetFitzpatrickSkinTypeFn = () => Promise<HKFitzpatrickSkinType>;
|
|
|
89
92
|
|
|
90
93
|
export type QueryStatisticsForQuantityFn = <TUnit extends HKUnit>(
|
|
91
94
|
identifier: HKQuantityTypeIdentifier,
|
|
92
|
-
options: HKStatisticsOptions[],
|
|
95
|
+
options: readonly HKStatisticsOptions[],
|
|
93
96
|
from: Date,
|
|
94
97
|
to?: Date,
|
|
95
98
|
unit?: TUnit
|
|
@@ -100,25 +103,27 @@ export type QueryWorkoutsFn = <
|
|
|
100
103
|
TDistance extends HKUnit
|
|
101
104
|
>(
|
|
102
105
|
options: QueryWorkoutsOptions<TEnergy, TDistance>
|
|
103
|
-
) => Promise<HKWorkout<TEnergy, TDistance>[]>;
|
|
106
|
+
) => Promise<readonly HKWorkout<TEnergy, TDistance>[]>;
|
|
104
107
|
|
|
105
108
|
export type AuthorizationStatusForFn = (
|
|
106
|
-
type:
|
|
109
|
+
type: HKCharacteristicTypeIdentifier | ValueOf<typeof HKSampleTypeIdentifier>
|
|
107
110
|
) => Promise<boolean>;
|
|
108
111
|
|
|
109
112
|
export type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(
|
|
110
113
|
identifier: T,
|
|
111
114
|
options: GenericQueryOptions
|
|
112
|
-
) => Promise<HKCategorySample<T>[]>;
|
|
115
|
+
) => Promise<readonly HKCategorySample<T>[]>;
|
|
116
|
+
|
|
117
|
+
type ReadPermission = HKCharacteristicTypeIdentifier | ValueOf<typeof HKSampleTypeIdentifier>
|
|
113
118
|
|
|
114
119
|
export type GetRequestStatusForAuthorizationFn = (
|
|
115
|
-
read:
|
|
116
|
-
write?: HKSampleTypeIdentifier[]
|
|
120
|
+
read: readonly ReadPermission[],
|
|
121
|
+
write?: readonly ValueOf<typeof HKSampleTypeIdentifier>[]
|
|
117
122
|
) => Promise<HKAuthorizationRequestStatus>;
|
|
118
123
|
|
|
119
124
|
export type RequestAuthorizationFn = (
|
|
120
|
-
read: (HKCharacteristicTypeIdentifier | HKSampleTypeIdentifier)[],
|
|
121
|
-
write?: HKSampleTypeIdentifier[]
|
|
125
|
+
read: readonly (HKCharacteristicTypeIdentifier | ValueOf<typeof HKSampleTypeIdentifier>)[],
|
|
126
|
+
write?: readonly ValueOf<typeof HKSampleTypeIdentifier>[]
|
|
122
127
|
) => Promise<boolean>;
|
|
123
128
|
|
|
124
129
|
export type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(
|
|
@@ -126,9 +131,9 @@ export type SaveQuantitySampleFn = <TUnit extends HKQuantityTypeIdentifier>(
|
|
|
126
131
|
unit: HKUnit,
|
|
127
132
|
value: number,
|
|
128
133
|
options?: {
|
|
129
|
-
start?: Date;
|
|
130
|
-
end?: Date;
|
|
131
|
-
metadata?: MetadataMapperForQuantityIdentifier<TUnit>;
|
|
134
|
+
readonly start?: Date;
|
|
135
|
+
readonly end?: Date;
|
|
136
|
+
readonly metadata?: MetadataMapperForQuantityIdentifier<TUnit>;
|
|
132
137
|
}
|
|
133
138
|
) => Promise<boolean>;
|
|
134
139
|
|
|
@@ -137,11 +142,11 @@ export type QueryQuantitySamplesFn = <
|
|
|
137
142
|
TUnit extends HKUnit = HKUnit
|
|
138
143
|
>(
|
|
139
144
|
identifier: TIdentifier,
|
|
140
|
-
options: GenericQueryOptions & { unit?: TUnit }
|
|
141
|
-
) => Promise<HKQuantitySample<TIdentifier, TUnit>[]>;
|
|
145
|
+
options: GenericQueryOptions & { readonly unit?: TUnit }
|
|
146
|
+
) => Promise<readonly HKQuantitySample<TIdentifier, TUnit>[]>;
|
|
142
147
|
|
|
143
148
|
export type SubscribeToChangesFn = (
|
|
144
|
-
identifier: HKSampleTypeIdentifier
|
|
149
|
+
identifier: ValueOf<typeof HKSampleTypeIdentifier>,
|
|
145
150
|
callback: () => void
|
|
146
151
|
) => Promise<UnsubscribeFunction>;
|
|
147
152
|
|
|
@@ -149,9 +154,9 @@ export type SaveCategorySampleFn = <T extends HKCategoryTypeIdentifier>(
|
|
|
149
154
|
identifier: T,
|
|
150
155
|
value: HKCategoryValueForIdentifier<T>,
|
|
151
156
|
options?: {
|
|
152
|
-
start?: Date;
|
|
153
|
-
end?: Date;
|
|
154
|
-
metadata?: MetadataMapperForCategoryIdentifier<T>;
|
|
157
|
+
readonly start?: Date;
|
|
158
|
+
readonly end?: Date;
|
|
159
|
+
readonly metadata?: MetadataMapperForCategoryIdentifier<T>;
|
|
155
160
|
}
|
|
156
161
|
) => Promise<boolean>;
|
|
157
162
|
|
|
@@ -177,7 +182,7 @@ export type GetMostRecentQuantitySampleFn = <
|
|
|
177
182
|
>(
|
|
178
183
|
identifier: TIdentifier,
|
|
179
184
|
unit?: TUnit
|
|
180
|
-
) => Promise<HKQuantitySample<TIdentifier, TUnit
|
|
185
|
+
) => Promise<HKQuantitySample<TIdentifier, TUnit> | null>;
|
|
181
186
|
|
|
182
187
|
export type MostRecentQuantitySampleHook = <
|
|
183
188
|
TIdentifier extends HKQuantityTypeIdentifier,
|
|
@@ -192,8 +197,8 @@ export type GetMostRecentWorkoutFn = <
|
|
|
192
197
|
TDistance extends HKUnit
|
|
193
198
|
>(
|
|
194
199
|
options?: Pick<
|
|
195
|
-
|
|
196
|
-
|
|
200
|
+
QueryWorkoutsOptions<TEnergy, TDistance>,
|
|
201
|
+
'distanceUnit' | 'energyUnit'
|
|
197
202
|
>
|
|
198
203
|
) => Promise<HKWorkout<TEnergy, TDistance> | null>;
|
|
199
204
|
|
|
@@ -202,14 +207,14 @@ export type MostRecentWorkoutHook = <
|
|
|
202
207
|
TDistance extends HKUnit
|
|
203
208
|
>(
|
|
204
209
|
options?: Pick<
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
QueryWorkoutsOptions<TEnergy, TDistance>,
|
|
211
|
+
'distanceUnit' | 'energyUnit'
|
|
207
212
|
>
|
|
208
213
|
) => HKWorkout<TEnergy, TDistance> | null;
|
|
209
214
|
|
|
210
215
|
export type GetPreferredUnitsFn = (
|
|
211
|
-
identifiers: HKQuantityTypeIdentifier[]
|
|
212
|
-
) => Promise<HKUnit[]>;
|
|
216
|
+
identifiers: readonly HKQuantityTypeIdentifier[]
|
|
217
|
+
) => Promise<readonly HKUnit[]>;
|
|
213
218
|
|
|
214
219
|
export type GetPreferredUnitFn = (
|
|
215
220
|
identifier: HKQuantityTypeIdentifier
|
|
@@ -219,100 +224,110 @@ export type SaveCorrelationSampleFn = <
|
|
|
219
224
|
TIdentifier extends HKCorrelationTypeIdentifier
|
|
220
225
|
>(
|
|
221
226
|
typeIdentifier: TIdentifier,
|
|
222
|
-
samples: (
|
|
223
|
-
| Omit<HKCategorySample, '
|
|
224
|
-
| Omit<HKQuantitySample, '
|
|
227
|
+
samples: readonly (
|
|
228
|
+
| Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'>
|
|
229
|
+
| Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'>
|
|
225
230
|
)[],
|
|
226
231
|
options?: {
|
|
227
|
-
start?: Date;
|
|
228
|
-
end?: Date;
|
|
229
|
-
metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;
|
|
232
|
+
readonly start?: Date;
|
|
233
|
+
readonly end?: Date;
|
|
234
|
+
readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;
|
|
230
235
|
}
|
|
231
236
|
) => Promise<boolean>;
|
|
232
237
|
|
|
233
238
|
export type SaveWorkoutSampleFn = (
|
|
234
239
|
typeIdentifier: HKWorkoutActivityType,
|
|
235
|
-
quantities: Omit<
|
|
236
|
-
|
|
237
|
-
|
|
240
|
+
quantities: readonly Omit<
|
|
241
|
+
HKQuantitySample,
|
|
242
|
+
'device' | 'endDate' | 'startDate' | 'uuid'
|
|
238
243
|
>[],
|
|
239
244
|
start: Date,
|
|
240
245
|
options?: {
|
|
241
|
-
end?: Date;
|
|
242
|
-
metadata?: HKWorkoutMetadata;
|
|
246
|
+
readonly end?: Date;
|
|
247
|
+
readonly metadata?: HKWorkoutMetadata;
|
|
243
248
|
}
|
|
244
249
|
) => Promise<boolean>;
|
|
245
250
|
|
|
246
251
|
export interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>
|
|
247
252
|
extends Omit<
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
HKCorrelationRaw<TIdentifier>,
|
|
254
|
+
'endDate' | 'objects' | 'startDate'
|
|
250
255
|
> {
|
|
251
|
-
objects: (
|
|
252
|
-
startDate: Date;
|
|
253
|
-
endDate: Date;
|
|
256
|
+
readonly objects: readonly (HKCategorySample | HKQuantitySample)[];
|
|
257
|
+
readonly startDate: Date;
|
|
258
|
+
readonly endDate: Date;
|
|
254
259
|
}
|
|
255
260
|
|
|
256
261
|
export type QueryCorrelationSamplesFn = <
|
|
257
262
|
TIdentifier extends HKCorrelationTypeIdentifier
|
|
258
263
|
>(
|
|
259
264
|
typeIdentifier: TIdentifier,
|
|
260
|
-
options: Omit<GenericQueryOptions, '
|
|
261
|
-
) => Promise<HKCorrelation<TIdentifier>[]>;
|
|
265
|
+
options: Omit<GenericQueryOptions, 'ascending' | 'limit'>
|
|
266
|
+
) => Promise<readonly HKCorrelation<TIdentifier>[]>;
|
|
262
267
|
|
|
263
268
|
export type SubscribeToChangesHook = <
|
|
264
|
-
TIdentifier extends HKSampleTypeIdentifier
|
|
269
|
+
TIdentifier extends ValueOf<typeof HKSampleTypeIdentifier>
|
|
265
270
|
>(
|
|
266
271
|
identifier: TIdentifier,
|
|
267
272
|
onChange: () => void,
|
|
268
273
|
runInitialUpdate?: boolean
|
|
269
274
|
) => void;
|
|
270
275
|
|
|
276
|
+
export type GetWorkoutRoutesFn = (
|
|
277
|
+
workoutUUID: string
|
|
278
|
+
) => Promise<readonly WorkoutRoute[]>;
|
|
279
|
+
|
|
271
280
|
export type ReactNativeHealthkit = {
|
|
272
|
-
authorizationStatusFor: AuthorizationStatusForFn;
|
|
273
|
-
|
|
274
|
-
getBiologicalSex: GetBiologicalSexFn;
|
|
275
|
-
getBloodType: GetBloodTypeFn;
|
|
276
|
-
getDateOfBirth: GetDateOfBirthFn;
|
|
277
|
-
getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;
|
|
278
|
-
getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;
|
|
279
|
-
getMostRecentCategorySample: GetMostRecentCategorySampleFn;
|
|
280
|
-
getMostRecentWorkout: GetMostRecentWorkoutFn;
|
|
281
|
-
getPreferredUnit: GetPreferredUnitFn;
|
|
282
|
-
getPreferredUnits: GetPreferredUnitsFn;
|
|
283
|
-
getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;
|
|
284
|
-
getWheelchairUse: GetWheelchairUseFn;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
281
|
+
readonly authorizationStatusFor: AuthorizationStatusForFn;
|
|
282
|
+
|
|
283
|
+
readonly getBiologicalSex: GetBiologicalSexFn;
|
|
284
|
+
readonly getBloodType: GetBloodTypeFn;
|
|
285
|
+
readonly getDateOfBirth: GetDateOfBirthFn;
|
|
286
|
+
readonly getFitzpatrickSkinType: GetFitzpatrickSkinTypeFn;
|
|
287
|
+
readonly getMostRecentQuantitySample: GetMostRecentQuantitySampleFn;
|
|
288
|
+
readonly getMostRecentCategorySample: GetMostRecentCategorySampleFn;
|
|
289
|
+
readonly getMostRecentWorkout: GetMostRecentWorkoutFn;
|
|
290
|
+
readonly getPreferredUnit: GetPreferredUnitFn;
|
|
291
|
+
readonly getPreferredUnits: GetPreferredUnitsFn;
|
|
292
|
+
readonly getRequestStatusForAuthorization: GetRequestStatusForAuthorizationFn;
|
|
293
|
+
readonly getWheelchairUse: GetWheelchairUseFn;
|
|
294
|
+
readonly getWorkoutRoutes: GetWorkoutRoutesFn;
|
|
295
|
+
|
|
296
|
+
readonly buildUnitWithPrefix: (prefix: HKUnitSIPrefix, unit: HKUnitSI) => HKUnit;
|
|
297
|
+
|
|
298
|
+
readonly isHealthDataAvailable: IsHealthDataAvailableFn;
|
|
299
|
+
|
|
300
|
+
readonly queryCategorySamples: QueryCategorySamplesFn;
|
|
301
|
+
readonly queryQuantitySamples: QueryQuantitySamplesFn;
|
|
302
|
+
readonly queryStatisticsForQuantity: QueryStatisticsForQuantityFn;
|
|
303
|
+
readonly queryWorkouts: QueryWorkoutsFn;
|
|
304
|
+
readonly queryCorrelationSamples: QueryCorrelationSamplesFn;
|
|
305
|
+
|
|
306
|
+
readonly requestAuthorization: RequestAuthorizationFn;
|
|
307
|
+
|
|
308
|
+
readonly saveCategorySample: SaveCategorySampleFn;
|
|
309
|
+
readonly saveQuantitySample: SaveQuantitySampleFn;
|
|
310
|
+
readonly saveCorrelationSample: SaveCorrelationSampleFn;
|
|
311
|
+
readonly saveWorkoutSample: SaveWorkoutSampleFn;
|
|
312
|
+
readonly enableBackgroundDelivery: (
|
|
313
|
+
typeIdentifier: ValueOf<typeof HKSampleTypeIdentifier>,
|
|
304
314
|
updateFrequency: HKUpdateFrequency
|
|
305
315
|
) => Promise<boolean>;
|
|
306
|
-
disableBackgroundDelivery: (
|
|
307
|
-
typeIdentifier: HKSampleTypeIdentifier
|
|
316
|
+
readonly disableBackgroundDelivery: (
|
|
317
|
+
typeIdentifier: ValueOf<typeof HKSampleTypeIdentifier>
|
|
308
318
|
) => Promise<boolean>;
|
|
309
|
-
disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
319
|
+
readonly disableAllBackgroundDelivery: () => Promise<boolean>;
|
|
310
320
|
|
|
311
|
-
subscribeToChanges: SubscribeToChangesFn;
|
|
321
|
+
readonly subscribeToChanges: SubscribeToChangesFn;
|
|
312
322
|
|
|
313
|
-
useMostRecentWorkout: MostRecentWorkoutHook;
|
|
314
|
-
useMostRecentCategorySample: MostRecentCategorySampleHook;
|
|
315
|
-
useMostRecentQuantitySample: MostRecentQuantitySampleHook;
|
|
323
|
+
readonly useMostRecentWorkout: MostRecentWorkoutHook;
|
|
324
|
+
readonly useMostRecentCategorySample: MostRecentCategorySampleHook;
|
|
325
|
+
readonly useMostRecentQuantitySample: MostRecentQuantitySampleHook;
|
|
316
326
|
|
|
317
|
-
useSubscribeToChanges: SubscribeToChangesHook;
|
|
327
|
+
readonly useSubscribeToChanges: SubscribeToChangesHook;
|
|
328
|
+
readonly useIsHealthDataAvailable: () => boolean | null;
|
|
329
|
+
readonly useHealthkitAuthorization: (
|
|
330
|
+
read: readonly ValueOf<typeof HealthkitAuthorization>[],
|
|
331
|
+
write?: readonly ValueOf<typeof HKSampleTypeIdentifier>[],
|
|
332
|
+
) => readonly [authorizationStatus: HKAuthorizationRequestStatus | null, request: () => Promise<HKAuthorizationRequestStatus | null>];
|
|
318
333
|
};
|
package/.DS_Store
DELETED
|
Binary file
|
package/.circleci/config.yml
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
|
|
3
|
-
executors:
|
|
4
|
-
default:
|
|
5
|
-
docker:
|
|
6
|
-
- image: circleci/node:10
|
|
7
|
-
working_directory: ~/project
|
|
8
|
-
|
|
9
|
-
commands:
|
|
10
|
-
attach_project:
|
|
11
|
-
steps:
|
|
12
|
-
- attach_workspace:
|
|
13
|
-
at: ~/project
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
install-dependencies:
|
|
17
|
-
executor: default
|
|
18
|
-
steps:
|
|
19
|
-
- checkout
|
|
20
|
-
- attach_project
|
|
21
|
-
- restore_cache:
|
|
22
|
-
keys:
|
|
23
|
-
- dependencies-{{ checksum "package.json" }}
|
|
24
|
-
- dependencies-
|
|
25
|
-
- restore_cache:
|
|
26
|
-
keys:
|
|
27
|
-
- dependencies-example-{{ checksum "example/package.json" }}
|
|
28
|
-
- dependencies-example-
|
|
29
|
-
- run:
|
|
30
|
-
name: Install dependencies
|
|
31
|
-
command: |
|
|
32
|
-
yarn install --cwd example --frozen-lockfile
|
|
33
|
-
yarn install --frozen-lockfile
|
|
34
|
-
- save_cache:
|
|
35
|
-
key: dependencies-{{ checksum "package.json" }}
|
|
36
|
-
paths: node_modules
|
|
37
|
-
- save_cache:
|
|
38
|
-
key: dependencies-example-{{ checksum "example/package.json" }}
|
|
39
|
-
paths: example/node_modules
|
|
40
|
-
- persist_to_workspace:
|
|
41
|
-
root: .
|
|
42
|
-
paths: .
|
|
43
|
-
|
|
44
|
-
lint:
|
|
45
|
-
executor: default
|
|
46
|
-
steps:
|
|
47
|
-
- attach_project
|
|
48
|
-
- run:
|
|
49
|
-
name: Lint files
|
|
50
|
-
command: |
|
|
51
|
-
yarn lint
|
|
52
|
-
|
|
53
|
-
typescript:
|
|
54
|
-
executor: default
|
|
55
|
-
steps:
|
|
56
|
-
- attach_project
|
|
57
|
-
- run:
|
|
58
|
-
name: Typecheck files
|
|
59
|
-
command: |
|
|
60
|
-
yarn typescript
|
|
61
|
-
|
|
62
|
-
unit-tests:
|
|
63
|
-
executor: default
|
|
64
|
-
steps:
|
|
65
|
-
- attach_project
|
|
66
|
-
- run:
|
|
67
|
-
name: Run unit tests
|
|
68
|
-
command: |
|
|
69
|
-
yarn test --coverage
|
|
70
|
-
- store_artifacts:
|
|
71
|
-
path: coverage
|
|
72
|
-
destination: coverage
|
|
73
|
-
|
|
74
|
-
build-package:
|
|
75
|
-
executor: default
|
|
76
|
-
steps:
|
|
77
|
-
- attach_project
|
|
78
|
-
- run:
|
|
79
|
-
name: Build package
|
|
80
|
-
command: |
|
|
81
|
-
yarn prepare
|
|
82
|
-
|
|
83
|
-
workflows:
|
|
84
|
-
build-and-test:
|
|
85
|
-
jobs:
|
|
86
|
-
- install-dependencies
|
|
87
|
-
- lint:
|
|
88
|
-
requires:
|
|
89
|
-
- install-dependencies
|
|
90
|
-
- typescript:
|
|
91
|
-
requires:
|
|
92
|
-
- install-dependencies
|
|
93
|
-
- unit-tests:
|
|
94
|
-
requires:
|
|
95
|
-
- install-dependencies
|
|
96
|
-
- build-package:
|
|
97
|
-
requires:
|
|
98
|
-
- install-dependencies
|
package/.editorconfig
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
[*]
|
|
8
|
-
|
|
9
|
-
indent_style = space
|
|
10
|
-
indent_size = 2
|
|
11
|
-
|
|
12
|
-
end_of_line = lf
|
|
13
|
-
charset = utf-8
|
|
14
|
-
trim_trailing_whitespace = true
|
|
15
|
-
insert_final_newline = true
|
package/.gitattributes
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# This is a basic workflow to help you get started with Actions
|
|
2
|
-
|
|
3
|
-
name: Test
|
|
4
|
-
|
|
5
|
-
# Controls when the action will run.
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [ '**' ]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ '**' ]
|
|
11
|
-
workflow_dispatch:
|
|
12
|
-
|
|
13
|
-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
14
|
-
jobs:
|
|
15
|
-
# This workflow contains a single job called "build"
|
|
16
|
-
build:
|
|
17
|
-
# The type of runner that the job will run on
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
|
|
20
|
-
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
21
|
-
steps:
|
|
22
|
-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
23
|
-
- name: "Checkout"
|
|
24
|
-
uses: actions/checkout@v2
|
|
25
|
-
- name: "Setup Node"
|
|
26
|
-
uses: actions/setup-node@v2.1.5
|
|
27
|
-
- name: "Install example deps"
|
|
28
|
-
run: cd example && yarn && cd ..
|
|
29
|
-
- name: "Install deps"
|
|
30
|
-
run: yarn
|
|
31
|
-
- name: "Lint and typecheck"
|
|
32
|
-
run: yarn typescript && yarn lint
|
package/.gitignore
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# OSX
|
|
2
|
-
#
|
|
3
|
-
.DS_Store
|
|
4
|
-
|
|
5
|
-
# XDE
|
|
6
|
-
.expo/
|
|
7
|
-
|
|
8
|
-
# VSCode
|
|
9
|
-
.vscode/
|
|
10
|
-
jsconfig.json
|
|
11
|
-
|
|
12
|
-
# Xcode
|
|
13
|
-
#
|
|
14
|
-
build/
|
|
15
|
-
*.pbxuser
|
|
16
|
-
!default.pbxuser
|
|
17
|
-
*.mode1v3
|
|
18
|
-
!default.mode1v3
|
|
19
|
-
*.mode2v3
|
|
20
|
-
!default.mode2v3
|
|
21
|
-
*.perspectivev3
|
|
22
|
-
!default.perspectivev3
|
|
23
|
-
xcuserdata
|
|
24
|
-
*.xccheckout
|
|
25
|
-
*.moved-aside
|
|
26
|
-
DerivedData
|
|
27
|
-
*.hmap
|
|
28
|
-
*.ipa
|
|
29
|
-
*.xcuserstate
|
|
30
|
-
project.xcworkspace
|
|
31
|
-
|
|
32
|
-
# Android/IJ
|
|
33
|
-
#
|
|
34
|
-
.idea
|
|
35
|
-
.gradle
|
|
36
|
-
local.properties
|
|
37
|
-
android.iml
|
|
38
|
-
|
|
39
|
-
# Cocoapods
|
|
40
|
-
#
|
|
41
|
-
example/ios/Pods
|
|
42
|
-
|
|
43
|
-
# node.js
|
|
44
|
-
#
|
|
45
|
-
node_modules/
|
|
46
|
-
npm-debug.log
|
|
47
|
-
yarn-debug.log
|
|
48
|
-
yarn-error.log
|
|
49
|
-
|
|
50
|
-
# BUCK
|
|
51
|
-
buck-out/
|
|
52
|
-
\.buckd/
|
|
53
|
-
android/app/libs
|
|
54
|
-
android/keystores/debug.keystore
|
|
55
|
-
|
|
56
|
-
# Expo
|
|
57
|
-
.expo/*
|
|
58
|
-
|
|
59
|
-
# generated by bob
|
|
60
|
-
lib/
|