@ray-js/api 1.7.80 → 1.7.82

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.
@@ -1,100 +1,324 @@
1
1
  /**
2
2
  * ThirdAuthKit
3
3
  *
4
- * @version 1.0.1
4
+ * @version 1.0.15
5
5
  */
6
6
  declare namespace ty.thirdauth {
7
7
  /**
8
- *@description QQ音乐授权
9
- *注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法*/
8
+ * QQ音乐授权
9
+ * @description.en QQ Music authorization.
10
+ * @public
11
+ * @since WearKit 1.0.0
12
+ * @remarks 注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法
13
+ * @remarksEn Note: Deprecated since WearKit 2.1.0, use the same method in ThirdAuthKit.
14
+ * @example 基础用法
15
+ * ```tsx
16
+ * ty.wear.qqMusicAuth({
17
+ * type: 0,
18
+ * success: data => {
19
+ * console.log(data);
20
+ * },
21
+ * fail: error => {
22
+ * console.error(error);
23
+ * },
24
+ * });
25
+ * ```
26
+ * @see https://developer.tuya.com/
27
+ * @platform iOS Android
28
+ * @error {10001} 参数错误
29
+ * @error {10002} 授权失败
30
+ * @error {10003} 解密失败
31
+ * @error {10004} JSON解析错误
32
+ * @error {10005} 签名校验失败
33
+ * @error {10006} 不支持的授权类型
34
+ */
10
35
  export function qqMusicAuth(params: {
11
- /** 三方服务列表 ThirdPartyType */
36
+ /**
37
+ * 第三方服务类型,参见 ThirdPartyType 枚举
38
+ * @since ThirdAuthKit 1.0.0
39
+ */
12
40
  type: number
41
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
42
+ complete?: () => void
43
+ /** 接口调用成功的回调函数 */
13
44
  success?: (params: {
14
- /** 过期时间 */
45
+ /**
46
+ * 过期时间(Unix 时间戳,单位:秒)
47
+ * @since ThirdAuthKit 1.0.0
48
+ */
15
49
  expireTime: number
16
- /** openId */
50
+ /**
51
+ * QQ音乐账户 openId
52
+ * @since ThirdAuthKit 1.0.0
53
+ */
17
54
  openId: string
18
- /** openToken */
55
+ /**
56
+ * QQ音乐访问令牌
57
+ * @since ThirdAuthKit 1.0.0
58
+ */
19
59
  openToken: string
20
60
  }) => void
61
+ /** 接口调用失败的回调函数 */
21
62
  fail?: (params: {
63
+ /** 错误信息 */
22
64
  errorMsg: string
65
+ /** 错误码 */
23
66
  errorCode: string | number
67
+ /** 错误扩展 */
24
68
  innerError: {
69
+ /** 错误扩展码 */
25
70
  errorCode: string | number
71
+ /** 错误扩展信息 */
26
72
  errorMsg: string
27
73
  }
28
74
  }) => void
29
- complete?: () => void
30
75
  }): void
31
76
 
32
77
  /**
33
- *@description 获取QQ音乐QQ小程序授权参数
34
- *注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法*/
78
+ * 获取QQ音乐QQ小程序授权参数
79
+ * @description.en Get QQ Music QQ Mini Program authorization parameters.
80
+ * @public
81
+ * @since WearKit 1.0.0
82
+ * @remarks 注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法
83
+ * @remarksEn Note: Deprecated since WearKit 2.1.0, use the same method in ThirdAuthKit.
84
+ * @example 基础用法
85
+ * ```tsx
86
+ * ty.wear.getQQMusicQQMiniProgramAuthParams({
87
+ * success: data => {
88
+ * console.log(data);
89
+ * },
90
+ * fail: error => {
91
+ * console.error(error);
92
+ * },
93
+ * });
94
+ * ```
95
+ * @see https://developer.tuya.com/
96
+ * @platform iOS Android
97
+ */
35
98
  export function getQQMusicQQMiniProgramAuthParams(params?: {
99
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
100
+ complete?: () => void
101
+ /** 接口调用成功的回调函数 */
36
102
  success?: (params: {
37
- /** qq音乐appkey */
103
+ /**
104
+ * QQ音乐 AppKey
105
+ * @since ThirdAuthKit 1.0.0
106
+ */
38
107
  qqMusicAppKey: string
39
- /** 签名字符串 */
108
+ /**
109
+ * 加密的签名字符串
110
+ * @since ThirdAuthKit 1.0.0
111
+ */
40
112
  encryptString: string
41
113
  }) => void
114
+ /** 接口调用失败的回调函数 */
42
115
  fail?: (params: {
116
+ /** 错误信息 */
43
117
  errorMsg: string
118
+ /** 错误码 */
44
119
  errorCode: string | number
120
+ /** 错误扩展 */
45
121
  innerError: {
122
+ /** 错误扩展码 */
46
123
  errorCode: string | number
124
+ /** 错误扩展信息 */
47
125
  errorMsg: string
48
126
  }
49
127
  }) => void
50
- complete?: () => void
51
128
  }): void
52
129
 
53
130
  /**
54
- *@description 解析QQ音乐QQ小程序授权结果
55
- *注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法*/
131
+ * 解析QQ音乐QQ小程序授权结果
132
+ * @description.en Parse QQ Music QQ Mini Program authorization result.
133
+ * @public
134
+ * @since WearKit 1.0.0
135
+ * @remarks 注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法
136
+ * @remarksEn Note: Deprecated since WearKit 2.1.0, use the same method in ThirdAuthKit.
137
+ * @example 基础用法
138
+ * ```tsx
139
+ * ty.wear.parseQQMusicAuthResult({
140
+ * encryptString: "xx",
141
+ * success: data => {
142
+ * console.log(data);
143
+ * },
144
+ * fail: error => {
145
+ * console.error(error);
146
+ * },
147
+ * });
148
+ * ```
149
+ * @see https://developer.tuya.com/
150
+ * @platform iOS Android
151
+ * @error {10001} 参数错误
152
+ * @error {10004} JSON解析错误
153
+ * @error {10005} 签名校验失败
154
+ * @error {10007} 解密失败
155
+ */
56
156
  export function parseQQMusicAuthResult(params: {
57
- /** 授权结果 */
157
+ /**
158
+ * 加密的授权结果字符串
159
+ * @since ThirdAuthKit 1.0.0
160
+ */
58
161
  encryptString: string
162
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
163
+ complete?: () => void
164
+ /** 接口调用成功的回调函数 */
59
165
  success?: (params: {
60
- /** 过期时间 */
166
+ /**
167
+ * 过期时间(Unix 时间戳,单位:秒)
168
+ * @since ThirdAuthKit 1.0.0
169
+ */
61
170
  expireTime: number
62
- /** openId */
171
+ /**
172
+ * QQ音乐账户 openId
173
+ * @since ThirdAuthKit 1.0.0
174
+ */
63
175
  openId: string
64
- /** openToken */
176
+ /**
177
+ * QQ音乐访问令牌
178
+ * @since ThirdAuthKit 1.0.0
179
+ */
65
180
  openToken: string
66
181
  }) => void
182
+ /** 接口调用失败的回调函数 */
67
183
  fail?: (params: {
184
+ /** 错误信息 */
68
185
  errorMsg: string
186
+ /** 错误码 */
69
187
  errorCode: string | number
188
+ /** 错误扩展 */
70
189
  innerError: {
190
+ /** 错误扩展码 */
71
191
  errorCode: string | number
192
+ /** 错误扩展信息 */
72
193
  errorMsg: string
73
194
  }
74
195
  }) => void
75
- complete?: () => void
76
196
  }): void
77
197
 
78
198
  /**
79
- *@description 获取微信授权信息
80
- *注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法*/
199
+ * 监听微信授权代理事件
200
+ * @description.en Get WeChat authorization information.
201
+ * @public
202
+ * @since WearKit 1.0.0
203
+ * @remarks 注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法
204
+ * @remarksEn Note: Deprecated since WearKit 2.1.0, use the same method in ThirdAuthKit.
205
+ * @example 基础用法
206
+ * ```tsx
207
+ * ty.wear.onWechatAuthAgentEvent(e => {
208
+ * console.log(e);
209
+ * });
210
+ * ```
211
+ * @see https://developer.tuya.com/
212
+ * @platform iOS Android
213
+ */
81
214
  export function onWechatAuthAgentEvent(
82
215
  listener: (params: QQMusicAuthResult) => void
83
216
  ): void
84
217
 
85
218
  /**
86
- *@description 移除监听:获取微信授权信息
87
- *注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法*/
219
+ * 监听微信授权代理事件
220
+ * @description.en Get WeChat authorization information.
221
+ * @public
222
+ * @since WearKit 1.0.0
223
+ * @remarks 注意:WearKit(2.1.0)起下该方法已过时,请使用ThirdAuthKit下同名方法
224
+ * @remarksEn Note: Deprecated since WearKit 2.1.0, use the same method in ThirdAuthKit.
225
+ * @example 基础用法
226
+ * ```tsx
227
+ * ty.wear.onWechatAuthAgentEvent(e => {
228
+ * console.log(e);
229
+ * });
230
+ * ```
231
+ * @see https://developer.tuya.com/
232
+ * @platform iOS Android
233
+ */
88
234
  export function offWechatAuthAgentEvent(
89
235
  listener: (params: QQMusicAuthResult) => void
90
236
  ): void
91
237
 
92
- export type QQMusicAuthResult = {
93
- /** 过期时间 */
238
+ /**
239
+ * QQ音乐授权请求参数
240
+ * @since ThirdAuthKit 1.0.0
241
+ */
242
+ export interface QQMusicAuthParams {
243
+ /**
244
+ * 第三方服务类型,参见 ThirdPartyType 枚举
245
+ * @since ThirdAuthKit 1.0.0
246
+ */
247
+ type: number
248
+ }
249
+
250
+ /**
251
+ * QQ音乐授权结果
252
+ * @since ThirdAuthKit 1.0.0
253
+ */
254
+ export interface QQMusicAuthResult {
255
+ /**
256
+ * 过期时间(Unix 时间戳,单位:秒)
257
+ * @since ThirdAuthKit 1.0.0
258
+ */
94
259
  expireTime: number
95
- /** openId */
260
+ /**
261
+ * QQ音乐账户 openId
262
+ * @since ThirdAuthKit 1.0.0
263
+ */
96
264
  openId: string
97
- /** openToken */
265
+ /**
266
+ * QQ音乐访问令牌
267
+ * @since ThirdAuthKit 1.0.0
268
+ */
98
269
  openToken: string
99
270
  }
271
+
272
+ /**
273
+ * QQ音乐小程序授权参数
274
+ * @since ThirdAuthKit 1.0.0
275
+ */
276
+ export interface QQMusicQQMiniProgramAuthParams {
277
+ /**
278
+ * QQ音乐 AppKey
279
+ * @since ThirdAuthKit 1.0.0
280
+ */
281
+ qqMusicAppKey: string
282
+ /**
283
+ * 加密的签名字符串
284
+ * @since ThirdAuthKit 1.0.0
285
+ */
286
+ encryptString: string
287
+ }
288
+
289
+ /**
290
+ * QQ音乐授权结果解析参数
291
+ * @since ThirdAuthKit 1.0.0
292
+ */
293
+ export interface QQMusicAuthResultParseParam {
294
+ /**
295
+ * 加密的授权结果字符串
296
+ * @since ThirdAuthKit 1.0.0
297
+ */
298
+ encryptString: string
299
+ }
300
+
301
+ /**
302
+ * 第三方服务类型枚举
303
+ * @since ThirdAuthKit 1.0.0
304
+ */
305
+ export enum ThirdPartyType {
306
+ /**
307
+ * qq音乐
308
+ * @since ThirdAuthKit 1.0.0
309
+ */
310
+ QQMusic = 0,
311
+
312
+ /**
313
+ * qq(暂不支持)
314
+ * @since ThirdAuthKit 1.0.0
315
+ */
316
+ QQ = 1,
317
+
318
+ /**
319
+ * 微信
320
+ * @since ThirdAuthKit 1.0.0
321
+ */
322
+ Wechat = 2,
323
+ }
100
324
  }
@@ -160,7 +160,7 @@ declare namespace ty.thirdpartydevice {
160
160
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
161
161
  complete?: () => void
162
162
  /** 接口调用成功的回调函数 */
163
- success?: (params: null) => void
163
+ success?: () => void
164
164
  /** 接口调用失败的回调函数 */
165
165
  fail?: (params: {
166
166
  /** 错误信息 */
@@ -192,7 +192,7 @@ declare namespace ty.thirdpartydevice {
192
192
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
193
193
  complete?: () => void
194
194
  /** 接口调用成功的回调函数 */
195
- success?: (params: null) => void
195
+ success?: () => void
196
196
  /** 接口调用失败的回调函数 */
197
197
  fail?: (params: {
198
198
  /** 错误信息 */