@ray-js/api 1.2.0-beta.1 → 1.3.0-beta.0

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.
@@ -0,0 +1,358 @@
1
+ /**
2
+ * HomeKit
3
+ *
4
+ * @version 3.1.4
5
+ */
6
+ declare namespace ty.home {
7
+ // /**
8
+ // * 请求接口,获取本地设备时区信息,并写入缓存
9
+ // */
10
+ // export function getLocalDeviceConfigWithDevId(params: {
11
+ // /** 设备ID */
12
+ // devId: string
13
+ // complete?: () => void
14
+ // success?: (params: null) => void
15
+ // fail?: (params: {
16
+ // errorMsg: string
17
+ // errorCode: string | number
18
+ // innerError: {
19
+ // errorCode: string | number
20
+ // errorMsg: string
21
+ // }
22
+ // }) => void
23
+ // }): void
24
+
25
+ // /**
26
+ // * 修改家庭信息
27
+ // */
28
+ // export function updateHomeInfoData(params: {
29
+ // /** 家庭名称 */
30
+ // homeName: string
31
+ // /** 家庭id */
32
+ // homeId: string
33
+ // /** 经度 */
34
+ // longitude: string
35
+ // /** 维度 */
36
+ // latitude: string
37
+ // /** 详细地址 */
38
+ // address: string
39
+ // /**
40
+ // * 是否是管理员
41
+ // * true 是管理员; false 非管理员
42
+ // */
43
+ // admin: boolean
44
+ // complete?: () => void
45
+ // success?: (params: null) => void
46
+ // fail?: (params: {
47
+ // errorMsg: string
48
+ // errorCode: string | number
49
+ // innerError: {
50
+ // errorCode: string | number
51
+ // errorMsg: string
52
+ // }
53
+ // }) => void
54
+ // }): void
55
+
56
+ /**
57
+ * 获取当前家庭信息
58
+ */
59
+ export function getCurrentHomeInfo(params?: {
60
+ complete?: () => void
61
+ success?: (params: {
62
+ /** 家庭名称 */
63
+ homeName: string
64
+ /** 家庭id */
65
+ homeId: string
66
+ /** 经度 */
67
+ longitude: string
68
+ /** 维度 */
69
+ latitude: string
70
+ /** 详细地址 */
71
+ address: string
72
+ /**
73
+ * 是否是管理员
74
+ * true 是管理员; false 非管理员
75
+ */
76
+ admin: boolean
77
+ }) => void
78
+ fail?: (params: {
79
+ errorMsg: string
80
+ errorCode: string | number
81
+ innerError: {
82
+ errorCode: string | number
83
+ errorMsg: string
84
+ }
85
+ }) => void
86
+ }): void
87
+
88
+ /**
89
+ * 获取设备房间信息
90
+ */
91
+ export function getDeviceRoomInfo(params: {
92
+ /**
93
+ * deviceId
94
+ * 设备 id
95
+ */
96
+ deviceId: string
97
+ complete?: () => void
98
+ success?: (params: {
99
+ /** The room ID. */
100
+ roomId: number
101
+ /** The room name. */
102
+ name: string
103
+ }) => void
104
+ fail?: (params: {
105
+ errorMsg: string
106
+ errorCode: string | number
107
+ innerError: {
108
+ errorCode: string | number
109
+ errorMsg: string
110
+ }
111
+ }) => void
112
+ }): void
113
+
114
+ // /**
115
+ // * 获取群组房间信息
116
+ // */
117
+ // export function getGroupRoomInfo(params: {
118
+ // /**
119
+ // * groupId
120
+ // * 群组 id
121
+ // */
122
+ // groupId: string
123
+ // complete?: () => void
124
+ // success?: (params: {
125
+ // /** The room ID. */
126
+ // roomId: number
127
+ // /** The room name. */
128
+ // name: string
129
+ // }) => void
130
+ // fail?: (params: {
131
+ // errorMsg: string
132
+ // errorCode: string | number
133
+ // innerError: {
134
+ // errorCode: string | number
135
+ // errorMsg: string
136
+ // }
137
+ // }) => void
138
+ // }): void
139
+
140
+ /**
141
+ * 获取当前维度下的设备id列表
142
+ */
143
+ export function getDeviceIdList(params: {
144
+ /** 维度id */
145
+ ownerId: number
146
+ complete?: () => void
147
+ success?: (params: {
148
+ /** 设备id列表 */
149
+ devIds: string[]
150
+ }) => void
151
+ fail?: (params: {
152
+ errorMsg: string
153
+ errorCode: string | number
154
+ innerError: {
155
+ errorCode: string | number
156
+ errorMsg: string
157
+ }
158
+ }) => void
159
+ }): void
160
+
161
+ /**
162
+ * 获取当前维度下的设备id列表
163
+ */
164
+ export function getRoomList(params: {
165
+ /** 维度id */
166
+ ownerId: number
167
+ complete?: () => void
168
+ success?: (params: {
169
+ /** 房间列表 */
170
+ roomDatas: RoomData[]
171
+ }) => void
172
+ fail?: (params: {
173
+ errorMsg: string
174
+ errorCode: string | number
175
+ innerError: {
176
+ errorCode: string | number
177
+ errorMsg: string
178
+ }
179
+ }) => void
180
+ }): void
181
+
182
+ // /**
183
+ // * 验证码校验成功
184
+ // */
185
+ // export function onTicketSuccess(params?: {
186
+ // /** ticket */
187
+ // map?: Record<string, string>
188
+ // complete?: () => void
189
+ // success?: (params: {
190
+ // /** ticket */
191
+ // map?: Record<string, string>
192
+ // }) => void
193
+ // fail?: (params: {
194
+ // errorMsg: string
195
+ // errorCode: string | number
196
+ // innerError: {
197
+ // errorCode: string | number
198
+ // errorMsg: string
199
+ // }
200
+ // }) => void
201
+ // }): void
202
+
203
+ // /**
204
+ // * 【废弃】打开推荐场景详情页面
205
+ // *请用deviceKit包下同名方法替代
206
+ // *详细文档链接:https://wiki.tuya-inc.com:7799/page/1456192108871295013
207
+ // */
208
+ // export function openRecommendSceneDetail(params: {
209
+ // /** 来源 */
210
+ // source: string
211
+ // /** 场景模型 */
212
+ // sceneModel: Record<string, any>
213
+ // complete?: () => void
214
+ // success?: (params: {
215
+ // /** 返回状态,默认返回 true */
216
+ // status?: boolean
217
+ // /** 成功返回的类型。0-未操作,1-保存成功,2-点击不感兴趣 */
218
+ // type: number
219
+ // /** 返回的场景数据,可能为空 */
220
+ // data?: Record<string, any>
221
+ // }) => void
222
+ // fail?: (params: {
223
+ // errorMsg: string
224
+ // errorCode: string | number
225
+ // innerError: {
226
+ // errorCode: string | number
227
+ // errorMsg: string
228
+ // }
229
+ // }) => void
230
+ // }): void
231
+
232
+ // /**
233
+ // * 【废弃】跳转一键执行和自动化页面
234
+ // *请用deviceKit包下同名方法替代
235
+ // */
236
+ // export function openDeviceExecutionAndAnutomation(params: {
237
+ // /**
238
+ // * deviceId
239
+ // * 设备 id
240
+ // */
241
+ // deviceId: string
242
+ // /** 页面标题,Android 需要 */
243
+ // title?: string
244
+ // complete?: () => void
245
+ // success?: (params: null) => void
246
+ // fail?: (params: {
247
+ // errorMsg: string
248
+ // errorCode: string | number
249
+ // innerError: {
250
+ // errorCode: string | number
251
+ // errorMsg: string
252
+ // }
253
+ // }) => void
254
+ // }): void
255
+
256
+ export type RoomData = {
257
+ /** 房间id */
258
+ roomId: number
259
+ /** 房间名称 */
260
+ name: string
261
+ /** 房间下的设备id */
262
+ deviceIds: string[]
263
+ }
264
+
265
+ export type HomeInfoData = {
266
+ /** 家庭名称 */
267
+ homeName: string
268
+ /** 家庭id */
269
+ homeId: string
270
+ /** 经度 */
271
+ longitude: string
272
+ /** 维度 */
273
+ latitude: string
274
+ /** 详细地址 */
275
+ address: string
276
+ /**
277
+ * 是否是管理员
278
+ * true 是管理员; false 非管理员
279
+ */
280
+ admin: boolean
281
+ }
282
+
283
+ export type GetDeviceRoomInfoParams = {
284
+ /**
285
+ * deviceId
286
+ * 设备 id
287
+ */
288
+ deviceId: string
289
+ }
290
+
291
+ export type GetDeviceRoomInfoResponse = {
292
+ /** The room ID. */
293
+ roomId: number
294
+ /** The room name. */
295
+ name: string
296
+ }
297
+
298
+ export type GroupRoomInfoParams = {
299
+ /**
300
+ * groupId
301
+ * 群组 id
302
+ */
303
+ groupId: string
304
+ }
305
+
306
+ export type GroupRoomInfoResponse = {
307
+ /** The room ID. */
308
+ roomId: number
309
+ /** The room name. */
310
+ name: string
311
+ }
312
+
313
+ export type OwnerId = {
314
+ /** 维度id */
315
+ ownerId: number
316
+ }
317
+
318
+ export type DeviceIdList = {
319
+ /** 设备id列表 */
320
+ devIds: string[]
321
+ }
322
+
323
+ export type RoomList = {
324
+ /** 房间列表 */
325
+ roomDatas: RoomData[]
326
+ }
327
+
328
+ export type TicketModel = {
329
+ /** ticket */
330
+ map?: Record<string, string>
331
+ }
332
+
333
+ export type RecommendSceneParams = {
334
+ /** 来源 */
335
+ source: string
336
+ /** 场景模型 */
337
+ sceneModel: Record<string, any>
338
+ }
339
+
340
+ export type RecommendSceneCallBack = {
341
+ /** 返回状态,默认返回 true */
342
+ status?: boolean
343
+ /** 成功返回的类型。0-未操作,1-保存成功,2-点击不感兴趣 */
344
+ type: number
345
+ /** 返回的场景数据,可能为空 */
346
+ data?: Record<string, any>
347
+ }
348
+
349
+ export type OpenDeviceExecutionAndAnutomationParams = {
350
+ /**
351
+ * deviceId
352
+ * 设备 id
353
+ */
354
+ deviceId: string
355
+ /** 页面标题,Android 需要 */
356
+ title?: string
357
+ }
358
+ }
@@ -4,3 +4,4 @@
4
4
  /// <reference path="./MiniKit.d.ts" />
