x-runtime-lib 0.8.104 → 0.8.106

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,8 @@
1
1
  export type NodeLite = {
2
2
  id: string;
3
3
  key: string;
4
- ref?: string;
4
+ alias?: string;
5
+ refId?: string;
5
6
  children?: NodeLite[];
6
7
  };
7
8
  export type Node = {
@@ -15,8 +16,8 @@ export type Node = {
15
16
  };
16
17
  [key: string]: any;
17
18
  };
18
- export type SpawnedNode = {
19
- nodeTree: NodeLite;
19
+ export type NodePair = {
20
+ nodeLite: NodeLite;
20
21
  nodes: {
21
22
  [key: string]: Node;
22
23
  };
@@ -24,7 +25,7 @@ export type SpawnedNode = {
24
25
  export declare function initNode(): Node;
25
26
  export declare function toNodeLite(node: Node, children?: NodeLite[]): NodeLite;
26
27
  export interface View {
27
- nodeTree: NodeLite[];
28
+ nodeLites: NodeLite[];
28
29
  nodes: {
29
30
  [key: string]: Node;
30
31
  };
@@ -77,4 +78,6 @@ export interface Data {
77
78
  view: View;
78
79
  code: Code;
79
80
  }
81
+ export declare function dataStringify({ type, version, view, code }: Data): string;
82
+ export declare function parseData(str: string): Data;
80
83
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Type } from './basic';
2
- import { SpawnedNode } from './data';
2
+ import { NodePair } from './data';
3
3
  export type ZField = {
4
4
  key: string;
5
5
  name: string;
@@ -183,7 +183,7 @@ export type ZElement = {
183
183
  leaf?: boolean;
184
184
  internal?: boolean;
185
185
  teleport?: boolean;
186
- spawn?: (type: string, subtype: string) => SpawnedNode | undefined;
186
+ spawn?: (type: string, subtype: string) => NodePair | undefined;
187
187
  };
188
188
  export type ZElements = {
189
189
  [key: string]: ZElement;
@@ -31,6 +31,8 @@ export type PageMeta = {
31
31
  arguments?: Field[];
32
32
  states?: Field[];
33
33
  };
34
+ export declare function pageMetaStringify(meta: PageMeta): string;
35
+ export declare function parsePageMeta(str: string): PageMeta;
34
36
  export type CompMeta = {
35
37
  version: string;
36
38
  properties?: Field[];
@@ -39,3 +41,5 @@ export type CompMeta = {
39
41
  slots?: Slot[];
40
42
  states?: Field[];
41
43
  };
44
+ export declare function compMetaStringify(meta: CompMeta): string;
45
+ export declare function parseCompMeta(str: string): CompMeta;
@@ -1,5 +1,5 @@
1
- import { Node, NodeLite, SpawnedNode } from '../types';
2
- export declare function spawnNode(type: string, subtype: string, version: string, ref: boolean, keyOrRefId: string): SpawnedNode | undefined;
3
- export declare function getTreeNode(nodes: NodeLite[], id: string): NodeLite | undefined;
4
- export declare function duplicateNode(src: Node): Node;
5
- export declare function duplicateNodes(src: Node[]): Node[];
1
+ import { NodeLite, NodePair } from '../types';
2
+ export declare function spawnNode(type: string, subtype: string, version: string, ref: boolean, keyOrRefId: string): NodePair | undefined;
3
+ export declare function getNodeLite(nodeLites: NodeLite[], id: string): NodeLite | undefined;
4
+ export declare function duplicateNodePair(src: NodePair): NodePair;
5
+ export declare function duplicateNodePairs(srcs: NodePair[]): NodePair[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.104",
4
+ "version": "0.8.106",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",