@tarojs/taro 3.6.22 → 3.6.23

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.
Files changed (63) hide show
  1. package/package.json +8 -4
  2. package/types/api/base/debug.d.ts +8 -8
  3. package/types/api/base/env.d.ts +1 -1
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/system.d.ts +6 -6
  6. package/types/api/base/weapp/app-event.d.ts +10 -10
  7. package/types/api/base/weapp/life-cycle.d.ts +1 -1
  8. package/types/api/canvas/index.d.ts +367 -63
  9. package/types/api/device/battery.d.ts +1 -1
  10. package/types/api/device/clipboard.d.ts +2 -2
  11. package/types/api/device/keyboard.d.ts +1 -1
  12. package/types/api/device/network.d.ts +3 -3
  13. package/types/api/device/phone.d.ts +1 -1
  14. package/types/api/device/screen.d.ts +2 -2
  15. package/types/api/files/index.d.ts +7 -7
  16. package/types/api/framework/index.d.ts +2 -2
  17. package/types/api/location/index.d.ts +4 -4
  18. package/types/api/media/audio.d.ts +11 -11
  19. package/types/api/media/background-audio.d.ts +1 -1
  20. package/types/api/media/image.d.ts +5 -5
  21. package/types/api/media/video.d.ts +11 -11
  22. package/types/api/navigate/index.d.ts +1 -1
  23. package/types/api/network/download.d.ts +5 -5
  24. package/types/api/network/request.d.ts +7 -7
  25. package/types/api/network/upload.d.ts +7 -7
  26. package/types/api/network/websocket.d.ts +8 -8
  27. package/types/api/open-api/account.d.ts +1 -1
  28. package/types/api/open-api/address.d.ts +13 -5
  29. package/types/api/open-api/authorize.d.ts +1 -1
  30. package/types/api/open-api/bookshelf.d.ts +307 -0
  31. package/types/api/open-api/channels.d.ts +16 -0
  32. package/types/api/open-api/device-voip.d.ts +40 -0
  33. package/types/api/open-api/invoice.d.ts +1 -1
  34. package/types/api/open-api/login.d.ts +15 -2
  35. package/types/api/open-api/privacy.d.ts +8 -0
  36. package/types/api/open-api/settings.d.ts +3 -2
  37. package/types/api/open-api/sticker.d.ts +83 -0
  38. package/types/api/open-api/subscribe-message.d.ts +148 -6
  39. package/types/api/open-api/user-info.d.ts +6 -1
  40. package/types/api/qq/index.d.ts +306 -1
  41. package/types/api/route/index.d.ts +5 -5
  42. package/types/api/storage/index.d.ts +10 -10
  43. package/types/api/swan/download-package.d.ts +80 -0
  44. package/types/api/swan/index.d.ts +151 -0
  45. package/types/api/swan/pay.d.ts +139 -0
  46. package/types/api/taro.extend.d.ts +2 -1
  47. package/types/api/taro.hooks.d.ts +9 -9
  48. package/types/api/ui/animation.d.ts +32 -32
  49. package/types/api/ui/custom-component.d.ts +1 -1
  50. package/types/api/ui/fonts.d.ts +1 -1
  51. package/types/api/ui/interaction.d.ts +6 -6
  52. package/types/api/ui/menu.d.ts +1 -1
  53. package/types/api/ui/navigation-bar.d.ts +2 -2
  54. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  55. package/types/api/ui/scroll.d.ts +1 -1
  56. package/types/api/ui/tab-bar.d.ts +8 -8
  57. package/types/api/ui/window.d.ts +2 -2
  58. package/types/api/wxml/index.d.ts +17 -17
  59. package/types/global.d.ts +2 -1
  60. package/types/index.d.ts +89 -43
  61. package/types/taro.api.d.ts +22 -14
  62. package/types/taro.config.d.ts +6 -2
  63. package/types/taro.runtime.d.ts +9 -0
