@ray-js/api 1.6.16 → 1.6.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/@types/HealthKit.d.ts +1121 -0
- package/@types/all-kits.d.ts +1 -0
- package/lib/HealthKit-5.18.4.d.ts +42 -0
- package/lib/HealthKit-5.18.4.js +128 -0
- package/lib/cloud/health.js +0 -1
- package/lib/cloud/index.d.ts +1 -1
- package/lib/cloud/index.js +4 -2
- package/lib/index.d.ts +70 -1
- package/lib/index.js +15 -1
- package/package.json +5 -5
- package/lib/all-kits.d.ts +0 -11
- package/lib/all-kits.js +0 -11
@@ -0,0 +1,1121 @@
|
|
1
|
+
/**
|
2
|
+
* HealthKit
|
3
|
+
*
|
4
|
+
* @version 5.18.4
|
5
|
+
*/
|
6
|
+
declare namespace ty.health {
|
7
|
+
/**
|
8
|
+
*@description health connect sdk状态获取[Android only]*/
|
9
|
+
export function getHealthConnectStatus(params?: {
|
10
|
+
success?: (params: {
|
11
|
+
/**
|
12
|
+
* -2 服务不可用(需要提示用户去更改自启动和电源管理),建议面板收到-2直接跳转到授权页。授权页做弹窗提示
|
13
|
+
* -1 Health Connect不可用/不支持]
|
14
|
+
* 0 已授权
|
15
|
+
* 1 未安装Health Connect
|
16
|
+
* 2 未授权
|
17
|
+
*/
|
18
|
+
value: number
|
19
|
+
}) => void
|
20
|
+
fail?: (params: {
|
21
|
+
errorMsg: string
|
22
|
+
errorCode: string | number
|
23
|
+
innerError: {
|
24
|
+
errorCode: string | number
|
25
|
+
errorMsg: string
|
26
|
+
}
|
27
|
+
}) => void
|
28
|
+
complete?: () => void
|
29
|
+
}): void
|
30
|
+
|
31
|
+
/**
|
32
|
+
*@description health connect sdk状态获取[Android only]*/
|
33
|
+
export function getHealthConnectStatusSync(): {
|
34
|
+
/**
|
35
|
+
* -2 服务不可用(需要提示用户去更改自启动和电源管理),建议面板收到-2直接跳转到授权页。授权页做弹窗提示
|
36
|
+
* -1 Health Connect不可用/不支持]
|
37
|
+
* 0 已授权
|
38
|
+
* 1 未安装Health Connect
|
39
|
+
* 2 未授权
|
40
|
+
*/
|
41
|
+
value: number
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
*@description 数据同步到health connect [Android only]
|
46
|
+
*@error {-1005: 'service error,please check if Health Connect is set to auto-start and if power management has no restrictions'} | {-1004: 'error when commit to Health Connect'} | {-1003: 'data is null'} | {-1002: 'data conversion error'} | {-1001: 'phone is not support'}*/
|
47
|
+
export function insertRecords(params: {
|
48
|
+
/** RecordData数据列表的json array字符串 */
|
49
|
+
request: string
|
50
|
+
success?: (params: boolean) => void
|
51
|
+
fail?: (params: {
|
52
|
+
errorMsg: string
|
53
|
+
errorCode: string | number
|
54
|
+
innerError: {
|
55
|
+
errorCode: string | number
|
56
|
+
errorMsg: string
|
57
|
+
}
|
58
|
+
}) => void
|
59
|
+
complete?: () => void
|
60
|
+
}): void
|
61
|
+
|
62
|
+
/**
|
63
|
+
*@description 数据同步到health connect [Android only]
|
64
|
+
*@error {-1005: 'service error,please check if Health Connect is set to auto-start and if power management has no restrictions'} | {-1004: 'error when commit to Health Connect'} | {-1003: 'data is null'} | {-1002: 'data conversion error'} | {-1001: 'phone is not support'}*/
|
65
|
+
export function insertRecordsSync(request?: RecordParams): boolean
|
66
|
+
|
67
|
+
/**
|
68
|
+
*@description 用户是否已经做过授权操作(针对Quantity类型数据)[iOS only]
|
69
|
+
*需要参数为readPermissions,writePermissions
|
70
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
71
|
+
export function authStatusPermissions(params?: {
|
72
|
+
/**
|
73
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
74
|
+
* eg. ["1","2"]
|
75
|
+
*/
|
76
|
+
permissions?: string[]
|
77
|
+
/**
|
78
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
79
|
+
* eg. ["1","2"]
|
80
|
+
*/
|
81
|
+
readPermissions?: string[]
|
82
|
+
/**
|
83
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
84
|
+
* eg. ["1","2"]
|
85
|
+
*/
|
86
|
+
writePermissions?: string[]
|
87
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
88
|
+
writePermission?: number
|
89
|
+
/** 写入值 */
|
90
|
+
value?: number
|
91
|
+
/**
|
92
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
93
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
94
|
+
*/
|
95
|
+
unitType?: string
|
96
|
+
/** 开始时间,秒级时间戳 */
|
97
|
+
startTime?: number
|
98
|
+
/** 结束时间,秒级时间戳 */
|
99
|
+
endTime?: number
|
100
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
101
|
+
type?: number
|
102
|
+
success?: (params: {
|
103
|
+
/**
|
104
|
+
* 1 代表传入的类型都申请过对应的读写权限
|
105
|
+
* 0 代表传入的类型至少有一个没有请求过对应的读写权限
|
106
|
+
*/
|
107
|
+
value: number
|
108
|
+
}) => void
|
109
|
+
fail?: (params: {
|
110
|
+
errorMsg: string
|
111
|
+
errorCode: string | number
|
112
|
+
innerError: {
|
113
|
+
errorCode: string | number
|
114
|
+
errorMsg: string
|
115
|
+
}
|
116
|
+
}) => void
|
117
|
+
complete?: () => void
|
118
|
+
}): void
|
119
|
+
|
120
|
+
/**
|
121
|
+
*@description 用户是否已经做过授权操作(针对Quantity类型数据)[iOS only]
|
122
|
+
*需要参数为readPermissions,writePermissions
|
123
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
124
|
+
export function authStatusPermissionsSync(paramModel?: ParamModel): {
|
125
|
+
/**
|
126
|
+
* 1 代表传入的类型都申请过对应的读写权限
|
127
|
+
* 0 代表传入的类型至少有一个没有请求过对应的读写权限
|
128
|
+
*/
|
129
|
+
value: number
|
130
|
+
}
|
131
|
+
|
132
|
+
/**
|
133
|
+
*@description 用户是否有Quantity类型数据写入权限[iOS only]
|
134
|
+
*需要参数为writePermission
|
135
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
136
|
+
export function getSaveQuantityPermission(params?: {
|
137
|
+
/**
|
138
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
139
|
+
* eg. ["1","2"]
|
140
|
+
*/
|
141
|
+
permissions?: string[]
|
142
|
+
/**
|
143
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
144
|
+
* eg. ["1","2"]
|
145
|
+
*/
|
146
|
+
readPermissions?: string[]
|
147
|
+
/**
|
148
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
149
|
+
* eg. ["1","2"]
|
150
|
+
*/
|
151
|
+
writePermissions?: string[]
|
152
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
153
|
+
writePermission?: number
|
154
|
+
/** 写入值 */
|
155
|
+
value?: number
|
156
|
+
/**
|
157
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
158
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
159
|
+
*/
|
160
|
+
unitType?: string
|
161
|
+
/** 开始时间,秒级时间戳 */
|
162
|
+
startTime?: number
|
163
|
+
/** 结束时间,秒级时间戳 */
|
164
|
+
endTime?: number
|
165
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
166
|
+
type?: number
|
167
|
+
success?: (params: {
|
168
|
+
/**
|
169
|
+
* 1 有写入权限
|
170
|
+
* 0 无写入权限
|
171
|
+
*/
|
172
|
+
value: number
|
173
|
+
}) => void
|
174
|
+
fail?: (params: {
|
175
|
+
errorMsg: string
|
176
|
+
errorCode: string | number
|
177
|
+
innerError: {
|
178
|
+
errorCode: string | number
|
179
|
+
errorMsg: string
|
180
|
+
}
|
181
|
+
}) => void
|
182
|
+
complete?: () => void
|
183
|
+
}): void
|
184
|
+
|
185
|
+
/**
|
186
|
+
*@description 用户是否有Quantity类型数据写入权限[iOS only]
|
187
|
+
*需要参数为writePermission
|
188
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
189
|
+
export function getSaveQuantityPermissionSync(paramModel?: ParamModel): {
|
190
|
+
/**
|
191
|
+
* 1 有写入权限
|
192
|
+
* 0 无写入权限
|
193
|
+
*/
|
194
|
+
value: number
|
195
|
+
}
|
196
|
+
|
197
|
+
/**
|
198
|
+
*@description Quantity写入权限申请接口[iOS only]
|
199
|
+
*需要参数为permissions
|
200
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
201
|
+
export function authQuantityWritePermissions(params?: {
|
202
|
+
/**
|
203
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
204
|
+
* eg. ["1","2"]
|
205
|
+
*/
|
206
|
+
permissions?: string[]
|
207
|
+
/**
|
208
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
209
|
+
* eg. ["1","2"]
|
210
|
+
*/
|
211
|
+
readPermissions?: string[]
|
212
|
+
/**
|
213
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
214
|
+
* eg. ["1","2"]
|
215
|
+
*/
|
216
|
+
writePermissions?: string[]
|
217
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
218
|
+
writePermission?: number
|
219
|
+
/** 写入值 */
|
220
|
+
value?: number
|
221
|
+
/**
|
222
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
223
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
224
|
+
*/
|
225
|
+
unitType?: string
|
226
|
+
/** 开始时间,秒级时间戳 */
|
227
|
+
startTime?: number
|
228
|
+
/** 结束时间,秒级时间戳 */
|
229
|
+
endTime?: number
|
230
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
231
|
+
type?: number
|
232
|
+
success?: (params: null) => void
|
233
|
+
fail?: (params: {
|
234
|
+
errorMsg: string
|
235
|
+
errorCode: string | number
|
236
|
+
innerError: {
|
237
|
+
errorCode: string | number
|
238
|
+
errorMsg: string
|
239
|
+
}
|
240
|
+
}) => void
|
241
|
+
complete?: () => void
|
242
|
+
}): void
|
243
|
+
|
244
|
+
/**
|
245
|
+
*@description Quantity写入权限申请接口[iOS only]
|
246
|
+
*需要参数为permissions
|
247
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
248
|
+
export function authQuantityWritePermissionsSync(paramModel?: ParamModel): null
|
249
|
+
|
250
|
+
/**
|
251
|
+
*@description Category写入权限申请接口[iOS only]
|
252
|
+
*需要参数为permissions
|
253
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
254
|
+
export function authCategoryWritePermissions(params?: {
|
255
|
+
/**
|
256
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
257
|
+
* eg. ["1","2"]
|
258
|
+
*/
|
259
|
+
permissions?: string[]
|
260
|
+
/**
|
261
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
262
|
+
* eg. ["1","2"]
|
263
|
+
*/
|
264
|
+
readPermissions?: string[]
|
265
|
+
/**
|
266
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
267
|
+
* eg. ["1","2"]
|
268
|
+
*/
|
269
|
+
writePermissions?: string[]
|
270
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
271
|
+
writePermission?: number
|
272
|
+
/** 写入值 */
|
273
|
+
value?: number
|
274
|
+
/**
|
275
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
276
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
277
|
+
*/
|
278
|
+
unitType?: string
|
279
|
+
/** 开始时间,秒级时间戳 */
|
280
|
+
startTime?: number
|
281
|
+
/** 结束时间,秒级时间戳 */
|
282
|
+
endTime?: number
|
283
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
284
|
+
type?: number
|
285
|
+
success?: (params: null) => void
|
286
|
+
fail?: (params: {
|
287
|
+
errorMsg: string
|
288
|
+
errorCode: string | number
|
289
|
+
innerError: {
|
290
|
+
errorCode: string | number
|
291
|
+
errorMsg: string
|
292
|
+
}
|
293
|
+
}) => void
|
294
|
+
complete?: () => void
|
295
|
+
}): void
|
296
|
+
|
297
|
+
/**
|
298
|
+
*@description Category写入权限申请接口[iOS only]
|
299
|
+
*需要参数为permissions
|
300
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
301
|
+
export function authCategoryWritePermissionsSync(paramModel?: ParamModel): null
|
302
|
+
|
303
|
+
/**
|
304
|
+
*@description Quantity读取权限申请[iOS only]
|
305
|
+
*需要参数为permissions
|
306
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
307
|
+
export function authQuantityReadPermissions(params?: {
|
308
|
+
/**
|
309
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
310
|
+
* eg. ["1","2"]
|
311
|
+
*/
|
312
|
+
permissions?: string[]
|
313
|
+
/**
|
314
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
315
|
+
* eg. ["1","2"]
|
316
|
+
*/
|
317
|
+
readPermissions?: string[]
|
318
|
+
/**
|
319
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
320
|
+
* eg. ["1","2"]
|
321
|
+
*/
|
322
|
+
writePermissions?: string[]
|
323
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
324
|
+
writePermission?: number
|
325
|
+
/** 写入值 */
|
326
|
+
value?: number
|
327
|
+
/**
|
328
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
329
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
330
|
+
*/
|
331
|
+
unitType?: string
|
332
|
+
/** 开始时间,秒级时间戳 */
|
333
|
+
startTime?: number
|
334
|
+
/** 结束时间,秒级时间戳 */
|
335
|
+
endTime?: number
|
336
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
337
|
+
type?: number
|
338
|
+
success?: (params: null) => void
|
339
|
+
fail?: (params: {
|
340
|
+
errorMsg: string
|
341
|
+
errorCode: string | number
|
342
|
+
innerError: {
|
343
|
+
errorCode: string | number
|
344
|
+
errorMsg: string
|
345
|
+
}
|
346
|
+
}) => void
|
347
|
+
complete?: () => void
|
348
|
+
}): void
|
349
|
+
|
350
|
+
/**
|
351
|
+
*@description Quantity读取权限申请[iOS only]
|
352
|
+
*需要参数为permissions
|
353
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
354
|
+
export function authQuantityReadPermissionsSync(paramModel?: ParamModel): null
|
355
|
+
|
356
|
+
/**
|
357
|
+
*@description Category 读取权限申请[iOS only]
|
358
|
+
*需要参数为permissions
|
359
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
360
|
+
export function authCategoryReadPermissions(params?: {
|
361
|
+
/**
|
362
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
363
|
+
* eg. ["1","2"]
|
364
|
+
*/
|
365
|
+
permissions?: string[]
|
366
|
+
/**
|
367
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
368
|
+
* eg. ["1","2"]
|
369
|
+
*/
|
370
|
+
readPermissions?: string[]
|
371
|
+
/**
|
372
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
373
|
+
* eg. ["1","2"]
|
374
|
+
*/
|
375
|
+
writePermissions?: string[]
|
376
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
377
|
+
writePermission?: number
|
378
|
+
/** 写入值 */
|
379
|
+
value?: number
|
380
|
+
/**
|
381
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
382
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
383
|
+
*/
|
384
|
+
unitType?: string
|
385
|
+
/** 开始时间,秒级时间戳 */
|
386
|
+
startTime?: number
|
387
|
+
/** 结束时间,秒级时间戳 */
|
388
|
+
endTime?: number
|
389
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
390
|
+
type?: number
|
391
|
+
success?: (params: null) => void
|
392
|
+
fail?: (params: {
|
393
|
+
errorMsg: string
|
394
|
+
errorCode: string | number
|
395
|
+
innerError: {
|
396
|
+
errorCode: string | number
|
397
|
+
errorMsg: string
|
398
|
+
}
|
399
|
+
}) => void
|
400
|
+
complete?: () => void
|
401
|
+
}): void
|
402
|
+
|
403
|
+
/**
|
404
|
+
*@description Category 读取权限申请[iOS only]
|
405
|
+
*需要参数为permissions
|
406
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
407
|
+
export function authCategoryReadPermissionsSync(paramModel?: ParamModel): null
|
408
|
+
|
409
|
+
/**
|
410
|
+
*@description Characteristic 读取权限申请[iOS only]
|
411
|
+
*需要参数为permissions
|
412
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
413
|
+
export function authCharacteristicReadPermissions(params?: {
|
414
|
+
/**
|
415
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
416
|
+
* eg. ["1","2"]
|
417
|
+
*/
|
418
|
+
permissions?: string[]
|
419
|
+
/**
|
420
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
421
|
+
* eg. ["1","2"]
|
422
|
+
*/
|
423
|
+
readPermissions?: string[]
|
424
|
+
/**
|
425
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
426
|
+
* eg. ["1","2"]
|
427
|
+
*/
|
428
|
+
writePermissions?: string[]
|
429
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
430
|
+
writePermission?: number
|
431
|
+
/** 写入值 */
|
432
|
+
value?: number
|
433
|
+
/**
|
434
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
435
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
436
|
+
*/
|
437
|
+
unitType?: string
|
438
|
+
/** 开始时间,秒级时间戳 */
|
439
|
+
startTime?: number
|
440
|
+
/** 结束时间,秒级时间戳 */
|
441
|
+
endTime?: number
|
442
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
443
|
+
type?: number
|
444
|
+
success?: (params: null) => void
|
445
|
+
fail?: (params: {
|
446
|
+
errorMsg: string
|
447
|
+
errorCode: string | number
|
448
|
+
innerError: {
|
449
|
+
errorCode: string | number
|
450
|
+
errorMsg: string
|
451
|
+
}
|
452
|
+
}) => void
|
453
|
+
complete?: () => void
|
454
|
+
}): void
|
455
|
+
|
456
|
+
/**
|
457
|
+
*@description Characteristic 读取权限申请[iOS only]
|
458
|
+
*需要参数为permissions
|
459
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
460
|
+
export function authCharacteristicReadPermissionsSync(paramModel?: ParamModel): null
|
461
|
+
|
462
|
+
/**
|
463
|
+
*@description Quantity读写权限申请[iOS only]
|
464
|
+
*需要参数为permissions
|
465
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
466
|
+
export function authQuantityRWPermissions(params?: {
|
467
|
+
/**
|
468
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
469
|
+
* eg. ["1","2"]
|
470
|
+
*/
|
471
|
+
permissions?: string[]
|
472
|
+
/**
|
473
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
474
|
+
* eg. ["1","2"]
|
475
|
+
*/
|
476
|
+
readPermissions?: string[]
|
477
|
+
/**
|
478
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
479
|
+
* eg. ["1","2"]
|
480
|
+
*/
|
481
|
+
writePermissions?: string[]
|
482
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
483
|
+
writePermission?: number
|
484
|
+
/** 写入值 */
|
485
|
+
value?: number
|
486
|
+
/**
|
487
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
488
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
489
|
+
*/
|
490
|
+
unitType?: string
|
491
|
+
/** 开始时间,秒级时间戳 */
|
492
|
+
startTime?: number
|
493
|
+
/** 结束时间,秒级时间戳 */
|
494
|
+
endTime?: number
|
495
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
496
|
+
type?: number
|
497
|
+
success?: (params: null) => void
|
498
|
+
fail?: (params: {
|
499
|
+
errorMsg: string
|
500
|
+
errorCode: string | number
|
501
|
+
innerError: {
|
502
|
+
errorCode: string | number
|
503
|
+
errorMsg: string
|
504
|
+
}
|
505
|
+
}) => void
|
506
|
+
complete?: () => void
|
507
|
+
}): void
|
508
|
+
|
509
|
+
/**
|
510
|
+
*@description Quantity读写权限申请[iOS only]
|
511
|
+
*需要参数为permissions
|
512
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
513
|
+
export function authQuantityRWPermissionsSync(paramModel?: ParamModel): null
|
514
|
+
|
515
|
+
/**
|
516
|
+
*@description Category 读写权限申请[iOS only]
|
517
|
+
*需要参数为permissions
|
518
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
519
|
+
export function authCategoryRWPermissions(params?: {
|
520
|
+
/**
|
521
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
522
|
+
* eg. ["1","2"]
|
523
|
+
*/
|
524
|
+
permissions?: string[]
|
525
|
+
/**
|
526
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
527
|
+
* eg. ["1","2"]
|
528
|
+
*/
|
529
|
+
readPermissions?: string[]
|
530
|
+
/**
|
531
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
532
|
+
* eg. ["1","2"]
|
533
|
+
*/
|
534
|
+
writePermissions?: string[]
|
535
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
536
|
+
writePermission?: number
|
537
|
+
/** 写入值 */
|
538
|
+
value?: number
|
539
|
+
/**
|
540
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
541
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
542
|
+
*/
|
543
|
+
unitType?: string
|
544
|
+
/** 开始时间,秒级时间戳 */
|
545
|
+
startTime?: number
|
546
|
+
/** 结束时间,秒级时间戳 */
|
547
|
+
endTime?: number
|
548
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
549
|
+
type?: number
|
550
|
+
success?: (params: null) => void
|
551
|
+
fail?: (params: {
|
552
|
+
errorMsg: string
|
553
|
+
errorCode: string | number
|
554
|
+
innerError: {
|
555
|
+
errorCode: string | number
|
556
|
+
errorMsg: string
|
557
|
+
}
|
558
|
+
}) => void
|
559
|
+
complete?: () => void
|
560
|
+
}): void
|
561
|
+
|
562
|
+
/**
|
563
|
+
*@description Category 读写权限申请[iOS only]
|
564
|
+
*需要参数为permissions
|
565
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
566
|
+
export function authCategoryRWPermissionsSync(paramModel?: ParamModel): null
|
567
|
+
|
568
|
+
/**
|
569
|
+
*@description 写入Quantity类型的数据[iOS only]
|
570
|
+
*需要参数为value,type,unitType,startTime,endTime
|
571
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
572
|
+
export function saveQuantityData(params?: {
|
573
|
+
/**
|
574
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
575
|
+
* eg. ["1","2"]
|
576
|
+
*/
|
577
|
+
permissions?: string[]
|
578
|
+
/**
|
579
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
580
|
+
* eg. ["1","2"]
|
581
|
+
*/
|
582
|
+
readPermissions?: string[]
|
583
|
+
/**
|
584
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
585
|
+
* eg. ["1","2"]
|
586
|
+
*/
|
587
|
+
writePermissions?: string[]
|
588
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
589
|
+
writePermission?: number
|
590
|
+
/** 写入值 */
|
591
|
+
value?: number
|
592
|
+
/**
|
593
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
594
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
595
|
+
*/
|
596
|
+
unitType?: string
|
597
|
+
/** 开始时间,秒级时间戳 */
|
598
|
+
startTime?: number
|
599
|
+
/** 结束时间,秒级时间戳 */
|
600
|
+
endTime?: number
|
601
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
602
|
+
type?: number
|
603
|
+
success?: (params: null) => void
|
604
|
+
fail?: (params: {
|
605
|
+
errorMsg: string
|
606
|
+
errorCode: string | number
|
607
|
+
innerError: {
|
608
|
+
errorCode: string | number
|
609
|
+
errorMsg: string
|
610
|
+
}
|
611
|
+
}) => void
|
612
|
+
complete?: () => void
|
613
|
+
}): void
|
614
|
+
|
615
|
+
/**
|
616
|
+
*@description 写入Quantity类型的数据[iOS only]
|
617
|
+
*需要参数为value,type,unitType,startTime,endTime
|
618
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
619
|
+
export function saveQuantityDataSync(paramModel?: ParamModel): null
|
620
|
+
|
621
|
+
/**
|
622
|
+
*@description 写入Quantity类型的数据,不用传时间,开始时间和结束时间默认设置为当前时间[iOS only]
|
623
|
+
*需要参数为value,type,unitType
|
624
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
625
|
+
export function saveQuantityNoTimeWithData(params?: {
|
626
|
+
/**
|
627
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
628
|
+
* eg. ["1","2"]
|
629
|
+
*/
|
630
|
+
permissions?: string[]
|
631
|
+
/**
|
632
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
633
|
+
* eg. ["1","2"]
|
634
|
+
*/
|
635
|
+
readPermissions?: string[]
|
636
|
+
/**
|
637
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
638
|
+
* eg. ["1","2"]
|
639
|
+
*/
|
640
|
+
writePermissions?: string[]
|
641
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
642
|
+
writePermission?: number
|
643
|
+
/** 写入值 */
|
644
|
+
value?: number
|
645
|
+
/**
|
646
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
647
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
648
|
+
*/
|
649
|
+
unitType?: string
|
650
|
+
/** 开始时间,秒级时间戳 */
|
651
|
+
startTime?: number
|
652
|
+
/** 结束时间,秒级时间戳 */
|
653
|
+
endTime?: number
|
654
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
655
|
+
type?: number
|
656
|
+
success?: (params: null) => void
|
657
|
+
fail?: (params: {
|
658
|
+
errorMsg: string
|
659
|
+
errorCode: string | number
|
660
|
+
innerError: {
|
661
|
+
errorCode: string | number
|
662
|
+
errorMsg: string
|
663
|
+
}
|
664
|
+
}) => void
|
665
|
+
complete?: () => void
|
666
|
+
}): void
|
667
|
+
|
668
|
+
/**
|
669
|
+
*@description 写入Quantity类型的数据,不用传时间,开始时间和结束时间默认设置为当前时间[iOS only]
|
670
|
+
*需要参数为value,type,unitType
|
671
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
672
|
+
export function saveQuantityNoTimeWithDataSync(paramModel?: ParamModel): null
|
673
|
+
|
674
|
+
/**
|
675
|
+
*@description 写入血压数据[iOS only]
|
676
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
677
|
+
export function saveBloodPressureData(params: {
|
678
|
+
/** 收缩压 */
|
679
|
+
systolic: number
|
680
|
+
/** 舒张压 */
|
681
|
+
diastolic: number
|
682
|
+
/** 开始时间,秒级时间戳 */
|
683
|
+
startTime: number
|
684
|
+
/** 结束时间,秒级时间戳 */
|
685
|
+
endTime: number
|
686
|
+
success?: (params: null) => void
|
687
|
+
fail?: (params: {
|
688
|
+
errorMsg: string
|
689
|
+
errorCode: string | number
|
690
|
+
innerError: {
|
691
|
+
errorCode: string | number
|
692
|
+
errorMsg: string
|
693
|
+
}
|
694
|
+
}) => void
|
695
|
+
complete?: () => void
|
696
|
+
}): void
|
697
|
+
|
698
|
+
/**
|
699
|
+
*@description 写入血压数据[iOS only]
|
700
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
701
|
+
export function saveBloodPressureDataSync(paramModel?: BloodPressureParams): null
|
702
|
+
|
703
|
+
/**
|
704
|
+
*@description 读取 Quantity[iOS only]
|
705
|
+
*需要参数为type,unitType,startTime,endTime
|
706
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
707
|
+
export function readQuantityDataWithType(params?: {
|
708
|
+
/**
|
709
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
710
|
+
* eg. ["1","2"]
|
711
|
+
*/
|
712
|
+
permissions?: string[]
|
713
|
+
/**
|
714
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
715
|
+
* eg. ["1","2"]
|
716
|
+
*/
|
717
|
+
readPermissions?: string[]
|
718
|
+
/**
|
719
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
720
|
+
* eg. ["1","2"]
|
721
|
+
*/
|
722
|
+
writePermissions?: string[]
|
723
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
724
|
+
writePermission?: number
|
725
|
+
/** 写入值 */
|
726
|
+
value?: number
|
727
|
+
/**
|
728
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
729
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
730
|
+
*/
|
731
|
+
unitType?: string
|
732
|
+
/** 开始时间,秒级时间戳 */
|
733
|
+
startTime?: number
|
734
|
+
/** 结束时间,秒级时间戳 */
|
735
|
+
endTime?: number
|
736
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
737
|
+
type?: number
|
738
|
+
success?: (params: {
|
739
|
+
/**
|
740
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
741
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
742
|
+
* startDate: Double 读取到的条目的起始时间戳
|
743
|
+
* endDate: Double 读取到的条目的截止时间戳
|
744
|
+
*/
|
745
|
+
value: Object[]
|
746
|
+
}) => void
|
747
|
+
fail?: (params: {
|
748
|
+
errorMsg: string
|
749
|
+
errorCode: string | number
|
750
|
+
innerError: {
|
751
|
+
errorCode: string | number
|
752
|
+
errorMsg: string
|
753
|
+
}
|
754
|
+
}) => void
|
755
|
+
complete?: () => void
|
756
|
+
}): void
|
757
|
+
|
758
|
+
/**
|
759
|
+
*@description 读取 Quantity[iOS only]
|
760
|
+
*需要参数为type,unitType,startTime,endTime
|
761
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
762
|
+
export function readQuantityDataWithTypeSync(paramModel?: ParamModel): {
|
763
|
+
/**
|
764
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
765
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
766
|
+
* startDate: Double 读取到的条目的起始时间戳
|
767
|
+
* endDate: Double 读取到的条目的截止时间戳
|
768
|
+
*/
|
769
|
+
value: Object[]
|
770
|
+
}
|
771
|
+
|
772
|
+
/**
|
773
|
+
*@description 删除QuantityData数据,基于起止时间删除[iOS only]
|
774
|
+
*需要参数为type,startTime,endTime
|
775
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
776
|
+
export function deleteQuantityDataType(params?: {
|
777
|
+
/**
|
778
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
779
|
+
* eg. ["1","2"]
|
780
|
+
*/
|
781
|
+
permissions?: string[]
|
782
|
+
/**
|
783
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
784
|
+
* eg. ["1","2"]
|
785
|
+
*/
|
786
|
+
readPermissions?: string[]
|
787
|
+
/**
|
788
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
789
|
+
* eg. ["1","2"]
|
790
|
+
*/
|
791
|
+
writePermissions?: string[]
|
792
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
793
|
+
writePermission?: number
|
794
|
+
/** 写入值 */
|
795
|
+
value?: number
|
796
|
+
/**
|
797
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
798
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
799
|
+
*/
|
800
|
+
unitType?: string
|
801
|
+
/** 开始时间,秒级时间戳 */
|
802
|
+
startTime?: number
|
803
|
+
/** 结束时间,秒级时间戳 */
|
804
|
+
endTime?: number
|
805
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
806
|
+
type?: number
|
807
|
+
success?: (params: null) => void
|
808
|
+
fail?: (params: {
|
809
|
+
errorMsg: string
|
810
|
+
errorCode: string | number
|
811
|
+
innerError: {
|
812
|
+
errorCode: string | number
|
813
|
+
errorMsg: string
|
814
|
+
}
|
815
|
+
}) => void
|
816
|
+
complete?: () => void
|
817
|
+
}): void
|
818
|
+
|
819
|
+
/**
|
820
|
+
*@description 删除QuantityData数据,基于起止时间删除[iOS only]
|
821
|
+
*需要参数为type,startTime,endTime
|
822
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
823
|
+
export function deleteQuantityDataTypeSync(paramModel?: ParamModel): null
|
824
|
+
|
825
|
+
/**
|
826
|
+
*@description 读取 Characteristic[iOS only]
|
827
|
+
*需要参数为type
|
828
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
829
|
+
export function readCharacteristicDataWithType(params?: {
|
830
|
+
/**
|
831
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
832
|
+
* eg. ["1","2"]
|
833
|
+
*/
|
834
|
+
permissions?: string[]
|
835
|
+
/**
|
836
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
837
|
+
* eg. ["1","2"]
|
838
|
+
*/
|
839
|
+
readPermissions?: string[]
|
840
|
+
/**
|
841
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
842
|
+
* eg. ["1","2"]
|
843
|
+
*/
|
844
|
+
writePermissions?: string[]
|
845
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
846
|
+
writePermission?: number
|
847
|
+
/** 写入值 */
|
848
|
+
value?: number
|
849
|
+
/**
|
850
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
851
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
852
|
+
*/
|
853
|
+
unitType?: string
|
854
|
+
/** 开始时间,秒级时间戳 */
|
855
|
+
startTime?: number
|
856
|
+
/** 结束时间,秒级时间戳 */
|
857
|
+
endTime?: number
|
858
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
859
|
+
type?: number
|
860
|
+
success?: (params: {
|
861
|
+
/**
|
862
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
863
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
864
|
+
* startDate: Double 读取到的条目的起始时间戳
|
865
|
+
* endDate: Double 读取到的条目的截止时间戳
|
866
|
+
*/
|
867
|
+
value: Object[]
|
868
|
+
}) => void
|
869
|
+
fail?: (params: {
|
870
|
+
errorMsg: string
|
871
|
+
errorCode: string | number
|
872
|
+
innerError: {
|
873
|
+
errorCode: string | number
|
874
|
+
errorMsg: string
|
875
|
+
}
|
876
|
+
}) => void
|
877
|
+
complete?: () => void
|
878
|
+
}): void
|
879
|
+
|
880
|
+
/**
|
881
|
+
*@description 读取 Characteristic[iOS only]
|
882
|
+
*需要参数为type
|
883
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
884
|
+
export function readCharacteristicDataWithTypeSync(paramModel?: ParamModel): {
|
885
|
+
/**
|
886
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
887
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
888
|
+
* startDate: Double 读取到的条目的起始时间戳
|
889
|
+
* endDate: Double 读取到的条目的截止时间戳
|
890
|
+
*/
|
891
|
+
value: Object[]
|
892
|
+
}
|
893
|
+
|
894
|
+
/**
|
895
|
+
*@description 写入Category类型的数据[iOS only]
|
896
|
+
*需要参数为value,type,startTime,endTime
|
897
|
+
*Category类型数据的写入参考苹果官方文档的定义
|
898
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
899
|
+
export function saveCategoryData(params?: {
|
900
|
+
/**
|
901
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
902
|
+
* eg. ["1","2"]
|
903
|
+
*/
|
904
|
+
permissions?: string[]
|
905
|
+
/**
|
906
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
907
|
+
* eg. ["1","2"]
|
908
|
+
*/
|
909
|
+
readPermissions?: string[]
|
910
|
+
/**
|
911
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
912
|
+
* eg. ["1","2"]
|
913
|
+
*/
|
914
|
+
writePermissions?: string[]
|
915
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
916
|
+
writePermission?: number
|
917
|
+
/** 写入值 */
|
918
|
+
value?: number
|
919
|
+
/**
|
920
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
921
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
922
|
+
*/
|
923
|
+
unitType?: string
|
924
|
+
/** 开始时间,秒级时间戳 */
|
925
|
+
startTime?: number
|
926
|
+
/** 结束时间,秒级时间戳 */
|
927
|
+
endTime?: number
|
928
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
929
|
+
type?: number
|
930
|
+
success?: (params: null) => void
|
931
|
+
fail?: (params: {
|
932
|
+
errorMsg: string
|
933
|
+
errorCode: string | number
|
934
|
+
innerError: {
|
935
|
+
errorCode: string | number
|
936
|
+
errorMsg: string
|
937
|
+
}
|
938
|
+
}) => void
|
939
|
+
complete?: () => void
|
940
|
+
}): void
|
941
|
+
|
942
|
+
/**
|
943
|
+
*@description 写入Category类型的数据[iOS only]
|
944
|
+
*需要参数为value,type,startTime,endTime
|
945
|
+
*Category类型数据的写入参考苹果官方文档的定义
|
946
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
947
|
+
export function saveCategoryDataSync(paramModel?: ParamModel): null
|
948
|
+
|
949
|
+
/**
|
950
|
+
*@description 写入Category类型的数据,不用传时间,开始时间和结束时间默认设置为当前时间[iOS only]
|
951
|
+
*需要参数为value,type
|
952
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
953
|
+
export function saveCategoryNoTimeWithData(params?: {
|
954
|
+
/**
|
955
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
956
|
+
* eg. ["1","2"]
|
957
|
+
*/
|
958
|
+
permissions?: string[]
|
959
|
+
/**
|
960
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
961
|
+
* eg. ["1","2"]
|
962
|
+
*/
|
963
|
+
readPermissions?: string[]
|
964
|
+
/**
|
965
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
966
|
+
* eg. ["1","2"]
|
967
|
+
*/
|
968
|
+
writePermissions?: string[]
|
969
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
970
|
+
writePermission?: number
|
971
|
+
/** 写入值 */
|
972
|
+
value?: number
|
973
|
+
/**
|
974
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
975
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
976
|
+
*/
|
977
|
+
unitType?: string
|
978
|
+
/** 开始时间,秒级时间戳 */
|
979
|
+
startTime?: number
|
980
|
+
/** 结束时间,秒级时间戳 */
|
981
|
+
endTime?: number
|
982
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
983
|
+
type?: number
|
984
|
+
success?: (params: null) => void
|
985
|
+
fail?: (params: {
|
986
|
+
errorMsg: string
|
987
|
+
errorCode: string | number
|
988
|
+
innerError: {
|
989
|
+
errorCode: string | number
|
990
|
+
errorMsg: string
|
991
|
+
}
|
992
|
+
}) => void
|
993
|
+
complete?: () => void
|
994
|
+
}): void
|
995
|
+
|
996
|
+
/**
|
997
|
+
*@description 写入Category类型的数据,不用传时间,开始时间和结束时间默认设置为当前时间[iOS only]
|
998
|
+
*需要参数为value,type
|
999
|
+
*@error {1: 'AppleHealthParamsError'} | {2: 'AppleHealthNoPermission'}*/
|
1000
|
+
export function saveCategoryNoTimeWithDataSync(paramModel?: ParamModel): null
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
*@description 读取 Category类型的数据[iOS only]
|
1004
|
+
*需要参数为type,startTime,endTime
|
1005
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
1006
|
+
export function readCategoryDataWithType(params?: {
|
1007
|
+
/**
|
1008
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
1009
|
+
* eg. ["1","2"]
|
1010
|
+
*/
|
1011
|
+
permissions?: string[]
|
1012
|
+
/**
|
1013
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
1014
|
+
* eg. ["1","2"]
|
1015
|
+
*/
|
1016
|
+
readPermissions?: string[]
|
1017
|
+
/**
|
1018
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
1019
|
+
* eg. ["1","2"]
|
1020
|
+
*/
|
1021
|
+
writePermissions?: string[]
|
1022
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
1023
|
+
writePermission?: number
|
1024
|
+
/** 写入值 */
|
1025
|
+
value?: number
|
1026
|
+
/**
|
1027
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
1028
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
1029
|
+
*/
|
1030
|
+
unitType?: string
|
1031
|
+
/** 开始时间,秒级时间戳 */
|
1032
|
+
startTime?: number
|
1033
|
+
/** 结束时间,秒级时间戳 */
|
1034
|
+
endTime?: number
|
1035
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
1036
|
+
type?: number
|
1037
|
+
success?: (params: {
|
1038
|
+
/**
|
1039
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
1040
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
1041
|
+
* startDate: Double 读取到的条目的起始时间戳
|
1042
|
+
* endDate: Double 读取到的条目的截止时间戳
|
1043
|
+
*/
|
1044
|
+
value: Object[]
|
1045
|
+
}) => void
|
1046
|
+
fail?: (params: {
|
1047
|
+
errorMsg: string
|
1048
|
+
errorCode: string | number
|
1049
|
+
innerError: {
|
1050
|
+
errorCode: string | number
|
1051
|
+
errorMsg: string
|
1052
|
+
}
|
1053
|
+
}) => void
|
1054
|
+
complete?: () => void
|
1055
|
+
}): void
|
1056
|
+
|
1057
|
+
/**
|
1058
|
+
*@description 读取 Category类型的数据[iOS only]
|
1059
|
+
*需要参数为type,startTime,endTime
|
1060
|
+
*@error {1: 'AppleHealthParamsError'}*/
|
1061
|
+
export function readCategoryDataWithTypeSync(paramModel?: ParamModel): {
|
1062
|
+
/**
|
1063
|
+
* 读取到的数据,是一个数组,数组中每一项是一个字典,具体定义如下
|
1064
|
+
* value: Integer 读取到的值,不同的含义参考苹果官方文档
|
1065
|
+
* startDate: Double 读取到的条目的起始时间戳
|
1066
|
+
* endDate: Double 读取到的条目的截止时间戳
|
1067
|
+
*/
|
1068
|
+
value: Object[]
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
export type RecordParams = {
|
1072
|
+
/** RecordData数据列表的json array字符串 */
|
1073
|
+
request: string
|
1074
|
+
}
|
1075
|
+
|
1076
|
+
export type ParamModel = {
|
1077
|
+
/**
|
1078
|
+
* 权限类型(申请读写权限的接口使用),具体枚举值查看下文的枚举列表
|
1079
|
+
* eg. ["1","2"]
|
1080
|
+
*/
|
1081
|
+
permissions?: string[]
|
1082
|
+
/**
|
1083
|
+
* 读取权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
1084
|
+
* eg. ["1","2"]
|
1085
|
+
*/
|
1086
|
+
readPermissions?: string[]
|
1087
|
+
/**
|
1088
|
+
* 写入权限类型(查询用户是否已经做过授权操作的接口使用),具体枚举值查看下文的枚举列表
|
1089
|
+
* eg. ["1","2"]
|
1090
|
+
*/
|
1091
|
+
writePermissions?: string[]
|
1092
|
+
/** 写入权限类型(查询是否有写权限的接口使用),具体枚举值查看下文的枚举列表 */
|
1093
|
+
writePermission?: number
|
1094
|
+
/** 写入值 */
|
1095
|
+
value?: number
|
1096
|
+
/**
|
1097
|
+
* 传入单位 比如"mg/dL","g","cm","count",查询和写入Quantity类型数据时需要
|
1098
|
+
* 数据类型对应单位可参考苹果官方的HKTypeIdentifiers.h文件
|
1099
|
+
*/
|
1100
|
+
unitType?: string
|
1101
|
+
/** 开始时间,秒级时间戳 */
|
1102
|
+
startTime?: number
|
1103
|
+
/** 结束时间,秒级时间戳 */
|
1104
|
+
endTime?: number
|
1105
|
+
/** 需要读写的数据类型(读写数据的接口使用),具体枚举值查看下文的枚举列表 */
|
1106
|
+
type?: number
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
export type BloodPressureParams = {
|
1110
|
+
/** 收缩压 */
|
1111
|
+
systolic: number
|
1112
|
+
/** 舒张压 */
|
1113
|
+
diastolic: number
|
1114
|
+
/** 开始时间,秒级时间戳 */
|
1115
|
+
startTime: number
|
1116
|
+
/** 结束时间,秒级时间戳 */
|
1117
|
+
endTime: number
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
export type Object = {}
|
1121
|
+
}
|