@babsey/code-graph 0.10.2 → 0.11.0
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/code-graph.js +1856 -1845
- package/dist/code-graph.umd.cjs +8 -8
- package/dist/code.d.ts +0 -1
- package/dist/codeGraph/codeGraph.d.ts +5 -3
- package/dist/codeNode/codeNode.d.ts +2 -7
- package/dist/codeNodeInterfaces/codeNode/codeNodeInterface.d.ts +2 -0
- package/dist/codeNodeInterfaces/formatInputs.d.ts +7 -0
- package/dist/codeNodeInterfaces/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/subgraph/graphInterface.d.ts +14 -8
- package/dist/subgraph/subgraphInterfaceNodes.d.ts +4 -10
- package/dist/utils/index.d.ts +2 -0
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -3
package/dist/code.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class CodeGraph extends Graph implements IBaklavaEventEmitter, IB
|
|
|
23
23
|
get connections(): Connection[];
|
|
24
24
|
set connections(values: Connection[]);
|
|
25
25
|
get nodeIds(): string[];
|
|
26
|
-
get nodes(): AbstractCodeNode[];
|
|
26
|
+
get nodes(): readonly AbstractCodeNode[];
|
|
27
27
|
set nodes(values: AbstractCodeNode[]);
|
|
28
28
|
get scriptedCodeNodes(): AbstractCodeNode[];
|
|
29
29
|
get selectedNodeIds(): string[];
|
|
@@ -34,6 +34,7 @@ export declare class CodeGraph extends Graph implements IBaklavaEventEmitter, IB
|
|
|
34
34
|
* Add code node to graph.
|
|
35
35
|
* @param node code node
|
|
36
36
|
* @param props optional
|
|
37
|
+
* @returns code node intstance
|
|
37
38
|
*/
|
|
38
39
|
addNode(node: AbstractCodeNode, props?: unknown): AbstractCodeNode | undefined;
|
|
39
40
|
/**
|
|
@@ -41,15 +42,16 @@ export declare class CodeGraph extends Graph implements IBaklavaEventEmitter, IB
|
|
|
41
42
|
* @param node code node
|
|
42
43
|
* @param position position
|
|
43
44
|
* @param props optional
|
|
44
|
-
* @returns code node
|
|
45
|
+
* @returns code node instance
|
|
45
46
|
*/
|
|
46
47
|
addNodeAtCoordinates: (node: AbstractCodeNode, position?: IPosition, props?: unknown) => AbstractCodeNode;
|
|
47
48
|
/**
|
|
48
49
|
* Add connection of code nodes
|
|
49
50
|
* @param from code node interface
|
|
50
51
|
* @param to code node interface
|
|
52
|
+
* @returns connection intstance
|
|
51
53
|
*/
|
|
52
|
-
addConnection(from: CodeNodeInterface, to: CodeNodeInterface):
|
|
54
|
+
addConnection(from: CodeNodeInterface, to: CodeNodeInterface): Connection | undefined;
|
|
53
55
|
/**
|
|
54
56
|
* Execute calls of nodes before running graph.
|
|
55
57
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractNode, NodeInterface, CalculateFunction, CalculateFunctionReturnType, INodeState, NodeInterfaceDefinition } from '@baklavajs/core';
|
|
2
2
|
import { UnwrapRef } from 'vue';
|
|
3
3
|
import { Code } from '../code';
|
|
4
|
-
import {
|
|
4
|
+
import { CodeNodeInterface, CodeNodeInputInterface, CodeNodeOutputInterface } from '../codeNodeInterfaces';
|
|
5
5
|
import { CodeGraph } from '../codeGraph';
|
|
6
6
|
export interface IAbstractCodeNodeState {
|
|
7
7
|
codeTemplate: string;
|
|
@@ -128,11 +128,6 @@ export declare abstract class CodeNode<I, O> extends AbstractCodeNode {
|
|
|
128
128
|
calculate?: CalculateFunction<I, O>;
|
|
129
129
|
executeFactory<V, T extends InterfaceFactory<V>>(type: "input" | "output", factory?: T): void;
|
|
130
130
|
load(state: ICodeNodeState<I, O>): void;
|
|
131
|
+
save(): ICodeNodeState<I, O>;
|
|
131
132
|
}
|
|
132
133
|
export type AbstractCodeNodeConstructor = new () => AbstractCodeNode;
|
|
133
|
-
/**
|
|
134
|
-
* Format inputs for mustache templates.
|
|
135
|
-
* @param intfs code node input interfaces
|
|
136
|
-
* @returns a list of string
|
|
137
|
-
*/
|
|
138
|
-
export declare const formatInputs: (intfs: Record<string, CodeNodeInputInterface>, withKeywords?: boolean) => string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeInterface, INodeInterfaceState } from '@baklavajs/core';
|
|
2
2
|
import { ComponentOptions, UnwrapRef } from 'vue';
|
|
3
|
+
import { AbstractCodeNode } from '../../codeNode';
|
|
3
4
|
import { Code } from '../../code';
|
|
4
5
|
export interface ICodeNodeInterfaceRefState {
|
|
5
6
|
optional: boolean;
|
|
@@ -18,3 +19,4 @@ export declare class CodeNodeInterface<T = unknown> extends NodeInterface<T> {
|
|
|
18
19
|
save(): INodeInterfaceState<T>;
|
|
19
20
|
setOptional(value: boolean): this;
|
|
20
21
|
}
|
|
22
|
+
export declare const addCodeInterfaces: (codeNode: AbstractCodeNode) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CodeNodeInputInterface } from '../main';
|
|
2
|
+
/**
|
|
3
|
+
* Format inputs for mustache templates.
|
|
4
|
+
* @param intfs code node input interfaces
|
|
5
|
+
* @returns a list of string
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatInputs: (intfs: Record<string, CodeNodeInputInterface>, withKeywords?: boolean) => string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CalculateFunction, IGraphInterface } from '@baklavajs/core';
|
|
2
2
|
import { AbstractCodeNode, CodeNode, ICodeNodeState } from '../codeNode';
|
|
3
|
+
import { CodeNodeInterface } from '../codeNodeInterfaces';
|
|
3
4
|
export interface ICodeGraphInterface extends IGraphInterface {
|
|
4
5
|
id: string;
|
|
5
6
|
nodeId: string;
|
|
@@ -17,6 +18,11 @@ declare abstract class CodeGraphInterfaceNode<I, O> extends CodeNode<I, O> {
|
|
|
17
18
|
onPlaced(): void;
|
|
18
19
|
load(state: IGraphInterfaceNodeState<I, O>): void;
|
|
19
20
|
save(): IGraphInterfaceNodeState<I, O>;
|
|
21
|
+
afterGraphLoaded(): void;
|
|
22
|
+
afterLoaded(): void;
|
|
23
|
+
beforeRun(): void;
|
|
24
|
+
onConnected(): void;
|
|
25
|
+
onUnconnected(): void;
|
|
20
26
|
update(): void;
|
|
21
27
|
}
|
|
22
28
|
export declare class CodeGraphInputNode extends CodeGraphInterfaceNode<{
|
|
@@ -24,13 +30,13 @@ export declare class CodeGraphInputNode extends CodeGraphInterfaceNode<{
|
|
|
24
30
|
}, {
|
|
25
31
|
placeholder: unknown;
|
|
26
32
|
}> {
|
|
27
|
-
static isGraphInputNode(v: AbstractCodeNode):
|
|
33
|
+
static isGraphInputNode(v: AbstractCodeNode): boolean;
|
|
28
34
|
readonly type = "__baklava_SubgraphInputNode";
|
|
29
35
|
inputs: {
|
|
30
|
-
name:
|
|
36
|
+
name: CodeNodeInterface<string>;
|
|
31
37
|
};
|
|
32
38
|
outputs: {
|
|
33
|
-
placeholder:
|
|
39
|
+
placeholder: CodeNodeInterface<undefined>;
|
|
34
40
|
};
|
|
35
41
|
}
|
|
36
42
|
export type CodeGraphInputNodeState = IGraphInterfaceNodeState<{
|
|
@@ -44,14 +50,14 @@ export declare class CodeGraphOutputNode extends CodeGraphInterfaceNode<{
|
|
|
44
50
|
}, {
|
|
45
51
|
output: unknown;
|
|
46
52
|
}> {
|
|
47
|
-
static isGraphOutputNode(v: AbstractCodeNode):
|
|
53
|
+
static isGraphOutputNode(v: AbstractCodeNode): boolean;
|
|
48
54
|
readonly type = "__baklava_SubgraphOutputNode";
|
|
49
55
|
inputs: {
|
|
50
|
-
name:
|
|
51
|
-
placeholder:
|
|
56
|
+
name: CodeNodeInterface<string>;
|
|
57
|
+
placeholder: CodeNodeInterface<undefined>;
|
|
52
58
|
};
|
|
53
59
|
outputs: {
|
|
54
|
-
output:
|
|
60
|
+
output: CodeNodeInterface<undefined>;
|
|
55
61
|
};
|
|
56
62
|
calculate: CalculateFunction<{
|
|
57
63
|
placeholder: unknown;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TextInputInterface } from '@baklavajs/renderer-vue';
|
|
1
|
+
import { CodeNodeInterface, TextInputInterface } from '../codeNodeInterfaces';
|
|
3
2
|
import { CodeGraphInputNode, CodeGraphOutputNode } from './graphInterface';
|
|
4
|
-
import { CodeNodeInterface } from '../codeNodeInterfaces';
|
|
5
3
|
export declare class SubgraphInputNode extends CodeGraphInputNode {
|
|
6
4
|
protected _title: string;
|
|
7
5
|
inputs: {
|
|
8
|
-
_code: CodeNodeInterface<string>;
|
|
9
6
|
name: TextInputInterface;
|
|
10
7
|
};
|
|
11
8
|
outputs: {
|
|
12
|
-
|
|
13
|
-
placeholder: NodeInterface<undefined>;
|
|
9
|
+
placeholder: CodeNodeInterface<undefined>;
|
|
14
10
|
};
|
|
15
11
|
}
|
|
16
12
|
export declare class SubgraphOutputNode extends CodeGraphOutputNode {
|
|
17
13
|
protected _title: string;
|
|
18
14
|
inputs: {
|
|
19
|
-
_code: CodeNodeInterface<string>;
|
|
20
15
|
name: TextInputInterface;
|
|
21
|
-
placeholder:
|
|
16
|
+
placeholder: CodeNodeInterface<undefined>;
|
|
22
17
|
};
|
|
23
18
|
outputs: {
|
|
24
|
-
|
|
25
|
-
output: NodeInterface<undefined>;
|
|
19
|
+
output: CodeNodeInterface<undefined>;
|
|
26
20
|
};
|
|
27
21
|
}
|
package/package.json
CHANGED
package/.vscode/extensions.json
DELETED