@@ -0,0 +1,83 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace openStickerSetView {
5
+ interface Option {
6
+ /** 表情专辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/cgi-bin/mmemoticonwebnode-bin/pages/home),在详情页中的「小程序跳转链接」入口复制 */
7
+ url: Object
8
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
9
+ complete?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 接口调用失败的回调函数 */
11
+ fail?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用成功的回调函数 */
13
+ success?: (res: TaroGeneral.CallbackResult) => void
14
+ }
15
+ }
16
+
17
+ namespace openStickerIPView {
18
+ interface Option {
19
+ /** 表情IP合辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/cgi-bin/mmemoticonwebnode-bin/pages/home),在详情页中的「小程序跳转链接」入口复制 */
20
+ url: Object
21
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
22
+ complete?: (res: TaroGeneral.CallbackResult) => void
23
+ /** 接口调用失败的回调函数 */
24
+ fail?: (res: TaroGeneral.CallbackResult) => void
25
+ /** 接口调用成功的回调函数 */
26
+ success?: (res: TaroGeneral.CallbackResult) => void
27
+ }
28
+ }
29
+
30
+ namespace openSingleStickerView {
31
+ interface Option {
32
+ /** 表情链接,可前往(表情开放平台)[https://sticker.weixin.qq.com/cgi-bin/mmemoticonwebnode-bin/pages/home],在详情页中的「小程序跳转链接」入口复制 */
33
+ url: Object
34
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
35
+ complete?: (res: TaroGeneral.CallbackResult) => void
36
+ /** 接口调用失败的回调函数 */
37
+ fail?: (res: TaroGeneral.CallbackResult) => void
38
+ /** 接口调用成功的回调函数 */
39
+ success?: (res: TaroGeneral.CallbackResult) => void
40
+ }
41
+ }
42
+
43
+ interface TaroStatic {
44
+ /** 打开表情专辑
45
+ * @supported weapp
46
+ * @example
47
+ * ```tsx
48
+ * Taro.openStickerSetView({
49
+ * url: '',
50
+ * success(res) {}
51
+ * })
52
+ * ```
53
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openStickerSetView.html
54
+ */
55
+ openStickerSetView(option: openStickerSetView.Option): void
56
+
57
+ /** 打开表情IP合辑
58
+ * @supported weapp
59
+ * @example
60
+ * ```tsx
61
+ * Taro.openStickerIPView({
62
+ * url: '',
63
+ * success(res) {}
64
+ * })
65
+ * ```
66
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openStickerIPView.html
67
+ */
68
+ openStickerIPView(option: openStickerIPView.Option): void
69
+
70
+ /** 打开单个表情
71
+ * @supported weapp
72
+ * @example
73
+ * ```tsx
74
+ * Taro.openSingleStickerView({
75
+ * url: '',
76
+ * success(res) {}
77
+ * })
78
+ * ```
79
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openSingleStickerView.html
80
+ */
81
+ openSingleStickerView(option: openSingleStickerView.Option): void
82
+ }
83
+ }
@@ -3,8 +3,19 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  namespace requestSubscribeMessage {
5
5
  interface Option {
6
- /** 需要订阅的消息模板的id的集合(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置 */
6
+ /**
7
+ * 需要订阅的消息模板的id的集合(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置
8
+ * @supported weapp, tt
9
+ */
7
10
  tmplIds: string[]
11
+ /** 需要订阅的消息模板 id 集合(注意:1、一次性模板 id 和长期性模板 id 不可同时使用,2、一次最多传入三个模板 id
12
+ * @supported alipay
13
+ */
14
+ entityIds: string[]
15
+ /** 模板小程序 appId,仅在服务商代调用场景下需要传入
16
+ * @supported alipay
17
+ */
18
+ thirdTypeAppId?: string
8
19
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
9
20
  complete?: (res: TaroGeneral.CallbackResult) => void
10
21
  /** 接口调用失败的回调函数 */
@@ -37,20 +48,90 @@ declare module '../../index' {
37
48
  * @type "accept" | "reject" | "ban"
38
49
  */
39
50
  [TEMPLATE_ID: string]: keyof TemplateReflex | string
51
+ /** 用户订阅操作结果。
52
+ *
53
+ * | 枚举值 | 描述 |
54
+ * | --- | ---- |
55
+ * | subscribe | 订阅成功 |
56
+ *
57
+ * @supported alipay
58
+ */
59
+ behavior?: string
60
+ /** 一次性订阅,是否勾选 总是保持以上选择,不再询问。
61
+ *
62
+ * | 枚举值 | 描述 |
63
+ * | --- | ---- |
64
+ * | true | 勾选 |
65
+ * | false | 未勾选 |
66
+ *
67
+ * @supported alipay
68
+ */
69
+ keep?: boolean
70
+ /** 长期性订阅,是否点击 拒绝,不再询问。
71
+ *
72
+ * | 枚举值 | 描述 |
73
+ * | --- | ---- |
74
+ * | true | 点击 |
75
+ * | false | 未点击 |
76
+ *
77
+ * @supported alipay
78
+ */
79
+ refuse?: boolean
80
+ /** 订阅数据
81
+ * @supported alipay
82
+ */
83
+ result?: ISubscribeResult
84
+ /** 本次订阅过程是否弹出了订阅面板。
85
+ *
86
+ * | 枚举值 | 描述 |
87
+ * | --- | ---- |
88
+ * | true | 弹出 |
89
+ * | false | 未弹出 |
90
+ *
91
+ * @supported alipay
92
+ */
93
+ show?: boolean
40
94
  /** 接口调用成功时errMsg值为'requestSubscribeMessage:ok' */
41
95
  errMsg: string
42
96
  }
43
97
 
98
+ interface ISubscribeResult {
99
+ /** 订阅成功的模板列表 */
100
+ subscribeEntityIds: string[]
101
+ /** 最终订阅成功的模板列表 */
102
+ subscribedEntityIds: string[]
103
+ /** 未订阅的模板列表 */
104
+ unsubscribedEntityIds: string[]
105
+ /** 本次新增订阅成功的模板列表 */
106
+ currentSubscribedEntityIds: string[]
107
+ }
108
+
44
109
  /** 模版消息订阅类型 */
45
110
  interface TemplateReflex {
46
- /** 表示用户同意订阅该条id对应的模板消息 */
111
+ /**
112
+ * 表示用户同意订阅该条id对应的模板消息
113
+ * @supported weapp, alipay, tt
114
+ */
47
115
  accept
48
- /** 表示用户拒绝订阅该条id对应的模板消息 */
116
+ /**
117
+ * 表示用户拒绝订阅该条id对应的模板消息
118
+ * @supported weapp, alipay, tt
119
+ */
49
120
  reject
50
- /** 表示已被后台封禁 */
121
+ /**
122
+ * 表示已被后台封禁
123
+ * @supported weapp, tt
124
+ */
51
125
  ban
52
- /** 表示该模板因为模板标题同名被后台过滤 */
126
+ /**
127
+ * 表示该模板因为模板标题同名被后台过滤
128
+ * @supported weapp
129
+ */
53
130
  filter
131
+ /** 表示该条 id 对应的模版消息授权失败
132
+ * @supported tt
133
+ */
134
+ fail
54
135
  }
55
136
  }
56
137
 
@@ -114,6 +195,19 @@ declare module '../../index' {
114
195
  }
115
196
  }