5
5
  /// <reference path="./PlayNetKit.d.ts" />
6
6
  /// <reference path="./MapKit.d.ts" />
7
+ /// <reference path="./HomeKit.d.ts" />
@@ -0,0 +1,7 @@
1
+ /// <reference path="../@types/PlayNetKit.d.ts" />
2
+ export declare const home: {
3
+ getCurrentHomeInfo: typeof ty.home.getCurrentHomeInfo;
4
+ getDeviceIdList: typeof ty.home.getDeviceIdList;
5
+ getRoomList: typeof ty.home.getRoomList;
6
+ getDeviceRoomInfo: typeof ty.home.getDeviceRoomInfo;
7
+ };
@@ -0,0 +1,8 @@
1
+ /// <reference path="../@types/PlayNetKit.d.ts" />
2
+ import { factory } from './utils';
3
+ export var home = {
4
+ getCurrentHomeInfo: factory('getCurrentHomeInfo'),
5
+ getDeviceIdList: factory('getDeviceIdList'),
6
+ getRoomList: factory('getRoomList'),
7
+ getDeviceRoomInfo: factory('getDeviceRoomInfo')
8
+ };
package/lib/all-kits.d.ts CHANGED
@@ -4,5 +4,6 @@ export * from './DeviceKit-3.3.1';
4
4
  export * from './MiniKit-3.1.0';
