@linkdlab/funcnodes_react_flow 0.1.1 → 0.1.2
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/frontend/datarenderer/images.d.ts +11 -0
- package/dist/frontend/datarenderer/images.js +13 -0
- package/dist/frontend/datarenderer/images.js.map +1 -0
- package/dist/frontend/datarenderer/index.d.ts +16 -0
- package/dist/frontend/datarenderer/index.js +26 -0
- package/dist/frontend/datarenderer/index.js.map +1 -0
- package/dist/frontend/datarenderer/plotly.d.ts +14 -0
- package/dist/frontend/datarenderer/plotly.js +53 -0
- package/dist/frontend/datarenderer/plotly.js.map +1 -0
- package/dist/frontend/dialog.d.ts +17 -0
- package/dist/frontend/dialog.js +26 -0
- package/dist/frontend/dialog.js.map +1 -0
- package/dist/frontend/edge.d.ts +5 -0
- package/dist/frontend/edge.js +40 -0
- package/dist/frontend/edge.js.map +1 -0
- package/dist/frontend/funcnodesreactflow/index.d.ts +6 -0
- package/dist/frontend/funcnodesreactflow/index.js +94 -0
- package/dist/frontend/funcnodesreactflow/index.js.map +1 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.d.ts +5 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.js +149 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.js.map +1 -0
- package/dist/frontend/header/index.d.ts +4 -0
- package/dist/frontend/header/index.js +227 -0
- package/dist/frontend/header/index.js.map +1 -0
- package/{module/src/frontend/index.tsx → dist/frontend/index.d.ts} +1 -2
- package/dist/frontend/index.js +4 -0
- package/dist/frontend/index.js.map +1 -0
- package/dist/frontend/lib.d.ts +10 -0
- package/dist/frontend/lib.js +107 -0
- package/dist/frontend/lib.js.map +1 -0
- package/{module/src/frontend/node/index.tsx → dist/frontend/node/index.d.ts} +0 -1
- package/dist/frontend/node/index.js +3 -0
- package/dist/frontend/node/index.js.map +1 -0
- package/dist/frontend/node/io/default_input_renderer.d.ts +11 -0
- package/dist/frontend/node/io/default_input_renderer.js +235 -0
- package/dist/frontend/node/io/default_input_renderer.js.map +1 -0
- package/dist/frontend/node/io/default_output_render.d.ts +6 -0
- package/dist/frontend/node/io/default_output_render.js +23 -0
- package/dist/frontend/node/io/default_output_render.js.map +1 -0
- package/dist/frontend/node/io/handle_renderer.d.ts +6 -0
- package/dist/frontend/node/io/handle_renderer.js +70 -0
- package/dist/frontend/node/io/handle_renderer.js.map +1 -0
- package/{module/src/frontend/node/io/index.tsx → dist/frontend/node/io/index.d.ts} +0 -1
- package/dist/frontend/node/io/index.js +4 -0
- package/dist/frontend/node/io/index.js.map +1 -0
- package/dist/frontend/node/io/io.d.ts +16 -0
- package/dist/frontend/node/io/io.js +98 -0
- package/dist/frontend/node/io/io.js.map +1 -0
- package/dist/frontend/node/io/nodeinput.d.ts +6 -0
- package/dist/frontend/node/io/nodeinput.js +74 -0
- package/dist/frontend/node/io/nodeinput.js.map +1 -0
- package/dist/frontend/node/io/nodeoutput.d.ts +6 -0
- package/dist/frontend/node/io/nodeoutput.js +19 -0
- package/dist/frontend/node/io/nodeoutput.js.map +1 -0
- package/dist/frontend/node/node.d.ts +20 -0
- package/dist/frontend/node/node.js +118 -0
- package/dist/frontend/node/node.js.map +1 -0
- package/dist/frontend/utils/colorpicker.d.ts +19 -0
- package/dist/frontend/utils/colorpicker.js +209 -0
- package/dist/frontend/utils/colorpicker.js.map +1 -0
- package/dist/frontend/utils/jsondata.d.ts +6 -0
- package/dist/frontend/utils/jsondata.js +8 -0
- package/dist/frontend/utils/jsondata.js.map +1 -0
- package/dist/frontend/utils/table.d.ts +11 -0
- package/dist/frontend/utils/table.js +108 -0
- package/dist/frontend/utils/table.js.map +1 -0
- package/dist/funcnodes/funcnodesworker.d.ts +72 -0
- package/dist/funcnodes/funcnodesworker.js +532 -0
- package/dist/funcnodes/funcnodesworker.js.map +1 -0
- package/dist/funcnodes/index.js +5 -0
- package/dist/funcnodes/index.js.map +1 -0
- package/dist/funcnodes/websocketworker.d.ts +27 -0
- package/dist/funcnodes/websocketworker.js +224 -0
- package/dist/funcnodes/websocketworker.js.map +1 -0
- package/dist/funcnodes/workermanager.d.ts +32 -0
- package/dist/funcnodes/workermanager.js +241 -0
- package/dist/funcnodes/workermanager.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/states/edge.d.ts +7 -0
- package/dist/states/edge.js +6 -0
- package/dist/states/edge.js.map +1 -0
- package/{module/src/states/edge.t.ts → dist/states/edge.t.d.ts} +8 -12
- package/dist/states/edge.t.js +2 -0
- package/dist/states/edge.t.js.map +1 -0
- package/dist/states/fnrfzst.d.ts +10 -0
- package/dist/states/fnrfzst.js +378 -0
- package/dist/states/fnrfzst.js.map +1 -0
- package/dist/states/fnrfzst.t.d.ts +100 -0
- package/dist/states/fnrfzst.t.js +2 -0
- package/dist/states/fnrfzst.t.js.map +1 -0
- package/dist/states/index.js +6 -0
- package/dist/states/index.js.map +1 -0
- package/dist/states/lib.d.ts +3 -0
- package/dist/states/lib.js +14 -0
- package/dist/states/lib.js.map +1 -0
- package/dist/states/lib.t.d.ts +24 -0
- package/dist/states/lib.t.js +2 -0
- package/dist/states/lib.t.js.map +1 -0
- package/dist/states/node.d.ts +4 -0
- package/dist/states/node.js +43 -0
- package/dist/states/node.js.map +1 -0
- package/{module/src/states/node.t.ts → dist/states/node.t.d.ts} +33 -58
- package/dist/states/node.t.js +2 -0
- package/dist/states/node.t.js.map +1 -0
- package/dist/states/nodeio.t.d.ts +67 -0
- package/dist/states/nodeio.t.js +2 -0
- package/dist/states/nodeio.t.js.map +1 -0
- package/dist/states/nodespace.d.ts +3 -0
- package/{module/src/states/nodespace.ts → dist/states/nodespace.js} +17 -30
- package/dist/states/nodespace.js.map +1 -0
- package/dist/states/nodespace.t.d.ts +16 -0
- package/dist/states/nodespace.t.js +2 -0
- package/dist/states/nodespace.t.js.map +1 -0
- package/dist/states/reactflow.d.ts +8 -0
- package/dist/states/reactflow.js +33 -0
- package/dist/states/reactflow.js.map +1 -0
- package/dist/states/reactflow.t.d.ts +11 -0
- package/dist/states/reactflow.t.js +2 -0
- package/dist/states/reactflow.t.js.map +1 -0
- package/{module/src/types/rendering.t.ts → dist/types/rendering.t.d.ts} +4 -7
- package/dist/types/rendering.t.js +2 -0
- package/dist/types/rendering.t.js.map +1 -0
- package/{module/src/utils/index.ts → dist/utils/index.d.ts} +0 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/objects.d.ts +19 -0
- package/dist/utils/objects.js +118 -0
- package/dist/utils/objects.js.map +1 -0
- package/package.json +32 -23
- package/app/public/favicon.ico +0 -0
- package/app/public/index.html +0 -43
- package/app/public/logo192.png +0 -0
- package/app/public/logo512.png +0 -0
- package/app/public/manifest.json +0 -25
- package/app/public/robots.txt +0 -3
- package/app/public/worker_manager +0 -1
- package/app/src/App.css +0 -38
- package/app/src/App.test.tsx +0 -9
- package/app/src/App.tsx +0 -22
- package/app/src/index.css +0 -13
- package/app/src/index.tsx +0 -19
- package/app/src/react-app-env.d.ts +0 -1
- package/app/src/reportWebVitals.ts +0 -15
- package/app/src/setupTests.ts +0 -5
- package/app/tsconfig.app.json +0 -10
- package/app/webpack.config.js +0 -143
- package/module/src/frontend/datarenderer/images.tsx +0 -28
- package/module/src/frontend/datarenderer/index.tsx +0 -54
- package/module/src/frontend/datarenderer/plotly.tsx +0 -82
- package/module/src/frontend/dialog.scss +0 -88
- package/module/src/frontend/dialog.tsx +0 -71
- package/module/src/frontend/edge.scss +0 -15
- package/module/src/frontend/edge.tsx +0 -32
- package/module/src/frontend/funcnodesreactflow/funcnodesreactflow.scss +0 -63
- package/module/src/frontend/funcnodesreactflow/index.tsx +0 -68
- package/module/src/frontend/funcnodesreactflow/react_flow_layer.tsx +0 -212
- package/module/src/frontend/header/header.scss +0 -48
- package/module/src/frontend/header/index.tsx +0 -269
- package/module/src/frontend/layout/htmlelements.scss +0 -63
- package/module/src/frontend/lib.scss +0 -157
- package/module/src/frontend/lib.tsx +0 -199
- package/module/src/frontend/node/io/default_input_renderer.tsx +0 -329
- package/module/src/frontend/node/io/default_output_render.tsx +0 -25
- package/module/src/frontend/node/io/handle_renderer.tsx +0 -94
- package/module/src/frontend/node/io/io.scss +0 -91
- package/module/src/frontend/node/io/io.tsx +0 -115
- package/module/src/frontend/node/io/nodeinput.tsx +0 -127
- package/module/src/frontend/node/io/nodeoutput.tsx +0 -43
- package/module/src/frontend/node/node.scss +0 -265
- package/module/src/frontend/node/node.tsx +0 -209
- package/module/src/frontend/utils/colorpicker.scss +0 -37
- package/module/src/frontend/utils/colorpicker.tsx +0 -342
- package/module/src/frontend/utils/jsondata.tsx +0 -19
- package/module/src/frontend/utils/table.scss +0 -22
- package/module/src/frontend/utils/table.tsx +0 -160
- package/module/src/funcnodes/funcnodesworker.ts +0 -456
- package/module/src/funcnodes/websocketworker.ts +0 -152
- package/module/src/funcnodes/workermanager.ts +0 -233
- package/module/src/index.tsx +0 -4
- package/module/src/states/edge.ts +0 -15
- package/module/src/states/fnrfzst.t.ts +0 -117
- package/module/src/states/fnrfzst.ts +0 -415
- package/module/src/states/lib.t.ts +0 -30
- package/module/src/states/lib.ts +0 -16
- package/module/src/states/node.ts +0 -46
- package/module/src/states/nodeio.t.ts +0 -103
- package/module/src/states/nodespace.t.ts +0 -57
- package/module/src/states/reactflow.t.ts +0 -27
- package/module/src/states/reactflow.ts +0 -49
- package/module/src/types/funcnodesreactflow.d.ts +0 -1
- package/module/src/utils/objects.ts +0 -131
- package/module/tsconfig.module.json +0 -15
- package/module/webpack.config.js +0 -140
- package/tsconfig.json +0 -18
- /package/{module/src/funcnodes/index.ts → dist/funcnodes/index.d.ts} +0 -0
- /package/{module/src/states/index.ts → dist/states/index.d.ts} +0 -0
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FuncNodesReactFlowZustandInterface,
|
|
3
|
-
ProgressStateMessage,
|
|
4
|
-
WorkersState,
|
|
5
|
-
} from "../states/fnrfzst.t";
|
|
6
|
-
import FuncNodesWorker from "./funcnodesworker";
|
|
7
|
-
import WebSocketWorker from "./websocketworker";
|
|
8
|
-
|
|
9
|
-
class WorkerManager {
|
|
10
|
-
private wsuri: string;
|
|
11
|
-
private workers: any;
|
|
12
|
-
private ws: WebSocket | null = null;
|
|
13
|
-
private reconnectAttempts: number = 0;
|
|
14
|
-
private maxReconnectAttempts: number = 999;
|
|
15
|
-
private initialTimeout: number = 200; // Initial reconnect delay in ms
|
|
16
|
-
private maxTimeout: number = 2000; // Maximum reconnect delay
|
|
17
|
-
private zustand: FuncNodesReactFlowZustandInterface;
|
|
18
|
-
private connectionTimeout?: NodeJS.Timeout;
|
|
19
|
-
on_setWorker: (worker: FuncNodesWorker | undefined) => void;
|
|
20
|
-
constructor(wsuri: string, zustand: FuncNodesReactFlowZustandInterface) {
|
|
21
|
-
this.wsuri = wsuri;
|
|
22
|
-
this.zustand = zustand;
|
|
23
|
-
this.workers = {};
|
|
24
|
-
this.on_setWorker = (worker: FuncNodesWorker | undefined) => {
|
|
25
|
-
console.log("WorkerManager: on_setWorker", worker);
|
|
26
|
-
this.zustand.worker = worker;
|
|
27
|
-
};
|
|
28
|
-
this.connect();
|
|
29
|
-
}
|
|
30
|
-
private connect(): void {
|
|
31
|
-
this.zustand.set_progress({
|
|
32
|
-
progress: 0,
|
|
33
|
-
message: "connecting to worker manager",
|
|
34
|
-
status: "info",
|
|
35
|
-
blocking: true,
|
|
36
|
-
});
|
|
37
|
-
console.log("Connecting to websocket:", this.wsuri);
|
|
38
|
-
this.ws = new WebSocket(this.wsuri);
|
|
39
|
-
|
|
40
|
-
this.ws.onopen = () => {
|
|
41
|
-
this.onopen();
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
this.ws.onclose = () => {
|
|
45
|
-
this.onclose();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
this.ws.onerror = () => {
|
|
49
|
-
this.on_ws_error();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
this.ws.onmessage = (event) => {
|
|
53
|
-
this.onmessage(event.data);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
this.connectionTimeout = setTimeout(() => {
|
|
57
|
-
if (this.ws?.readyState !== WebSocket.OPEN) {
|
|
58
|
-
this.on_ws_error();
|
|
59
|
-
}
|
|
60
|
-
}, 5000);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
on_ws_error() {
|
|
64
|
-
console.warn("Websocket error");
|
|
65
|
-
if (this.ws) {
|
|
66
|
-
this.ws.close(); // Ensure the connection is closed before attempting to reconnect
|
|
67
|
-
} else {
|
|
68
|
-
this.reconnect();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
onopen() {
|
|
73
|
-
if (this.connectionTimeout) {
|
|
74
|
-
clearTimeout(this.connectionTimeout);
|
|
75
|
-
this.connectionTimeout = undefined;
|
|
76
|
-
}
|
|
77
|
-
this.zustand.auto_progress();
|
|
78
|
-
console.log("WorkerManager: onopen");
|
|
79
|
-
if (this.ws) {
|
|
80
|
-
this.ws.send("worker_status");
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Get active worker from window storage
|
|
84
|
-
const active_worker = window.localStorage.getItem(
|
|
85
|
-
"funcnodes__active_worker"
|
|
86
|
-
);
|
|
87
|
-
if (active_worker) {
|
|
88
|
-
this.set_active(active_worker);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
onmessage(event: string) {
|
|
92
|
-
let msg = JSON.parse(event);
|
|
93
|
-
if (msg.type === "worker_status") {
|
|
94
|
-
console.debug("WorkerManager: worker_status", msg);
|
|
95
|
-
const new_state: WorkersState = {};
|
|
96
|
-
for (let worker of msg.active) {
|
|
97
|
-
worker.active = true;
|
|
98
|
-
new_state[worker.uuid] = worker;
|
|
99
|
-
}
|
|
100
|
-
for (let worker of msg.inactive) {
|
|
101
|
-
worker.active = false;
|
|
102
|
-
new_state[worker.uuid] = worker;
|
|
103
|
-
}
|
|
104
|
-
this.zustand.workers.setState(new_state);
|
|
105
|
-
return;
|
|
106
|
-
} else if (msg.type === "set_worker") {
|
|
107
|
-
if (msg.data.type === "WSWorker") {
|
|
108
|
-
let url =
|
|
109
|
-
"ws" +
|
|
110
|
-
(msg.data.ssl ? "s" : "") +
|
|
111
|
-
"://" +
|
|
112
|
-
msg.data.host +
|
|
113
|
-
":" +
|
|
114
|
-
msg.data.port;
|
|
115
|
-
this.setWorker(
|
|
116
|
-
this.workers[msg.data.uuid] ||
|
|
117
|
-
new WebSocketWorker({
|
|
118
|
-
url,
|
|
119
|
-
zustand: this.zustand,
|
|
120
|
-
uuid: msg.data.uuid,
|
|
121
|
-
})
|
|
122
|
-
);
|
|
123
|
-
} else {
|
|
124
|
-
console.error("WorkerManager: unknown worker type", msg);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
//store active worker in window storage
|
|
128
|
-
|
|
129
|
-
return;
|
|
130
|
-
} else if (msg.type === "progress") {
|
|
131
|
-
this.zustand.set_progress(msg as ProgressStateMessage);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
console.error("WorkerManager: unknown message", msg);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
setWorker(worker: FuncNodesWorker | undefined) {
|
|
138
|
-
for (let w in this.workers) {
|
|
139
|
-
if (w !== worker?.uuid) {
|
|
140
|
-
this.workers[w].disconnect();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (worker !== undefined) {
|
|
144
|
-
this.workers[worker.uuid] = worker;
|
|
145
|
-
worker.reconnect();
|
|
146
|
-
}
|
|
147
|
-
window.localStorage.setItem("funcnodes__active_worker", worker?.uuid || "");
|
|
148
|
-
if (this.zustand.worker !== undefined) {
|
|
149
|
-
this.zustand.clear_all();
|
|
150
|
-
}
|
|
151
|
-
this.zustand.worker = worker;
|
|
152
|
-
this.on_setWorker(worker);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async restart_worker(workerid: string) {
|
|
156
|
-
this.ws?.send(JSON.stringify({ type: "restart_worker", workerid }));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
private calculateReconnectTimeout(): number {
|
|
160
|
-
// Increase timeout exponentially, capped at maxTimeout
|
|
161
|
-
let timeout = Math.min(
|
|
162
|
-
this.initialTimeout * Math.pow(2, this.reconnectAttempts),
|
|
163
|
-
this.maxTimeout
|
|
164
|
-
);
|
|
165
|
-
return timeout;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
private reconnect(): void {
|
|
169
|
-
if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
170
|
-
let timeout = this.calculateReconnectTimeout();
|
|
171
|
-
console.log(`Attempting to reconnect in ${timeout} ms`);
|
|
172
|
-
|
|
173
|
-
setTimeout(() => {
|
|
174
|
-
if (this.ws) {
|
|
175
|
-
if (this.ws.readyState === WebSocket.OPEN) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
this.reconnectAttempts++;
|
|
180
|
-
this.connect();
|
|
181
|
-
}, timeout);
|
|
182
|
-
} else {
|
|
183
|
-
console.warn("Maximum reconnect attempts reached. Giving up.");
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
onclose() {
|
|
188
|
-
console.log("WorkerManager: onclose");
|
|
189
|
-
this.reconnect(); // Attempt to reconnect
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
set_active(workerid: string) {
|
|
193
|
-
if (!this.ws) return;
|
|
194
|
-
this.ws.send(JSON.stringify({ type: "set_active", workerid }));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
new_worker({
|
|
198
|
-
name,
|
|
199
|
-
reference,
|
|
200
|
-
copyLib,
|
|
201
|
-
copyNS,
|
|
202
|
-
}: {
|
|
203
|
-
name?: string;
|
|
204
|
-
reference?: string;
|
|
205
|
-
copyLib?: boolean;
|
|
206
|
-
copyNS?: boolean;
|
|
207
|
-
}) {
|
|
208
|
-
if (!name) name = undefined;
|
|
209
|
-
if (!copyLib) copyLib = false;
|
|
210
|
-
if (!copyNS) copyNS = false;
|
|
211
|
-
if (!reference) {
|
|
212
|
-
reference = undefined;
|
|
213
|
-
copyLib = false;
|
|
214
|
-
copyNS = false;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (this.ws) {
|
|
218
|
-
this.ws.send(
|
|
219
|
-
JSON.stringify({
|
|
220
|
-
type: "new_worker",
|
|
221
|
-
kwargs: {
|
|
222
|
-
name,
|
|
223
|
-
reference,
|
|
224
|
-
copyLib,
|
|
225
|
-
copyNS,
|
|
226
|
-
},
|
|
227
|
-
})
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export default WorkerManager;
|
package/module/src/index.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const generate_edge_id = ({
|
|
2
|
-
src_nid,
|
|
3
|
-
src_ioid,
|
|
4
|
-
trg_nid,
|
|
5
|
-
trg_ioid,
|
|
6
|
-
}: {
|
|
7
|
-
src_nid: string;
|
|
8
|
-
src_ioid: string;
|
|
9
|
-
trg_nid: string;
|
|
10
|
-
trg_ioid: string;
|
|
11
|
-
}) => {
|
|
12
|
-
return [`${src_nid}:${src_ioid}`, `${trg_nid}:${trg_ioid}`].sort().join("--");
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { generate_edge_id };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { StoreApi, UseBoundStore } from "zustand";
|
|
2
|
-
import { FuncNodesWorker, WorkerManager } from "../funcnodes";
|
|
3
|
-
import { LibType, LibZustandInterface } from "./lib.t";
|
|
4
|
-
import { NodeSpaceZustandInterface } from "./nodespace.t";
|
|
5
|
-
import { NodeAction, NodeType } from "./node.t";
|
|
6
|
-
import { RFStore } from "./reactflow.t";
|
|
7
|
-
import { EdgeAction } from "./edge.t";
|
|
8
|
-
import { useReactFlow } from "reactflow";
|
|
9
|
-
|
|
10
|
-
interface RenderOptions {
|
|
11
|
-
typemap?: { [key: string]: string };
|
|
12
|
-
inputconverter?: { [key: string]: string };
|
|
13
|
-
}
|
|
14
|
-
interface NodeViewState {
|
|
15
|
-
pos: [number, number];
|
|
16
|
-
size: [number, number];
|
|
17
|
-
collapsed: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface ViewState {
|
|
20
|
-
nodes: { [key: string]: NodeViewState };
|
|
21
|
-
renderoptions?: RenderOptions;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface FullNodeSpaceJSON {
|
|
25
|
-
nodes: NodeType[];
|
|
26
|
-
edges: [string, string, string, string][];
|
|
27
|
-
prop: { [key: string]: any };
|
|
28
|
-
lib: LibType;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface FullState {
|
|
32
|
-
backend: FullNodeSpaceJSON;
|
|
33
|
-
view: ViewState;
|
|
34
|
-
worker: { [key: string]: string[] };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface ProgressState {
|
|
38
|
-
message: string;
|
|
39
|
-
status: string;
|
|
40
|
-
progress: number;
|
|
41
|
-
blocking: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface ProgressStateMessage extends ProgressState {
|
|
45
|
-
type: "progress";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface ResultMessage {
|
|
49
|
-
type: "result";
|
|
50
|
-
id?: string;
|
|
51
|
-
result: any;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface ErrorMessage {
|
|
55
|
-
type: "error";
|
|
56
|
-
error: string;
|
|
57
|
-
tb: string[];
|
|
58
|
-
id?: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface NodeSpaceEvent {
|
|
62
|
-
type: "nsevent";
|
|
63
|
-
event: string;
|
|
64
|
-
data: { [key: string]: any };
|
|
65
|
-
}
|
|
66
|
-
type JSONMessage =
|
|
67
|
-
| ProgressStateMessage
|
|
68
|
-
| ResultMessage
|
|
69
|
-
| ErrorMessage
|
|
70
|
-
| NodeSpaceEvent;
|
|
71
|
-
|
|
72
|
-
interface WorkerRepresentation {
|
|
73
|
-
uuid: string;
|
|
74
|
-
host: string;
|
|
75
|
-
port: number;
|
|
76
|
-
ssl: boolean;
|
|
77
|
-
active: boolean;
|
|
78
|
-
name: string | null;
|
|
79
|
-
}
|
|
80
|
-
interface WorkersState {
|
|
81
|
-
[key: string]: WorkerRepresentation;
|
|
82
|
-
}
|
|
83
|
-
interface FuncNodesReactFlowZustandInterface {
|
|
84
|
-
lib: LibZustandInterface;
|
|
85
|
-
workermanager: WorkerManager | undefined;
|
|
86
|
-
workers: UseBoundStore<StoreApi<WorkersState>>;
|
|
87
|
-
worker: FuncNodesWorker | undefined;
|
|
88
|
-
nodespace: NodeSpaceZustandInterface;
|
|
89
|
-
useReactFlowStore: RFStore;
|
|
90
|
-
render_options: UseBoundStore<StoreApi<RenderOptions>>;
|
|
91
|
-
progress_state: UseBoundStore<StoreApi<ProgressState>>;
|
|
92
|
-
update_render_options: (options: RenderOptions) => void;
|
|
93
|
-
rf_instance?: ReturnType<typeof useReactFlow>;
|
|
94
|
-
on_node_action: (action: NodeAction) => void;
|
|
95
|
-
on_edge_action: (edge: EdgeAction) => void;
|
|
96
|
-
set_progress: (progress: ProgressState) => void;
|
|
97
|
-
auto_progress: () => void;
|
|
98
|
-
reactflowRef: HTMLDivElement | null;
|
|
99
|
-
clear_all: () => void;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type {
|
|
103
|
-
FuncNodesReactFlowZustandInterface,
|
|
104
|
-
WorkersState,
|
|
105
|
-
WorkerRepresentation,
|
|
106
|
-
JSONMessage,
|
|
107
|
-
FullState,
|
|
108
|
-
FullNodeSpaceJSON,
|
|
109
|
-
ViewState,
|
|
110
|
-
RenderOptions,
|
|
111
|
-
ProgressState,
|
|
112
|
-
ProgressStateMessage,
|
|
113
|
-
ResultMessage,
|
|
114
|
-
ErrorMessage,
|
|
115
|
-
NodeSpaceEvent,
|
|
116
|
-
NodeViewState,
|
|
117
|
-
};
|