@soonspacejs/plugin-flow 2.13.6 → 2.13.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.
- package/README.md +4 -4
- package/dist/index.esm.js +1881 -1
- package/dist/index.esm.js.map +1 -0
- package/package.json +3 -3
- package/test/test.ts +118 -118
- package/dist/flows/ComponentFlowParser.d.ts +0 -8
- package/dist/flows/FlowParser.d.ts +0 -46
- package/dist/flows/edges/index.d.ts +0 -9
- package/dist/flows/index.d.ts +0 -4
- package/dist/flows/nodes/ColorNode.d.ts +0 -8
- package/dist/flows/nodes/ConditionNode.d.ts +0 -9
- package/dist/flows/nodes/DataExtractionNode.d.ts +0 -8
- package/dist/flows/nodes/DataFilterNode.d.ts +0 -8
- package/dist/flows/nodes/DelayNode.d.ts +0 -8
- package/dist/flows/nodes/EmissiveNode.d.ts +0 -10
- package/dist/flows/nodes/FlyToNode.d.ts +0 -8
- package/dist/flows/nodes/HideNode.d.ts +0 -10
- package/dist/flows/nodes/HighlightNode.d.ts +0 -10
- package/dist/flows/nodes/MeshNode.d.ts +0 -8
- package/dist/flows/nodes/MeshesNode.d.ts +0 -8
- package/dist/flows/nodes/ModelNode.d.ts +0 -8
- package/dist/flows/nodes/ModelsNode.d.ts +0 -8
- package/dist/flows/nodes/Node.d.ts +0 -48
- package/dist/flows/nodes/NumberNode.d.ts +0 -8
- package/dist/flows/nodes/OpacityNode.d.ts +0 -10
- package/dist/flows/nodes/POINode.d.ts +0 -8
- package/dist/flows/nodes/POISNode.d.ts +0 -8
- package/dist/flows/nodes/PathNode.d.ts +0 -8
- package/dist/flows/nodes/PathsNode.d.ts +0 -8
- package/dist/flows/nodes/RotateNode.d.ts +0 -8
- package/dist/flows/nodes/ScaleNode.d.ts +0 -8
- package/dist/flows/nodes/ShowNode.d.ts +0 -10
- package/dist/flows/nodes/SpaceNode.d.ts +0 -8
- package/dist/flows/nodes/SpacesNode.d.ts +0 -8
- package/dist/flows/nodes/StartNode.d.ts +0 -7
- package/dist/flows/nodes/TranslateNode.d.ts +0 -8
- package/dist/flows/nodes/UnEmissiveNode.d.ts +0 -10
- package/dist/flows/nodes/UnHighlightNode.d.ts +0 -10
- package/dist/flows/nodes/UnOpacityNode.d.ts +0 -10
- package/dist/flows/nodes/clip-animation/ClipAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/clip-animation/UnClipAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/clip-animation/index.d.ts +0 -2
- package/dist/flows/nodes/component-tween-animation/ComponentTweenAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/component-tween-animation/UnComponentTweenAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/component-tween-animation/index.d.ts +0 -2
- package/dist/flows/nodes/component-tween-animation/utils.d.ts +0 -5
- package/dist/flows/nodes/index.d.ts +0 -33
- package/dist/flows/nodes/tween-animation/TweenAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/tween-animation/UnTweenAnimationNode.d.ts +0 -8
- package/dist/flows/nodes/tween-animation/index.d.ts +0 -2
- package/dist/flows/nodes/tween-animation/utils.d.ts +0 -5
- package/dist/flows/types.d.ts +0 -106
- package/dist/flows/utils.d.ts +0 -12
- package/dist/index.d.ts +0 -3
- package/dist/triggers/ComponentTrigger.d.ts +0 -18
- package/dist/triggers/Trigger.d.ts +0 -27
- package/dist/triggers/index.d.ts +0 -3
- package/dist/triggers/types.d.ts +0 -54
- package/dist/triggers/utils.d.ts +0 -2
- package/dist/types.d.ts +0 -16
package/test/test.ts
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
import componentThingJson from '../example/scene-test/db/component_thing.json'
|
|
2
|
-
|
|
3
|
-
function generateMockData ( schema: any ): any {
|
|
4
|
-
|
|
5
|
-
const result: Record<string, any> = {}
|
|
6
|
-
|
|
7
|
-
// 遍历schema的properties属性
|
|
8
|
-
for ( const prop of schema.thing.properties ) {
|
|
9
|
-
|
|
10
|
-
const identifier = prop.identifier
|
|
11
|
-
const defineType = prop.define.type
|
|
12
|
-
|
|
13
|
-
switch ( defineType ) {
|
|
14
|
-
|
|
15
|
-
case 'string':
|
|
16
|
-
result[ identifier ] = `模拟${prop.name}`
|
|
17
|
-
break
|
|
18
|
-
case 'int':
|
|
19
|
-
result[ identifier ] = Math.floor( Math.random() * 10000 )
|
|
20
|
-
break
|
|
21
|
-
case 'enum':
|
|
22
|
-
const keys = Object.keys( prop.define.mapping )
|
|
23
|
-
|
|
24
|
-
result[ identifier ] = keys[ Math.floor( Math.random() * keys.length ) ]
|
|
25
|
-
break
|
|
26
|
-
case 'struct':
|
|
27
|
-
result[ identifier ] = generateMockData( { thing: { properties: prop.define.properties, }, } )
|
|
28
|
-
break
|
|
29
|
-
default:
|
|
30
|
-
result[ identifier ] = null
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return result
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface SchemaMapping {
|
|
41
|
-
sourceField: string;
|
|
42
|
-
targetField: string;
|
|
43
|
-
transform?: ( value: any ) => any;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function transformData (
|
|
47
|
-
sourceData: any,
|
|
48
|
-
mappings: SchemaMapping[],
|
|
49
|
-
defaultValues: Record<string, any> = {}
|
|
50
|
-
): any {
|
|
51
|
-
|
|
52
|
-
const result: Record<string, any> = { ...defaultValues, }
|
|
53
|
-
|
|
54
|
-
for ( const mapping of mappings ) {
|
|
55
|
-
|
|
56
|
-
const { sourceField, targetField, transform, } = mapping
|
|
57
|
-
|
|
58
|
-
// 获取源数据的值
|
|
59
|
-
const value = sourceField.split( '.' ).reduce( ( obj, key ) =>
|
|
60
|
-
obj && obj[ key ] !== undefined ? obj[ key ] : undefined, sourceData )
|
|
61
|
-
|
|
62
|
-
// 如果存在值并且有transform函数,则应用transform
|
|
63
|
-
if ( value !== undefined ) {
|
|
64
|
-
|
|
65
|
-
const transformedValue = transform ? transform( value ) : value
|
|
66
|
-
|
|
67
|
-
// 将转换后的值设置到目标字段
|
|
68
|
-
const fieldParts = targetField.split( '.' )
|
|
69
|
-
let current = result
|
|
70
|
-
|
|
71
|
-
for ( let i = 0; i < fieldParts.length - 1; i++ ) {
|
|
72
|
-
|
|
73
|
-
const part = fieldParts[ i ]
|
|
74
|
-
|
|
75
|
-
if ( !current[ part ] ) {
|
|
76
|
-
|
|
77
|
-
current[ part ] = {}
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
current = current[ part ]
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
current[ fieldParts[ fieldParts.length - 1 ] ] = transformedValue
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return result
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// 1. 生成模拟数据
|
|
96
|
-
const schema = componentThingJson[ 0 ] // 你的JSON文件中的第一个元素
|
|
97
|
-
const mockData = generateMockData( schema )
|
|
98
|
-
|
|
99
|
-
console.log( '生成的模拟数据:', mockData )
|
|
100
|
-
|
|
101
|
-
// 2. 定义映射(从一种模式到另一种模式)
|
|
102
|
-
const mappings: SchemaMapping[] = [
|
|
103
|
-
{ sourceField: 'name', targetField: 'user.basicInfo.fullName', },
|
|
104
|
-
{ sourceField: 'id', targetField: 'user.basicInfo.idNumber', },
|
|
105
|
-
{ sourceField: 'gender', targetField: 'user.basicInfo.gender',
|
|
106
|
-
transform: ( value ) => value === 'male' ? '男' : ( value === 'female' ? '女' : '未知' ), },
|
|
107
|
-
{ sourceField: 'phoneNumber', targetField: 'user.contact.mobile', },
|
|
108
|
-
{ sourceField: 'address', targetField: 'user.contact.address', },
|
|
109
|
-
{ sourceField: 'image.data', targetField: 'user.avatar',
|
|
110
|
-
transform: ( value ) => ( { url: value, } ), }
|
|
111
|
-
]
|
|
112
|
-
|
|
113
|
-
// 3. 转换数据
|
|
114
|
-
const transformedData = transformData( mockData, mappings, {
|
|
115
|
-
version: '1.0',
|
|
116
|
-
createdAt: new Date().toISOString(),
|
|
117
|
-
} )
|
|
118
|
-
|
|
1
|
+
import componentThingJson from '../example/scene-test/db/component_thing.json'
|
|
2
|
+
|
|
3
|
+
function generateMockData ( schema: any ): any {
|
|
4
|
+
|
|
5
|
+
const result: Record<string, any> = {}
|
|
6
|
+
|
|
7
|
+
// 遍历schema的properties属性
|
|
8
|
+
for ( const prop of schema.thing.properties ) {
|
|
9
|
+
|
|
10
|
+
const identifier = prop.identifier
|
|
11
|
+
const defineType = prop.define.type
|
|
12
|
+
|
|
13
|
+
switch ( defineType ) {
|
|
14
|
+
|
|
15
|
+
case 'string':
|
|
16
|
+
result[ identifier ] = `模拟${prop.name}`
|
|
17
|
+
break
|
|
18
|
+
case 'int':
|
|
19
|
+
result[ identifier ] = Math.floor( Math.random() * 10000 )
|
|
20
|
+
break
|
|
21
|
+
case 'enum':
|
|
22
|
+
const keys = Object.keys( prop.define.mapping )
|
|
23
|
+
|
|
24
|
+
result[ identifier ] = keys[ Math.floor( Math.random() * keys.length ) ]
|
|
25
|
+
break
|
|
26
|
+
case 'struct':
|
|
27
|
+
result[ identifier ] = generateMockData( { thing: { properties: prop.define.properties, }, } )
|
|
28
|
+
break
|
|
29
|
+
default:
|
|
30
|
+
result[ identifier ] = null
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return result
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface SchemaMapping {
|
|
41
|
+
sourceField: string;
|
|
42
|
+
targetField: string;
|
|
43
|
+
transform?: ( value: any ) => any;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function transformData (
|
|
47
|
+
sourceData: any,
|
|
48
|
+
mappings: SchemaMapping[],
|
|
49
|
+
defaultValues: Record<string, any> = {}
|
|
50
|
+
): any {
|
|
51
|
+
|
|
52
|
+
const result: Record<string, any> = { ...defaultValues, }
|
|
53
|
+
|
|
54
|
+
for ( const mapping of mappings ) {
|
|
55
|
+
|
|
56
|
+
const { sourceField, targetField, transform, } = mapping
|
|
57
|
+
|
|
58
|
+
// 获取源数据的值
|
|
59
|
+
const value = sourceField.split( '.' ).reduce( ( obj, key ) =>
|
|
60
|
+
obj && obj[ key ] !== undefined ? obj[ key ] : undefined, sourceData )
|
|
61
|
+
|
|
62
|
+
// 如果存在值并且有transform函数,则应用transform
|
|
63
|
+
if ( value !== undefined ) {
|
|
64
|
+
|
|
65
|
+
const transformedValue = transform ? transform( value ) : value
|
|
66
|
+
|
|
67
|
+
// 将转换后的值设置到目标字段
|
|
68
|
+
const fieldParts = targetField.split( '.' )
|
|
69
|
+
let current = result
|
|
70
|
+
|
|
71
|
+
for ( let i = 0; i < fieldParts.length - 1; i++ ) {
|
|
72
|
+
|
|
73
|
+
const part = fieldParts[ i ]
|
|
74
|
+
|
|
75
|
+
if ( !current[ part ] ) {
|
|
76
|
+
|
|
77
|
+
current[ part ] = {}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
current = current[ part ]
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
current[ fieldParts[ fieldParts.length - 1 ] ] = transformedValue
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return result
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
// 1. 生成模拟数据
|
|
96
|
+
const schema = componentThingJson[ 0 ] // 你的JSON文件中的第一个元素
|
|
97
|
+
const mockData = generateMockData( schema )
|
|
98
|
+
|
|
99
|
+
console.log( '生成的模拟数据:', mockData )
|
|
100
|
+
|
|
101
|
+
// 2. 定义映射(从一种模式到另一种模式)
|
|
102
|
+
const mappings: SchemaMapping[] = [
|
|
103
|
+
{ sourceField: 'name', targetField: 'user.basicInfo.fullName', },
|
|
104
|
+
{ sourceField: 'id', targetField: 'user.basicInfo.idNumber', },
|
|
105
|
+
{ sourceField: 'gender', targetField: 'user.basicInfo.gender',
|
|
106
|
+
transform: ( value ) => value === 'male' ? '男' : ( value === 'female' ? '女' : '未知' ), },
|
|
107
|
+
{ sourceField: 'phoneNumber', targetField: 'user.contact.mobile', },
|
|
108
|
+
{ sourceField: 'address', targetField: 'user.contact.address', },
|
|
109
|
+
{ sourceField: 'image.data', targetField: 'user.avatar',
|
|
110
|
+
transform: ( value ) => ( { url: value, } ), }
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
// 3. 转换数据
|
|
114
|
+
const transformedData = transformData( mockData, mappings, {
|
|
115
|
+
version: '1.0',
|
|
116
|
+
createdAt: new Date().toISOString(),
|
|
117
|
+
} )
|
|
118
|
+
|
|
119
119
|
console.log( '转换后的数据:', transformedData )
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import SoonSpace from 'soonspacejs';
|
|
2
|
-
import { FlowParser } from './FlowParser';
|
|
3
|
-
import { ComponentFlowType } from './types';
|
|
4
|
-
declare class ComponentFlowParser extends FlowParser {
|
|
5
|
-
flow: ComponentFlowType;
|
|
6
|
-
constructor(ssp: SoonSpace, flow: ComponentFlowType);
|
|
7
|
-
}
|
|
8
|
-
export { ComponentFlowParser, };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { EventDispatcher } from 'three';
|
|
2
|
-
import SoonSpace from 'soonspacejs';
|
|
3
|
-
import { Edge } from './edges';
|
|
4
|
-
import { Node } from './nodes';
|
|
5
|
-
import { FlowParserEventMap, FlowType, NodeGlobalType } from './types';
|
|
6
|
-
declare class FlowParser extends EventDispatcher<FlowParserEventMap> {
|
|
7
|
-
ssp: SoonSpace;
|
|
8
|
-
flow: FlowType;
|
|
9
|
-
nodes: Node[];
|
|
10
|
-
nodesMap: Map<Node['id'], Node>;
|
|
11
|
-
edges: Edge[];
|
|
12
|
-
edgesMap: Map<Edge['id'], Edge>;
|
|
13
|
-
onNodeBefore: Node['onBefore'];
|
|
14
|
-
onNodeAfter: Node['onAfter'];
|
|
15
|
-
constructor(ssp: SoonSpace, flow: FlowType);
|
|
16
|
-
addNode(node: Node): void;
|
|
17
|
-
addEdge(edge: Edge): void;
|
|
18
|
-
getNodeById(id: string): Node | undefined;
|
|
19
|
-
getEdgeById(id: string): Edge | undefined;
|
|
20
|
-
clear(): void;
|
|
21
|
-
/**
|
|
22
|
-
* 解析流程
|
|
23
|
-
*/
|
|
24
|
-
parse(): void;
|
|
25
|
-
/**
|
|
26
|
-
* 执行流程
|
|
27
|
-
* @param startNode
|
|
28
|
-
* @param ctx
|
|
29
|
-
*/
|
|
30
|
-
run(global?: NodeGlobalType): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* 调试流程
|
|
33
|
-
*/
|
|
34
|
-
debug(global?: NodeGlobalType, time?: number): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* 停止流程
|
|
37
|
-
*/
|
|
38
|
-
stop(): void;
|
|
39
|
-
/**
|
|
40
|
-
* 清理流程
|
|
41
|
-
*/
|
|
42
|
-
cleanup(): void;
|
|
43
|
-
getVariableNameById(id: string): any;
|
|
44
|
-
dispose(): void;
|
|
45
|
-
}
|
|
46
|
-
export { FlowParser, };
|
package/dist/flows/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class ConditionNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
execFn(fnStr: string): any;
|
|
7
|
-
exec(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export { ConditionNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class DataExtractionNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { DataExtractionNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class DataFilterNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { DataFilterNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class EmissiveNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterEmissiveObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { EmissiveNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
import { Object3D } from 'three';
|
|
5
|
-
declare class HideNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterHideObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { HideNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class HighlightNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterHighlightObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { HighlightNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class MeshNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { MeshNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class MeshesNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { MeshesNode, };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import SoonSpace from 'soonspacejs';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeType, NodeCtxType, NodePropType, NodeGlobalType, NodeTypeEnum } from '../types';
|
|
4
|
-
import { Object3D } from 'three';
|
|
5
|
-
declare class Node {
|
|
6
|
-
parser: FlowParser;
|
|
7
|
-
ssp: SoonSpace;
|
|
8
|
-
id: string;
|
|
9
|
-
type: NodeTypeEnum;
|
|
10
|
-
props: NodeType['props'];
|
|
11
|
-
prevNodes: Node[];
|
|
12
|
-
postNodes: Node[];
|
|
13
|
-
execOrder: number;
|
|
14
|
-
ctx: NodeCtxType;
|
|
15
|
-
promise: Promise<void>;
|
|
16
|
-
resolve: () => void;
|
|
17
|
-
reject: (reason?: any) => void;
|
|
18
|
-
cleanSets: Set<() => void>;
|
|
19
|
-
onBefore: ((node: Node) => (Promise<void> | void)) | null;
|
|
20
|
-
onAfter: ((node: Node) => (Promise<void> | void)) | null;
|
|
21
|
-
rejected: boolean;
|
|
22
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
23
|
-
init(): void;
|
|
24
|
-
readContext<T = any>(key: string): T | undefined;
|
|
25
|
-
writeContext(key: string, value: any): void;
|
|
26
|
-
findProp(name: string, type: NodePropType['type'] | NodePropType['type'][]): undefined | NodePropType;
|
|
27
|
-
/**
|
|
28
|
-
* 等待前置节点执行完毕
|
|
29
|
-
*/
|
|
30
|
-
waitForPrevNodes(): Promise<void[]>;
|
|
31
|
-
/**
|
|
32
|
-
* 合并上下文
|
|
33
|
-
*/
|
|
34
|
-
mergeContext(): void;
|
|
35
|
-
/**
|
|
36
|
-
* 执行节点逻辑
|
|
37
|
-
* @param global
|
|
38
|
-
*/
|
|
39
|
-
exec(_global: NodeGlobalType): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* 运行节点
|
|
42
|
-
* @param global
|
|
43
|
-
*/
|
|
44
|
-
run(global: NodeGlobalType): Promise<void>;
|
|
45
|
-
cleanup(): void;
|
|
46
|
-
protected getValue(prop: NodePropType, object?: Object3D | null): any;
|
|
47
|
-
}
|
|
48
|
-
export { Node, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class OpacityNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterOpacityObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { OpacityNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class POINode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { POINode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class POIsNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { POIsNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class RotateNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { RotateNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class ScaleNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { ScaleNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
import { Object3D } from 'three';
|
|
5
|
-
declare class ShowNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterShowObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { ShowNode, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FlowParser } from '../FlowParser';
|
|
2
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
-
import { Node } from './Node';
|
|
4
|
-
declare class TranslateNode extends Node {
|
|
5
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
6
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export { TranslateNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class UnEmissiveNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterUnEmissiveObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { UnEmissiveNode, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import { FlowParser } from '../FlowParser';
|
|
3
|
-
import { NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class UnHighlightNode extends Node {
|
|
6
|
-
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
-
filterUnHighlightObject(objectsValue: Object3D[] | Object3D): Object3D<import("three").Object3DEventMap>[];
|
|
8
|
-
exec(global: NodeGlobalType): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export { UnHighlightNode, };
|