5
5
  export * from './PlayNetKit-1.1.3';
6
6
  export * from './MapKit-3.0.7';
7
+ export * from './HomeKit-3.1.4';
7
8
  import * as device from './DeviceKit-3.3.1';
8
9
  export { device };
package/lib/all-kits.js CHANGED
@@ -4,5 +4,6 @@ export * from './DeviceKit-3.3.1';
4
4
  export * from './MiniKit-3.1.0';
5
5
  export * from './PlayNetKit-1.1.3';
6
6
  export * from './MapKit-3.0.7';
7
+ export * from './HomeKit-3.1.4';
7
8
  import * as device from './DeviceKit-3.3.1';
8
9
  export { device };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.3.0-beta.0",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,13 +26,13 @@
26
26
  "build:kit:api": "node scripts/api-creator.mjs"
27
27
  },
28
28
  "dependencies": {
29
- "@ray-js/framework": "^1.2.0-beta.1",
30
- "@ray-js/router": "^1.2.0-beta.1",
29
+ "@ray-js/framework": "^1.3.0-beta.0",
30
+ "@ray-js/router": "^1.3.0-beta.0",
31
31
  "@ray-js/wechat": "^0.0.16",
32
32
  "base64-browser": "^1.0.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@ray-js/cli": "^1.2.0-beta.1",
35
+ "@ray-js/cli": "^1.3.0-beta.0",
36
36
  "art-template": "^4.13.2",
37
37
  "fs-extra": "^10.1.0",
38
38
  "miniprogram-api-typings": "^3.4.3",
@@ -44,6 +44,6 @@
44
44
  "email": "tuyafe@tuya.com"
45
45
  }
46
46
  ],
47
- "gitHead": "2b34058549219b57afaa6b6f80c1b896e1602d53",
47
+ "gitHead": "d55c47fc54e6fdc34758e73d5e1dd76b3dd7a8c9",
48
48
  "repository": {}
49
49
  }