116
197
 
198
+ namespace unsubscribeMessage {
199
+ interface Option {
200
+ /** 需要取消订阅的消息模板 id 集合(注意:1、一次性模板 id 和长期性模板 id 不可同时使用,2、一次最多传入三个模板 id)。 */
201
+ entityIds: string[]
202
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
203
+ complete?: (res: TaroGeneral.CallbackResult) => void
204
+ /** 接口调用失败的回调函数 */
205
+ fail?: (res: TaroGeneral.CallbackResult) => void
206
+ /** 接口调用成功的回调函数 */
207
+ success?: (res: TaroGeneral.CallbackResult) => void
208
+ }
209
+ }
210
+
117
211
  interface TaroStatic {
118
212
  /** 请求订阅消息
119
213
  *
@@ -133,7 +227,7 @@ declare module '../../index' {
133
227
  ): Promise<requestSubscribeMessage.SuccessCallbackResult | requestSubscribeMessage.FailCallbackResult>
134
228
 
135
229
  /** 订阅设备消息接口,调用后弹出授权框,用户同意后会允许开发者给用户发送订阅模版消息。当用户点击“允许”按钮时,模板消息会被添加到用户的小程序设置页,通过 wx.getSetting 接口可获取用户对相关模板消息的订阅状态。
136
- * @supported weapp, tt
230
+ * @supported weapp
137
231
  * @example
138
232
  * ```tsx
139
233
  * Taro.requestSubscribeDeviceMessage({
@@ -154,5 +248,53 @@ declare module '../../index' {
154
248
  requestSubscribeDeviceMessage(
155
249
  option: requestSubscribeDeviceMessage.Option
156
250
  ): Promise<requestSubscribeDeviceMessage.SuccessCallbackResult | requestSubscribeDeviceMessage.FailCallbackResult>
251
+
252
+ /** 取消当前用户已订阅的消息
253
+ * @supported alipay
254
+ * @example
255
+ * ```tsx
256
+ * Taro.unsubscribeMessage({
257
+ * entityIds: [
258
+ * 'ac768fca1ce245ccae9404bb5243c49b',
259
+ * '9aa357acb7c6434aba294aded1cdfb7c',
260
+ * ],
261
+ * success(res) {
262
+ * console.log(res);
263
+ * },
264
+ * fail(err) {
265
+ * console.log(err);
266
+ * }
267
+ * })
268
+ * ```
269
+ * @see https://opendocs.alipay.com/mini/07vg26?pathHash=8c9630ac
270
+ */
271
+ unsubscribeMessage(option: unsubscribeMessage.Option): void
272
+
273
+ /** 小程序消息订阅服务,包括取消订阅和查询订阅;订阅操作详见 [form 表单](https://smartprogram.baidu.com/docs/develop/component/formlist_form/)。
274
+ * @supported swan
275
+ * @example
276
+ * ```tsx
277
+ * Taro.subscribeService({
278
+ * templateId: 'BD0003',
279
+ * subscribeId: '8026',
280
+ * type: 'query',
281
+ * success(res) {
282
+ * Taro.showModal({
283
+ * title: 'success',
284
+ * content: JSON.stringify(res)
285
+ * })
286
+ * },
287
+ * fail(err) {
288
+ * Taro.showModal({
289
+ * title: 'fail',
290
+ * content: JSON.stringify(err)
291
+ * })
292
+ * }
293
+ * })
294
+ * ```
295
+ * @see https://smartprogram.baidu.com/docs/develop/api/open/swan-subscribeService/
296
+ */
297
+ subscribeService(option: subscribeService.Option): void
298
+
157
299
  }
