@tuya-sat/sdf-main-sdk 6.2.0 → 6.2.2
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/dist/{364.f9823ee8.chunk.js → 364.2d1ca926.chunk.js} +1 -1
- package/dist/{364.f9823ee8.chunk.js.map → 364.2d1ca926.chunk.js.map} +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/main.bundle.js.map +1 -1
- package/dist/manifest.json +2 -2
- package/dist/mqtt/index.d.ts +15 -0
- package/package.json +1 -1
package/dist/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"main.css": "auto/main.css",
|
|
3
3
|
"main.js": "auto/main.bundle.js",
|
|
4
|
-
"364.
|
|
4
|
+
"364.2d1ca926.chunk.js": "auto/364.2d1ca926.chunk.js",
|
|
5
5
|
"static/img/login3.png": "auto/static/img/dd06d35d98047203e715.png",
|
|
6
6
|
"static/img/reLogin.png": "auto/static/img/294142da390c5af23324.png",
|
|
7
7
|
"static/img/login2.png": "auto/static/img/47a523d0027c7b5af83f.png",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"static/img/tuya.png": "auto/static/img/328d8b5c342b13933c5c.png",
|
|
24
24
|
"main.css.map": "auto/main.css.map",
|
|
25
25
|
"main.bundle.js.map": "auto/main.bundle.js.map",
|
|
26
|
-
"364.
|
|
26
|
+
"364.2d1ca926.chunk.js.map": "auto/364.2d1ca926.chunk.js.map"
|
|
27
27
|
}
|
package/dist/mqtt/index.d.ts
CHANGED
|
@@ -4,10 +4,25 @@ export interface SubscribeTopicOption {
|
|
|
4
4
|
/** 与 topic 一一对应;不传则仅按 topic 匹配,不校验 protocol */
|
|
5
5
|
protocol?: number;
|
|
6
6
|
}
|
|
7
|
+
export interface PublishTopicOption {
|
|
8
|
+
/** 下发协议号;不传则 data 需自行包含完整协议字段,或配合 isRaw 发送原始 payload */
|
|
9
|
+
protocol?: number;
|
|
10
|
+
/** 消息类型,默认透传空字符串 */
|
|
11
|
+
type?: string;
|
|
12
|
+
/** 协议版本,默认 1 */
|
|
13
|
+
v?: number;
|
|
14
|
+
/** MQTT QoS,默认由 mqtt.js 使用 0 */
|
|
15
|
+
qos?: 0 | 1 | 2;
|
|
16
|
+
/** 是否保留消息 */
|
|
17
|
+
retain?: boolean;
|
|
18
|
+
/** 为 true 时不包裹 { data, protocol, t, type, v },直接发送 data */
|
|
19
|
+
isRaw?: boolean;
|
|
20
|
+
}
|
|
7
21
|
export type MqttTopic = string | ((uid: string) => string);
|
|
8
22
|
declare const mqtt: {
|
|
9
23
|
init: (cb?: () => void, force?: boolean) => Promise<void>;
|
|
10
24
|
subscribeTopic: (topic: MqttTopic, cbFn?: (msg: any) => void, option?: SubscribeTopicOption) => void;
|
|
25
|
+
publishTopic: (topic: MqttTopic, data: any, option?: PublishTopicOption) => Promise<void>;
|
|
11
26
|
unsubscribeMicTopics: () => void;
|
|
12
27
|
unsubscribeTopic: (topic?: MqttTopic) => void;
|
|
13
28
|
};
|