@tuya-sat/sdf-main-sdk 6.0.5 → 6.0.7

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,7 +1,7 @@
1
1
  {
2
2
  "main.css": "auto/main.css",
3
3
  "main.js": "auto/main.bundle.js",
4
- "364.b96974e6.chunk.js": "auto/364.b96974e6.chunk.js",
4
+ "364.228b2fca.chunk.js": "auto/364.228b2fca.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.b96974e6.chunk.js.map": "auto/364.b96974e6.chunk.js.map"
26
+ "364.228b2fca.chunk.js.map": "auto/364.228b2fca.chunk.js.map"
27
27
  }
@@ -22,7 +22,7 @@ export declare const eventNames: {
22
22
  UNMOUNT_MICRO_APP: string;
23
23
  };
24
24
  export declare const eventEmitter: EventEmitter<[never]>;
25
- export { switchHome, switchProject } from './switchHome';
25
+ export { switchHome, switchProject, switchProjectToSpace, getPendingSpaceId, clearPendingSpaceId, } from './switchHome';
26
26
  export declare const LOGIN_TERMINAL_ID = "WEBLOGIN";
27
27
  export declare const getMicroAppId: () => string;
28
28
  export declare const getCurMicroApp: () => {
@@ -24,3 +24,22 @@ export declare function switchHome(home_id: string, autoReload?: boolean): Promi
24
24
  * @param autoReload 是否自动刷新页面,默认 true
25
25
  */
26
26
  export declare function switchProject(project_id: string, autoReload?: boolean): Promise<void>;
27
+ /**
28
+ * 子应用启动时读取此 key,选中树节点后应清空(见 clearPendingDeviceSpaceId)
29
+ * 与 SMART_HOME_ID 配合:先保证当前项目,再带默认空间
30
+ */
31
+ export declare const SDF_PENDING_SPACE_ID_KEY = "SDF_PENDING_SPACE_ID_KEY";
32
+ /** 读取待默认选中的空间 id(无则空串) */
33
+ export declare function getPendingSpaceId(): string;
34
+ /** 子应用消费完后调用,避免下次进入仍误选 */
35
+ export declare function clearPendingSpaceId(): void;
36
+ /**
37
+ * 切换当前项目并记录「进入设备管理等应用时要默认选中的空间」。
38
+ * 典型流程:项目管理里点空间设备数 → switchProjectToSpace(projectId, spaceId, false) → window.location 跳到设备应用;
39
+ * 设备应用挂载后读取 getPendingSpaceId() 展开树并选中对应空间,再 clearPendingSpaceId()。
40
+ *
41
+ * @param project_id 业务项目 id
42
+ * @param space_id 空间 id(房间/空间节点)
43
+ * @param autoReload 是否在成功后整页刷新当前 URL,默认 true;若随后自行跳转其它微应用请传 false
44
+ */
45
+ export declare function switchProjectToSpace(project_id: string, space_id: string, autoReload?: boolean): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/sdf-main-sdk",
3
- "version": "6.0.5",
3
+ "version": "6.0.7",
4
4
  "main": "./dist/main.bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",