@soonspacejs/plugin-cps-soonmanager 2.9.1 → 2.9.3

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,2 @@
1
+ import { Decrypt } from './types';
2
+ export declare const decryptV1: Decrypt;
@@ -0,0 +1,3 @@
1
+ import { Decrypt } from './types';
2
+ export declare const decryptV2: Decrypt;
3
+ export declare function decodeToBytes(input: string): Int8Array;
@@ -1,5 +1,8 @@
1
+ import NodeRSA from 'node-rsa';
2
+ import { ITreeData, TLicense } from '../types';
1
3
  export interface EncryptInfo {
2
4
  verifyKey: string;
3
5
  debugKey: string;
4
6
  key: string;
5
7
  }
8
+ export type Decrypt = (license: TLicense, nodeRsa: NodeRSA) => ITreeData[];
package/dist/index.d.ts CHANGED
@@ -14,11 +14,11 @@ declare class CpsSoonmanagerPlugin {
14
14
  /**
15
15
  * 模型树
16
16
  */
17
- treeData: ITreeData[];
17
+ treeData: ITreeData[] | null;
18
18
  /**
19
19
  * 拓扑路径
20
20
  */
21
- topologyData: TopologyInfo[];
21
+ topologyData: TopologyInfo[] | null;
22
22
  /**
23
23
  * 自定义属性
24
24
  */
@@ -44,7 +44,7 @@ declare class CpsSoonmanagerPlugin {
44
44
  */
45
45
  fetchMetaData(): Promise<IMetadata>;
46
46
  /**
47
- * 获取场景树
47
+ * 获取场景树(旧版资源包使用)
48
48
  * @returns
49
49
  */
50
50
  fetchTreeData(): Promise<ITreeData[]>;
@@ -68,17 +68,21 @@ declare class CpsSoonmanagerPlugin {
68
68
  * @returns
69
69
  */
70
70
  fetchModelVisionsData(): Promise<TModelVisionsMap>;
71
+ /**
72
+ * 加载单个树节点
73
+ * @param node
74
+ * @param options
75
+ * @returns
76
+ */
71
77
  private loadNode;
72
78
  /**
73
- * @todo 待优化
79
+ * 根据 id 获取树节点
74
80
  */
75
- getTargetIdTreeData(id: ITreeData['id'], treeData?: ITreeData[]): ITreeData | undefined;
81
+ private getTreeNodeById;
76
82
  /**
77
83
  * 加载场景树中的对象 (深度优先遍历)
78
84
  */
79
- loadObjects(options: ILoadSceneOptions & {
80
- treeData?: ITreeData[];
81
- }): Promise<void>;
85
+ private loadObjects;
82
86
  /**
83
87
  * 加载场景树中的对象 (广度优先遍历)
84
88
  */
@@ -89,7 +93,7 @@ declare class CpsSoonmanagerPlugin {
89
93
  */
90
94
  setPath(path: string): void;
91
95
  /**
92
- * 同步场景树
96
+ * 加载整个场景
93
97
  */
94
98
  loadScene(options?: ILoadSceneOptions): Promise<void>;
95
99
  /**