158
300
  }
@@ -39,6 +39,11 @@ declare module '../../index' {
39
39
  lang?: keyof UserInfo.Language
40
40
  /** 声明获取用户个人信息后的用途,不超过30个字符 */
41
41
  desc: string
42
+ /** 当宿主未登录时,是否强制拉起登录框
43
+ * @supported tt
44
+ * @default false
45
+ */
46
+ force?: boolean
42
47
  /** 接口调用成功的回调函数 */
43
48
  success?: (result: SuccessCallbackResult) => void
44
49
  /** 接口调用失败的回调函数 */
@@ -102,7 +107,7 @@ declare module '../../index' {
102
107
  *
103
108
  * **接口调整说明**
104
109
  * 在用户未授权过的情况下调用此接口,将不再出现授权弹窗,会直接进入 fail 回调(详见[《公告》](https://developers.weixin.qq.com/community/develop/doc/0000a26e1aca6012e896a517556c01))。在用户已授权的情况下调用此接口,可成功获取用户信息。
105
- * @supported weapp, tt
110
+ * @supported weapp, jd, qq, tt, harmony_hybrid
106
111
  * @example
107
112
  * ```tsx
108
113
  * // 必须是在用户已经授权的情况下调用
@@ -21,9 +21,148 @@ declare module '../../index' {
21
21
  type MediaType = 'photo' | 'video'
22
22
  }
23
23
 
24
+ namespace getQQRunData {
25
+ interface Option {
26
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
27
+ complete?: (res: TaroGeneral.CallbackResult) => void
28
+ /** 接口调用失败的回调函数 */
29
+ fail?: (res: TaroGeneral.CallbackResult) => void
30
+ /** 接口调用成功的回调函数 */
31
+ success?: (result: SuccessCallbackResult) => void
32
+ }
33
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
34
+ /**
35
+ * 包括敏感数据在内的完整用户信息的加密数据,详细见加密数据解密算法。
36
+ */
37
+ encryptedData: string
38
+ /**
39
+ * 加密算法的初始向量,详细见加密数据解密算法
40
+ */
41
+ iv: string
42
+ }
43
+ }
44
+
45
+ namespace setOfficialDress {
46
+ interface Option {
47
+ /** 方法名,设置头像填"setAvatar",其他方法后续开放 */
48
+ action: string
49
+ /** openid,给自己设置头像填"self" */
50
+ uin: string
51
+ /** 物品id */
52
+ item_id?: string
53
+ /** 设置头像"setAvatar"此处不用填 */
54
+ busi_info?: string
55
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
56
+ complete?: (res: TaroGeneral.CallbackResult) => void
57
+ /** 接口调用失败的回调函数 */
58
+ fail?: (res: TaroGeneral.CallbackResult) => void
59
+ /** 接口调用成功的回调函数 */
60
+ success?: (res: TaroGeneral.CallbackResult) => void
61
+ }
62
+ }
63
+
64
+ namespace setCustomDress {
65
+ interface Option {
66
+ /** 方法名,设置头像填"uploadAvatar",其他方法后续开放 */
67
+ action: string
68
+ /** 素材路径,必须为本地文件,路径为 wxfile:// 的形式 */
69
+ path: string
70
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
71
+ complete?: (res: TaroGeneral.CallbackResult) => void
72
+ /** 接口调用失败的回调函数 */
73
+ fail?: (res: TaroGeneral.CallbackResult) => void
74
+ /** 接口调用成功的回调函数 */
75
+ success?: (res: TaroGeneral.CallbackResult) => void
76
+ }
77
+ }
78
+
79
+ namespace updateQQApp {
80
+ interface Option {
81
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
82
+ complete?: (res: TaroGeneral.CallbackResult) => void
83
+ /** 接口调用失败的回调函数 */
84
+ fail?: (res: TaroGeneral.CallbackResult) => void
85
+ /** 接口调用成功的回调函数 */
86
+ success?: (res: TaroGeneral.CallbackResult) => void
87
+ }
88
+ }
89
+
90
+ namespace addRecentColorSign {
91
+ interface Option {
92
+ /**
93
+ * 做为点击最近彩签打开的小程序页面的启动参数,如 a=1&b=2
94
+ * 默认值:当前页面的查询参数
95
+ */
96
+ query?: string
97
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
98
+ complete?: (res: TaroGeneral.CallbackResult) => void
99
+ /** 接口调用失败的回调函数 */
100
+ fail?: (res: TaroGeneral.CallbackResult) => void
101
+ /** 接口调用成功的回调函数 */
102
+ success?: (res: TaroGeneral.CallbackResult) => void
103
+ }
104
+ }
105
+
106
+ namespace getGuildInfo {
107
+ interface Option {
108
+ /** 频道id */
109
+ open_guild_id: string
110
+ /** 子频道Id */
111
+ channel_id?: string
112
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
113
+ complete?: (res: TaroGeneral.CallbackResult) => void
114
+ /** 接口调用失败的回调函数 */
115
+ fail?: (res: TaroGeneral.CallbackResult) => void
116
+ /** 接口调用成功的回调函数 */
117
+ success?: (res: SuccessCallbackResult) => void
118
+ }
119
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
120
+ /** 加密之后的数据,需要解密 */
121
+ encryptedData: string
122
+ /** 对称解密算法初始向量(base64) */
123
+ iv: string
124
+ /** 签名(base64) */
125
+ signature: string
126
+ }
127
+ }
128
+
129
+ namespace applyAddToMyApps {
130
+ interface Option {
131
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
132
+ complete?: (res: TaroGeneral.CallbackResult) => void
133
+ /** 接口调用失败的回调函数 */
134
+ fail?: (res: TaroGeneral.CallbackResult) => void
135
+ /** 接口调用成功的回调函数 */
136
+ success?: (res: SuccessCallbackResult) => void
137
+ }
138
+ interface SuccessCallbackResult {
139
+ /** true 代表用户选择了同意 */
140
+ confirm: boolean
141
+ /** true 代表用户选择了不同意 */
142
+ cancel: boolean
143
+ }
144
+ }
145
+
146
+ namespace isAddedToMyApps {
147
+ interface Option {
148
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
149
+ complete?: (res: TaroGeneral.CallbackResult) => void
150
+ /** 接口调用失败的回调函数 */
151
+ fail?: (res: TaroGeneral.CallbackResult) => void
152
+ /** 接口调用成功的回调函数 */
153
+ success?: (res: SuccessCallbackResult) => void
154
+ }
155
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
156
+ /** true 代表用户已经添加,false 则还没添加 */
157
+ isAdded: boolean
158
+ }
159
+ }
160
+
24
161
  interface TaroStatic {
25
162
  /**
26
163
  * 此接口可打开手Q说说发表界面,并将文字内容和图片/视频内容传递到手Q说说发表界面。
164
+ * @supported qq
165
+ * @example
27
166
  * ```tsx
28
167
  * Taro.openQzonePublish({
29
168
  * footnote: '使用同款滤镜',
@@ -41,9 +180,175 @@ declare module '../../index' {
41
180
  * ]
42
181
  * })
43
182
  * ```
44
- * @supported qq
45
183
  * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_openQzonePublish.html
46
184
  */
47
185
  openQzonePublish(option: openQzonePublish.Option): void
186
+ /**
187
+ * 获取用户过去三十天QQ运动步数。需要先调用 qq.login 接口。步数信息会在用户主动进入小程序时更新。
188
+ * @supported qq
189
+ * @example
190
+ * ```tsx
191
+ * Taro.getQQRunData({
192
+ * success(res) {
193
+ * // 拿 encryptedData 到开发者后台解密开放数据
194
+ * const encryptedData = res.encryptedData
195
+ * }
196
+ * })
197
+ * ```
198
+ *
199
+ * **开放数据 JSON 结构**
200
+ * 敏感数据有两种获取方式,一是使用 加密数据解密算法 。 获取得到的开放数据为以下 json 结构:
201
+ *
202
+ * ```json
203
+ * {
204
+ * "stepInfoList": [
205
+ * {
206
+ * "timestamp": 1445866601,
207
+ * "step": 100
208
+ * },
209
+ * {
210
+ * "timestamp": 1445876601,
211
+ * "step": 120
212
+ * }
213
+ * ]
214
+ * }
215
+ * ```
216
+ * * stepInfoList 中,每一项结构如下:
217
+ *
218
+ * | 属性 | 类型 | 说明 |
219
+ * | --- | ---- | --- |
220
+ * | timestamp | number | 时间戳,表示数据对应的时间 |
221
+ * | step | number | QQ运动步数 |
222
+ *
223
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_sport.html
224
+ */
225
+ getQQRunData(option: getQQRunData.Option): void
226
+ /**
227
+ * QQ美化平台内测阶段,仅被邀请的商户可使用此接口。
228
+ * @supported qq
229
+ * @example
230
+ * ```tsx
231
+ * Taro.setOfficialDress({
232
+ * action: "setAvatar",
233
+ * uin: "self",
234
+ * item_id: "2740",
235
+ * success(res) {
236
+ * console.log("success"+res);
237
+ * },
238
+ * fail(res) {
239
+ * console.log("fail"+res);
240
+ * }
241
+ * })
242
+ * ```
243
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/personalize.html#qq-setofficialdress
244
+ */
245
+ setOfficialDress(option: setOfficialDress.Option): void
246
+ /**
247
+ * QQ美化平台内测阶段,仅被邀请的商户可使用此接口。
248
+ * @supported qq
249
+ * @example
250
+ * ```tsx
251
+ * Taro.setCustomDress({
252
+ * action: "uploadAvatar",
253
+ * path:"wxfile://images/1.png"
254
+ * success(res) {
255
+ * console.log("success"+res);
256
+ * },
257
+ * fail(res) {
258
+ * console.log("fail"+res);
259
+ * }
260
+ * })
261
+ * ```
262
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/personalize.html#qq-setcustomdress
263
+ */
264
+ setCustomDress(option: setCustomDress.Option): void
265
+ /**
266
+ * 更新 QQ 版本
267
+ * @supported qq
268
+ * @example
269
+ * ```tsx
270
+ * Taro.updateQQApp({
271
+ * success: function(res) {
272
+ * console.log('updateQQApp success',res)
273
+ * },
274
+ * fail: function(err) {
275
+ * console.log('updateQQApp fail',err)
276
+ * },
277
+ * complete: function(res) {
278
+ * console.log('updateQQApp info',res)
279
+ * }
280
+ * })
281
+ * ```
282
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_updateQQ.html#qq-updateqqapp
283
+ */
284
+ updateQQApp(option: updateQQApp.Option): void
285
+ /**
286
+ * 添加当前小程序页面到最近浏览彩签,需要授权基础库 1.20.0 开始支持。
287
+ * 提示:在手 Q 8.9.0 前的版本,当系统未授予手 Q 悬浮穿权限时,每次调用该接口都会弹出系统授权窗口。自手 Q 8.9.0 起交互调整如下:
288
+ * 1. 系统没有授予手 Q 悬浮窗权限时,接口执行 fail 回调函数并附带 ”No floating window permission“的错误信息,开发者可针对此信息在业务代码里弹窗提示用户手动授予手 Q 悬浮窗权限。
289
+ * 2. 安卓系统部分机型存在获取悬浮窗权限不准确情况。
290
+ * @supported qq
291
+ * @example
292
+ * ```tsx
293
+ * Taro.addRecentColorSign({
294
+ * query: 'a=1&b=2',
295
+ * success(res) {
296
+ * console.log('addRecentColorSign success: ', res)
297
+ * },
298
+ * fail(err) {
299
+ * console.log('addRecentColorSign fail: ', err)
300
+ * },
301
+ * complete(res) {
302
+ * console.log('addRecentColorSign complete: ', res)
303
+ * }
304
+ * })
305
+ * ```
306
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_addColorSign.html#qq-addrecentcolorsign
307
+ */
308
+ addRecentColorSign(option: addRecentColorSign.Option): void
309
+ /**
310
+ * 获取频道信息与当前人身份(FOR 机器人服务入口)
311
+ * @supported qq
312
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_guild.html
313
+ */
314
+ getGuildInfo(option: getGuildInfo.Option): void
315
+ /**
316
+ * 申请用户将本小程序添加到下拉页面中“我的小程序”当中,手Q8.9.13及以上版本支持
317
+ * @supported qq
318
+ * @example
319
+ * ```tsx
320
+ * Taro.applyAddToMyApps({
321
+ * success(res) {
322
+ * if (res.confirm) {
323
+ * // 用户同意添加
324
+ * }
325
+ * if (res.cancel) {
326
+ * // 用户不同意添加
327
+ * }
328
+ * // 原则上,confirm和cancel是互斥的
329
+ * }
330
+ * })
331
+ * ```
332
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_addToMyApps.html#qq-applyaddtomyapps
333
+ */
334
+ applyAddToMyApps(option: applyAddToMyApps.Option): void
335
+ /**
336
+ * 查询用户是否已经将本小程序添加到下拉页面中“我的小程序”当中,手Q8.9.13及以上版本支持,建议使用qq.applyAddToMyApps之前先调用qq.isAddedToMyApps来作前置判断
337
+ * @supported qq
338
+ * @example
339
+ * ```tsx
340
+ * Taro.isAddedToMyApps({
341
+ * success(res) {
342
+ * if (res.isAdded) {
343
+ * // 用户已经添加
344
+ * } else {
345
+ * // 用户还未添加
346
+ * }
347
+ * }
348
+ * })
349
+ * ```
350
+ * @see https://q.qq.com/wiki/develop/miniprogram/API/open_port/port_addToMyApps.html#qq-isaddedtomyapps
351
+ */
352
+ isAddedToMyApps(option: isAddedToMyApps.Option): void
48
353
  }
49
354
  }
@@ -117,7 +117,7 @@ declare module '../../index' {
117
117
 
118
118
  interface TaroStatic {
119
119
  /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
120
- * @supported weapp, h5, rn, tt
120
+ * @supported weapp, h5, rn, tt, harmony_hybrid
121
121
  * @example
122
122
  * ```json
123
123
  * {
@@ -143,7 +143,7 @@ declare module '../../index' {
143
143
  switchTab(option: switchTab.Option): Promise<TaroGeneral.CallbackResult>
144
144
 
145
145
  /** 关闭所有页面,打开到应用内的某个页面
146
- * @supported weapp, h5, rn, tt
146
+ * @supported weapp, h5, rn, tt, harmony_hybrid
147
147
  * @example
148
148
  * ```tsx
149
149
  * Taro.reLaunch({
@@ -155,7 +155,7 @@ declare module '../../index' {
155
155
  reLaunch(option: reLaunch.Option): Promise<TaroGeneral.CallbackResult>
156
156
 
157
157
  /** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
158
- * @supported weapp, h5, rn, tt
158
+ * @supported weapp, h5, rn, tt, harmony_hybrid
159
159
  * @h5 未针对 tabbar 页面做限制处理
160
160
  * @example
161
161
  * ```tsx
@@ -168,7 +168,7 @@ declare module '../../index' {
168
168
  redirectTo(option: redirectTo.Option): Promise<TaroGeneral.CallbackResult>
169
169
 
170
170
  /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
171
- * @supported weapp, h5, rn, tt
171
+ * @supported weapp, h5, rn, tt, harmony_hybrid
172
172
  * @h5 未针对 tabbar 页面做限制处理
173
173
  * @example
174
174
  * ```tsx
@@ -195,7 +195,7 @@ declare module '../../index' {
195
195
  navigateTo(option: navigateTo.Option): Promise<TaroGeneral.CallbackResult>
196
196
 
197
197
  /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。
198
- * @supported weapp, h5, rn, tt
198
+ * @supported weapp, h5, rn, tt, harmony_hybrid
199
199
  * @h5 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。
200
200
  * @example
201
201
  * ```tsx