@dskripchenko/flow 0.0.0-stage → 1.0.1
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/CHANGELOG.md +82 -0
- package/LICENSE +21 -0
- package/README.md +87 -2
- package/dist/core-DfJMfClV.js +4121 -0
- package/dist/core-dyjNI9N1.cjs +4522 -0
- package/dist/index.cjs +69 -0
- package/dist/index.d.ts +767 -0
- package/dist/index.mjs +1 -0
- package/dist/mermaid.cjs +222 -0
- package/dist/mermaid.d.ts +107 -0
- package/dist/mermaid.mjs +220 -0
- package/dist/standalone.css +2 -0
- package/dist/standalone.js +14 -0
- package/dist/style.css +1119 -0
- package/dist/vue.cjs +5836 -0
- package/dist/vue.d.ts +1041 -0
- package/dist/vue.mjs +5823 -0
- package/package.json +122 -4
- package/schema/graph.schema.json +95 -0
- package/schema/snapshot.schema.json +35 -0
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { AppContext } from 'vue';
|
|
3
|
+
import { Component } from 'vue';
|
|
4
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
5
|
+
import { ComponentProvideOptions } from 'vue';
|
|
6
|
+
import { ComputedRef } from 'vue';
|
|
7
|
+
import { DefineComponent } from 'vue';
|
|
8
|
+
import { PublicProps } from 'vue';
|
|
9
|
+
import { Ref } from 'vue';
|
|
10
|
+
import { ShallowRef } from 'vue';
|
|
11
|
+
|
|
12
|
+
declare const __VLS_base: DefineComponent<__VLS_Props, {
|
|
13
|
+
fit: () => void | undefined;
|
|
14
|
+
enter: typeof enter;
|
|
15
|
+
back: typeof back;
|
|
16
|
+
refresh: () => void | undefined;
|
|
17
|
+
select: (id: string | null) => void;
|
|
18
|
+
stack: ShallowRef<NavigationLevel[], NavigationLevel[]>;
|
|
19
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
20
|
+
select: (element: (ElementRef & {
|
|
21
|
+
element: FlowNode | FlowEdge;
|
|
22
|
+
path: string[];
|
|
23
|
+
}) | null) => any;
|
|
24
|
+
toggle: (change: ToggleChange) => any;
|
|
25
|
+
"update:minimap": (value: boolean) => any;
|
|
26
|
+
"toggle-error": (change: ToggleChange, error: unknown) => any;
|
|
27
|
+
navigate: (stack: NavigationLevel[]) => any;
|
|
28
|
+
"poll-error": (error: unknown) => any;
|
|
29
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
onSelect?: ((element: (ElementRef & {
|
|
31
|
+
element: FlowNode | FlowEdge;
|
|
32
|
+
path: string[];
|
|
33
|
+
}) | null) => any) | undefined;
|
|
34
|
+
onToggle?: ((change: ToggleChange) => any) | undefined;
|
|
35
|
+
"onUpdate:minimap"?: ((value: boolean) => any) | undefined;
|
|
36
|
+
"onToggle-error"?: ((change: ToggleChange, error: unknown) => any) | undefined;
|
|
37
|
+
onNavigate?: ((stack: NavigationLevel[]) => any) | undefined;
|
|
38
|
+
"onPoll-error"?: ((error: unknown) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
state: MonitorSnapshot | MonitorState;
|
|
41
|
+
direction: "TB" | "LR" | "auto";
|
|
42
|
+
wheel: "zoom" | "pan";
|
|
43
|
+
onToggle: (change: ToggleChange) => Promise<unknown> | unknown;
|
|
44
|
+
minimap: boolean;
|
|
45
|
+
details: boolean;
|
|
46
|
+
labels: Partial<FlowLabels>;
|
|
47
|
+
registry: NodeTypeRegistry;
|
|
48
|
+
edgeStyle: "orthogonal" | "smooth";
|
|
49
|
+
controls: boolean;
|
|
50
|
+
minZoom: number;
|
|
51
|
+
maxZoom: number;
|
|
52
|
+
nodeRenderers: Record<string, Component>;
|
|
53
|
+
nodeIcons: Record<string, Component>;
|
|
54
|
+
statusTones: Record<string, string>;
|
|
55
|
+
locale: string;
|
|
56
|
+
poll: PollOptions;
|
|
57
|
+
pollParams: undefined;
|
|
58
|
+
staleAfterMs: number;
|
|
59
|
+
subgraphs: Record<string, Graph>;
|
|
60
|
+
loadSubgraph: (ref: string, node: FlowNode) => Promise<Graph>;
|
|
61
|
+
toastProvider: boolean;
|
|
62
|
+
statusBar: boolean;
|
|
63
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
|
|
65
|
+
declare const __VLS_base_2: DefineComponent<__VLS_Props_2, {
|
|
66
|
+
fit: typeof fit;
|
|
67
|
+
zoomIn: () => void;
|
|
68
|
+
zoomOut: () => void;
|
|
69
|
+
zoomTo: (k: number) => void;
|
|
70
|
+
centreOn: (id: string) => void;
|
|
71
|
+
focusElement: typeof focusElement;
|
|
72
|
+
clientToGraph: (clientX: number, clientY: number) => Point;
|
|
73
|
+
viewCentre: () => {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
};
|
|
77
|
+
layout: ComputedRef<GraphLayout>;
|
|
78
|
+
nodeBoxes: ComputedRef<Map<string, NodeGeometry>>;
|
|
79
|
+
root: Ref<HTMLElement | null, HTMLElement | null>;
|
|
80
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
81
|
+
contextmenu: (payload: ContextPayload) => any;
|
|
82
|
+
select: (ids: string[], primary: ElementRef | null) => any;
|
|
83
|
+
toggle: (change: {
|
|
84
|
+
kind: "node" | "edge";
|
|
85
|
+
id: string;
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
}) => any;
|
|
88
|
+
enter: (nodeId: string) => any;
|
|
89
|
+
"update:minimap": (value: boolean) => any;
|
|
90
|
+
activate: (ref: ElementRef) => any;
|
|
91
|
+
move: (moves: {
|
|
92
|
+
id: string;
|
|
93
|
+
position: Point;
|
|
94
|
+
}[], merge?: string | undefined) => any;
|
|
95
|
+
connect: (payload: ConnectPayload) => any;
|
|
96
|
+
reconnect: (payload: ReconnectPayload) => any;
|
|
97
|
+
detach: (edgeId: string) => any;
|
|
98
|
+
"background-dblclick": (point: Point) => any;
|
|
99
|
+
escape: () => any;
|
|
100
|
+
"focus-change": (id: string | null) => any;
|
|
101
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
102
|
+
onContextmenu?: ((payload: ContextPayload) => any) | undefined;
|
|
103
|
+
onSelect?: ((ids: string[], primary: ElementRef | null) => any) | undefined;
|
|
104
|
+
onToggle?: ((change: {
|
|
105
|
+
kind: "node" | "edge";
|
|
106
|
+
id: string;
|
|
107
|
+
enabled: boolean;
|
|
108
|
+
}) => any) | undefined;
|
|
109
|
+
onEnter?: ((nodeId: string) => any) | undefined;
|
|
110
|
+
"onUpdate:minimap"?: ((value: boolean) => any) | undefined;
|
|
111
|
+
onActivate?: ((ref: ElementRef) => any) | undefined;
|
|
112
|
+
onMove?: ((moves: {
|
|
113
|
+
id: string;
|
|
114
|
+
position: Point;
|
|
115
|
+
}[], merge?: string | undefined) => any) | undefined;
|
|
116
|
+
onConnect?: ((payload: ConnectPayload) => any) | undefined;
|
|
117
|
+
onReconnect?: ((payload: ReconnectPayload) => any) | undefined;
|
|
118
|
+
onDetach?: ((edgeId: string) => any) | undefined;
|
|
119
|
+
"onBackground-dblclick"?: ((point: Point) => any) | undefined;
|
|
120
|
+
onEscape?: (() => any) | undefined;
|
|
121
|
+
"onFocus-change"?: ((id: string | null) => any) | undefined;
|
|
122
|
+
}>, {
|
|
123
|
+
direction: "TB" | "LR" | "auto";
|
|
124
|
+
wheel: "zoom" | "pan";
|
|
125
|
+
minimap: boolean;
|
|
126
|
+
issues: ReadonlyMap<string, "error" | "warning">;
|
|
127
|
+
drillable: (node: FlowNode) => boolean;
|
|
128
|
+
selection: readonly string[];
|
|
129
|
+
registry: NodeTypeRegistry;
|
|
130
|
+
edgeStyle: "orthogonal" | "smooth";
|
|
131
|
+
monitor: MonitorState;
|
|
132
|
+
enabledOverrides: ReadonlyMap<string, boolean>;
|
|
133
|
+
snapGrid: number;
|
|
134
|
+
controls: boolean;
|
|
135
|
+
minZoom: number;
|
|
136
|
+
maxZoom: number;
|
|
137
|
+
nodeRenderers: Record<string, Component>;
|
|
138
|
+
nodeIcons: Record<string, Component>;
|
|
139
|
+
statusTones: Record<string, string>;
|
|
140
|
+
fitKey: string | number;
|
|
141
|
+
isLocked: (node: FlowNode) => boolean;
|
|
142
|
+
ariaLabel: string;
|
|
143
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
144
|
+
|
|
145
|
+
declare const __VLS_base_3: DefineComponent<__VLS_Props_4, {
|
|
146
|
+
undo: typeof undo;
|
|
147
|
+
redo: typeof redo;
|
|
148
|
+
autoLayout: typeof autoLayout;
|
|
149
|
+
fit: () => void | undefined;
|
|
150
|
+
select: typeof select;
|
|
151
|
+
history: History_2;
|
|
152
|
+
issues: ComputedRef<Issue[]>;
|
|
153
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
154
|
+
change: (event: ChangeEvent) => any;
|
|
155
|
+
select: (ids: string[]) => any;
|
|
156
|
+
"update:modelValue": (graph: Graph) => any;
|
|
157
|
+
validate: (issues: Issue[]) => any;
|
|
158
|
+
export: (json: string) => any;
|
|
159
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
160
|
+
onChange?: ((event: ChangeEvent) => any) | undefined;
|
|
161
|
+
onSelect?: ((ids: string[]) => any) | undefined;
|
|
162
|
+
"onUpdate:modelValue"?: ((graph: Graph) => any) | undefined;
|
|
163
|
+
onValidate?: ((issues: Issue[]) => any) | undefined;
|
|
164
|
+
onExport?: ((json: string) => any) | undefined;
|
|
165
|
+
}>, {
|
|
166
|
+
direction: "TB" | "LR" | "auto";
|
|
167
|
+
minimap: boolean;
|
|
168
|
+
palette: string[];
|
|
169
|
+
locked: string[];
|
|
170
|
+
labels: Partial<FlowLabels>;
|
|
171
|
+
registry: NodeTypeRegistry;
|
|
172
|
+
edgeStyle: "orthogonal" | "smooth";
|
|
173
|
+
snapGrid: number;
|
|
174
|
+
nodeRenderers: Record<string, Component>;
|
|
175
|
+
nodeIcons: Record<string, Component>;
|
|
176
|
+
locale: string;
|
|
177
|
+
toastProvider: boolean;
|
|
178
|
+
mermaid: (source: string) => Graph;
|
|
179
|
+
readonly: boolean;
|
|
180
|
+
exportName: string;
|
|
181
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
182
|
+
|
|
183
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
184
|
+
|
|
185
|
+
declare const __VLS_export_2: __VLS_WithSlots_2<typeof __VLS_base_2, __VLS_Slots_2>;
|
|
186
|
+
|
|
187
|
+
declare const __VLS_export_3: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
188
|
+
enter: () => any;
|
|
189
|
+
}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
|
|
190
|
+
onEnter?: (() => any) | undefined;
|
|
191
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
192
|
+
|
|
193
|
+
declare const __VLS_export_4: __VLS_WithSlots_3<typeof __VLS_base_3, __VLS_Slots_3>;
|
|
194
|
+
|
|
195
|
+
declare type __VLS_Props = {
|
|
196
|
+
graph: Graph;
|
|
197
|
+
/**
|
|
198
|
+
* Monitoring for the displayed graph: a snapshot or a reduced state. With
|
|
199
|
+
* `poll` it is the initial value (e.g. rendered by the server): polled
|
|
200
|
+
* snapshots replace it. A new `state` always takes over.
|
|
201
|
+
*/
|
|
202
|
+
state?: MonitorSnapshot | MonitorState;
|
|
203
|
+
/** Poll a monitoring endpoint. */
|
|
204
|
+
poll?: PollOptions;
|
|
205
|
+
/**
|
|
206
|
+
* Host parameters handed to `poll.fetch` as `context.params` (an instance
|
|
207
|
+
* id, a filter…). A change restarts polling at once, dropping the old data.
|
|
208
|
+
*/
|
|
209
|
+
pollParams?: unknown;
|
|
210
|
+
/** After how long without data the overlay warns; 3 poll intervals (min 15 s) by default. */
|
|
211
|
+
staleAfterMs?: number;
|
|
212
|
+
toggleable?: boolean;
|
|
213
|
+
/** Persists a toggle; a rejection rolls it back and shows an error. */
|
|
214
|
+
onToggle?: (change: ToggleChange) => Promise<unknown> | unknown;
|
|
215
|
+
/** Graphs for string `subgraph` references. */
|
|
216
|
+
subgraphs?: Record<string, Graph>;
|
|
217
|
+
/** Loads a string `subgraph` reference not found in `subgraphs`. */
|
|
218
|
+
loadSubgraph?: (ref: string, node: FlowNode) => Promise<Graph>;
|
|
219
|
+
/** The built-in details drawer; set false to handle `select` yourself. */
|
|
220
|
+
details?: boolean;
|
|
221
|
+
minimap?: boolean;
|
|
222
|
+
controls?: boolean;
|
|
223
|
+
/** Layout direction; `auto` (the default without `meta.direction`) follows the canvas shape. */
|
|
224
|
+
direction?: 'TB' | 'LR' | 'auto';
|
|
225
|
+
/** `orthogonal` (right angles, the default) or `smooth` (curves). */
|
|
226
|
+
edgeStyle?: 'orthogonal' | 'smooth';
|
|
227
|
+
registry?: NodeTypeRegistry;
|
|
228
|
+
nodeRenderers?: Record<string, Component>;
|
|
229
|
+
nodeIcons?: Record<string, Component>;
|
|
230
|
+
statusTones?: Record<string, string>;
|
|
231
|
+
/** Interface language; by default the host's kit locale (a parent UidLocaleProvider), else English. Setting it also sets the kit's locale inside. */
|
|
232
|
+
locale?: 'en' | 'ru' | string;
|
|
233
|
+
labels?: Partial<FlowLabels>;
|
|
234
|
+
wheel?: 'zoom' | 'pan';
|
|
235
|
+
minZoom?: number;
|
|
236
|
+
maxZoom?: number;
|
|
237
|
+
/** Mount the kit's toast provider (set false when the app already has one). */
|
|
238
|
+
toastProvider?: boolean;
|
|
239
|
+
/** A status line with the last update, staleness and a summary. */
|
|
240
|
+
statusBar?: boolean;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
declare type __VLS_Props_2 = {
|
|
244
|
+
graph: Graph;
|
|
245
|
+
labels: FlowLabels;
|
|
246
|
+
registry?: NodeTypeRegistry;
|
|
247
|
+
/** `auto` (the default without `meta.direction`) picks LR for a landscape canvas and TB for a portrait one. */
|
|
248
|
+
direction?: 'TB' | 'LR' | 'auto';
|
|
249
|
+
/** `orthogonal` (right angles, the default) or `smooth` (curves). */
|
|
250
|
+
edgeStyle?: 'orthogonal' | 'smooth';
|
|
251
|
+
monitor?: MonitorState;
|
|
252
|
+
/** Room beside edge labels for counters (keeps layout stable once counters arrive). */
|
|
253
|
+
reserveCounters?: boolean;
|
|
254
|
+
selection?: readonly string[];
|
|
255
|
+
/** Element id → worst issue severity. */
|
|
256
|
+
issues?: ReadonlyMap<string, 'error' | 'warning'>;
|
|
257
|
+
editable?: boolean;
|
|
258
|
+
toggleable?: boolean;
|
|
259
|
+
/** Ids whose enabled flag is overridden (optimistic toggles). */
|
|
260
|
+
enabledOverrides?: ReadonlyMap<string, boolean>;
|
|
261
|
+
/** Node types whose nodes the editor must not change. */
|
|
262
|
+
snapGrid?: number;
|
|
263
|
+
minimap?: boolean;
|
|
264
|
+
controls?: boolean;
|
|
265
|
+
minZoom?: number;
|
|
266
|
+
maxZoom?: number;
|
|
267
|
+
wheel?: 'zoom' | 'pan';
|
|
268
|
+
nodeRenderers?: Record<string, Component>;
|
|
269
|
+
nodeIcons?: Record<string, Component>;
|
|
270
|
+
statusTones?: Record<string, string>;
|
|
271
|
+
/** Changing it fits the graph to the view (navigation). */
|
|
272
|
+
fitKey?: string | number;
|
|
273
|
+
/** Subgraph ids the host can open (drill-down affordance). */
|
|
274
|
+
drillable?: (node: FlowNode) => boolean;
|
|
275
|
+
/** Nodes the editor must not move. */
|
|
276
|
+
isLocked?: (node: FlowNode) => boolean;
|
|
277
|
+
ariaLabel?: string;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
declare type __VLS_Props_3 = {
|
|
281
|
+
node: FlowNode;
|
|
282
|
+
geometry: NodeGeometry;
|
|
283
|
+
def: NodeTypeDef;
|
|
284
|
+
run?: NodeRunState;
|
|
285
|
+
tone?: string;
|
|
286
|
+
disabled?: boolean;
|
|
287
|
+
selected?: boolean;
|
|
288
|
+
focused?: boolean;
|
|
289
|
+
current?: boolean;
|
|
290
|
+
onPath?: boolean;
|
|
291
|
+
issue?: 'error' | 'warning';
|
|
292
|
+
drillable?: boolean;
|
|
293
|
+
icon?: Component;
|
|
294
|
+
labels: FlowLabels;
|
|
295
|
+
/** Where a start/end label goes: under the circle (LR) or to its right (TB). */
|
|
296
|
+
labelSide?: 'below' | 'right';
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
declare type __VLS_Props_4 = {
|
|
300
|
+
modelValue: Graph;
|
|
301
|
+
registry?: NodeTypeRegistry;
|
|
302
|
+
/** Node types offered in the palette; all of the registry by default. */
|
|
303
|
+
palette?: string[];
|
|
304
|
+
readonly?: boolean;
|
|
305
|
+
/** Node types users cannot move, edit or delete (on top of `locked: true` in the registry). */
|
|
306
|
+
locked?: string[];
|
|
307
|
+
snapGrid?: number;
|
|
308
|
+
/** Layout direction; `auto` (the default without `meta.direction`) follows the canvas shape. */
|
|
309
|
+
direction?: 'TB' | 'LR' | 'auto';
|
|
310
|
+
/** `orthogonal` (right angles, the default) or `smooth` (curves). */
|
|
311
|
+
edgeStyle?: 'orthogonal' | 'smooth';
|
|
312
|
+
nodeRenderers?: Record<string, Component>;
|
|
313
|
+
nodeIcons?: Record<string, Component>;
|
|
314
|
+
/** Interface language; by default the host's kit locale (a parent UidLocaleProvider), else English. Setting it also sets the kit's locale inside. */
|
|
315
|
+
locale?: 'en' | 'ru' | string;
|
|
316
|
+
labels?: Partial<FlowLabels>;
|
|
317
|
+
minimap?: boolean;
|
|
318
|
+
/** Enables "Import Mermaid": pass `fromMermaid` from `@dskripchenko/flow/mermaid`. */
|
|
319
|
+
mermaid?: (source: string) => Graph;
|
|
320
|
+
toastProvider?: boolean;
|
|
321
|
+
/** File name for "Export JSON". */
|
|
322
|
+
exportName?: string;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
declare type __VLS_Slots = {
|
|
326
|
+
/** Extra content in the details drawer (history, actions). */
|
|
327
|
+
details?(props: {
|
|
328
|
+
kind: 'node' | 'edge';
|
|
329
|
+
element: FlowNode | FlowEdge;
|
|
330
|
+
state?: MonitorState;
|
|
331
|
+
path: string[];
|
|
332
|
+
}): unknown;
|
|
333
|
+
/** Custom content of the details drawer header. */
|
|
334
|
+
'details-header'?(props: {
|
|
335
|
+
kind: 'node' | 'edge';
|
|
336
|
+
element: FlowNode | FlowEdge;
|
|
337
|
+
}): unknown;
|
|
338
|
+
/** Extra controls in the corner bar. */
|
|
339
|
+
controls?(): unknown;
|
|
340
|
+
/** Replaces the empty-graph message. */
|
|
341
|
+
empty?(): unknown;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
declare type __VLS_Slots_2 = {
|
|
345
|
+
/** Extra buttons at the end of the controls bar. */
|
|
346
|
+
controls?(): unknown;
|
|
347
|
+
/** HTML overlays above the canvas (breadcrumb, status). */
|
|
348
|
+
overlay?(): unknown;
|
|
349
|
+
/** Shown instead of the graph when it has no nodes. */
|
|
350
|
+
empty?(): unknown;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
declare type __VLS_Slots_3 = {
|
|
354
|
+
/** Extra content at the end of the toolbar. */
|
|
355
|
+
toolbar?(): unknown;
|
|
356
|
+
/** Extra content under the properties of the selection. */
|
|
357
|
+
properties?(props: {
|
|
358
|
+
selection: string[];
|
|
359
|
+
graph: Graph;
|
|
360
|
+
path: string[];
|
|
361
|
+
}): unknown;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
declare type __VLS_WithSlots<T, S> = T & {
|
|
365
|
+
new (): {
|
|
366
|
+
$slots: S;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
declare type __VLS_WithSlots_2<T, S> = T & {
|
|
371
|
+
new (): {
|
|
372
|
+
$slots: S;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
declare type __VLS_WithSlots_3<T, S> = T & {
|
|
377
|
+
new (): {
|
|
378
|
+
$slots: S;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
declare interface Anchor {
|
|
383
|
+
point: Point;
|
|
384
|
+
side: PortSide;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare function autoLayout(): void;
|
|
388
|
+
|
|
389
|
+
declare function back(): void;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* A framework-agnostic poller: calls `fetch` every `intervalMs`, pauses while
|
|
393
|
+
* the page is hidden, backs off after errors, and aborts the request in
|
|
394
|
+
* flight on stop. One request at a time; the next one is scheduled after the
|
|
395
|
+
* previous settles, so a slow endpoint is never hit twice at once.
|
|
396
|
+
*/
|
|
397
|
+
declare interface BackoffOptions {
|
|
398
|
+
/** Multiplier per consecutive failure; 2 by default. */
|
|
399
|
+
factor?: number;
|
|
400
|
+
/** Upper bound of the delay; 60 s by default. */
|
|
401
|
+
maxMs?: number;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** Built-in node types; any other string is a custom type from a registry. */
|
|
405
|
+
declare type BuiltinNodeType = 'start' | 'end' | 'state' | 'task' | 'decision' | 'subprocess' | 'note';
|
|
406
|
+
|
|
407
|
+
export declare interface ChangeEvent {
|
|
408
|
+
/** The command at the root of the model (sub-process edits arrive as an `updateNode` of their node). */
|
|
409
|
+
command: Command;
|
|
410
|
+
/** The same command at the level it was made, and that level's path of node ids. */
|
|
411
|
+
local: {
|
|
412
|
+
command: Command;
|
|
413
|
+
path: string[];
|
|
414
|
+
};
|
|
415
|
+
description: string;
|
|
416
|
+
graph: Graph;
|
|
417
|
+
/** `undo` / `redo` when the change came from history. */
|
|
418
|
+
source: 'edit' | 'undo' | 'redo';
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare type Command = {
|
|
422
|
+
type: 'addNodes';
|
|
423
|
+
nodes: FlowNode[];
|
|
424
|
+
edges?: FlowEdge[];
|
|
425
|
+
} | {
|
|
426
|
+
type: 'removeElements';
|
|
427
|
+
ids: string[];
|
|
428
|
+
} | {
|
|
429
|
+
type: 'updateNode';
|
|
430
|
+
id: string;
|
|
431
|
+
patch: Patch<Omit<FlowNode, 'id'>>;
|
|
432
|
+
} | {
|
|
433
|
+
type: 'moveNodes';
|
|
434
|
+
moves: {
|
|
435
|
+
id: string;
|
|
436
|
+
position: Point;
|
|
437
|
+
}[];
|
|
438
|
+
} | {
|
|
439
|
+
type: 'addEdge';
|
|
440
|
+
edge: FlowEdge;
|
|
441
|
+
} | {
|
|
442
|
+
type: 'updateEdge';
|
|
443
|
+
id: string;
|
|
444
|
+
patch: Patch<Omit<FlowEdge, 'id'>>;
|
|
445
|
+
} | {
|
|
446
|
+
type: 'setEnabled';
|
|
447
|
+
kind: Exclude<ElementKind, 'group'>;
|
|
448
|
+
id: string;
|
|
449
|
+
enabled: boolean;
|
|
450
|
+
} | {
|
|
451
|
+
type: 'addGroup';
|
|
452
|
+
group: FlowGroup;
|
|
453
|
+
} | {
|
|
454
|
+
type: 'updateGroup';
|
|
455
|
+
id: string;
|
|
456
|
+
patch: Patch<Omit<FlowGroup, 'id'>>;
|
|
457
|
+
} | {
|
|
458
|
+
type: 'updateMeta';
|
|
459
|
+
patch: Record<string, unknown>;
|
|
460
|
+
} | {
|
|
461
|
+
type: 'replace';
|
|
462
|
+
graph: Graph;
|
|
463
|
+
} | {
|
|
464
|
+
type: 'batch';
|
|
465
|
+
commands: Command[];
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
export declare interface ConnectPayload {
|
|
469
|
+
from: string;
|
|
470
|
+
to: string;
|
|
471
|
+
fromPort?: string;
|
|
472
|
+
toPort?: string;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export declare interface ContextPayload {
|
|
476
|
+
target: ElementRef | null;
|
|
477
|
+
/** Graph coordinates. */
|
|
478
|
+
point: Point;
|
|
479
|
+
/** Client coordinates, for placing a menu. */
|
|
480
|
+
client: Point;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** Data values a node or an edge carries for the host: shown as key/value. */
|
|
484
|
+
declare type DataValue = string | number | boolean | null | DataValue[] | {
|
|
485
|
+
[key: string]: DataValue;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
declare type Direction = 'TB' | 'LR';
|
|
489
|
+
|
|
490
|
+
declare interface EdgeGeometry {
|
|
491
|
+
id: string;
|
|
492
|
+
d: string;
|
|
493
|
+
/** The polyline the path follows. */
|
|
494
|
+
points: Point[];
|
|
495
|
+
from: Anchor;
|
|
496
|
+
to: Anchor;
|
|
497
|
+
label?: {
|
|
498
|
+
x: number;
|
|
499
|
+
y: number;
|
|
500
|
+
width: number;
|
|
501
|
+
height: number;
|
|
502
|
+
lines: string[];
|
|
503
|
+
};
|
|
504
|
+
selfLoop?: boolean;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
declare interface EdgeRunState {
|
|
508
|
+
count?: number;
|
|
509
|
+
traversed?: boolean;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
declare type ElementKind = 'node' | 'edge' | 'group';
|
|
513
|
+
|
|
514
|
+
/** A reference to one element of a graph. */
|
|
515
|
+
declare interface ElementRef {
|
|
516
|
+
kind: ElementKind;
|
|
517
|
+
id: string;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export declare const en: FlowLabels;
|
|
521
|
+
|
|
522
|
+
declare function enter(nodeId: string): Promise<void>;
|
|
523
|
+
|
|
524
|
+
/** Shows the whole graph (the fit button). */
|
|
525
|
+
declare function fit(smooth?: boolean): void;
|
|
526
|
+
|
|
527
|
+
export declare const FlowCanvas: typeof __VLS_export_2;
|
|
528
|
+
|
|
529
|
+
declare interface FlowEdge {
|
|
530
|
+
id: string;
|
|
531
|
+
from: string;
|
|
532
|
+
to: string;
|
|
533
|
+
fromPort?: string;
|
|
534
|
+
toPort?: string;
|
|
535
|
+
label?: string;
|
|
536
|
+
/** A guard or condition, shown in the details and, when there is no label, on the edge. */
|
|
537
|
+
condition?: string;
|
|
538
|
+
enabled?: boolean;
|
|
539
|
+
/** `association` is a dashed line without an arrow (a note to its node). */
|
|
540
|
+
kind?: 'transition' | 'association';
|
|
541
|
+
data?: Record<string, DataValue>;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export declare const FlowEditor: typeof __VLS_export_4;
|
|
545
|
+
|
|
546
|
+
export declare interface FlowEditorHandle extends FlowHandle {
|
|
547
|
+
/** The model as edited so far. */
|
|
548
|
+
getGraph(): Graph;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
declare interface FlowGroup {
|
|
552
|
+
id: string;
|
|
553
|
+
label?: string;
|
|
554
|
+
/** The enclosing group. */
|
|
555
|
+
parent?: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export declare interface FlowHandle {
|
|
559
|
+
/** The app created for the component; undefined when mounted into a host `appContext`. */
|
|
560
|
+
app?: App;
|
|
561
|
+
/** Merges new props (a new `graph`, `state`, …) into the mounted component. */
|
|
562
|
+
update(props: Record<string, unknown>): void;
|
|
563
|
+
unmount(): void;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Interface strings. English and Russian ship with the package; a host passes
|
|
568
|
+
* `labels` to override any of them, or a whole dictionary for another language.
|
|
569
|
+
*/
|
|
570
|
+
export declare interface FlowLabels {
|
|
571
|
+
graph: string;
|
|
572
|
+
zoomIn: string;
|
|
573
|
+
zoomOut: string;
|
|
574
|
+
fit: string;
|
|
575
|
+
minimap: string;
|
|
576
|
+
root: string;
|
|
577
|
+
back: string;
|
|
578
|
+
enter: string;
|
|
579
|
+
details: string;
|
|
580
|
+
enabled: string;
|
|
581
|
+
disabledTag: string;
|
|
582
|
+
id: string;
|
|
583
|
+
type: string;
|
|
584
|
+
status: string;
|
|
585
|
+
count: string;
|
|
586
|
+
instances: string;
|
|
587
|
+
traversed: string;
|
|
588
|
+
data: string;
|
|
589
|
+
condition: string;
|
|
590
|
+
from: string;
|
|
591
|
+
to: string;
|
|
592
|
+
message: string;
|
|
593
|
+
subprocess: string;
|
|
594
|
+
updated: string;
|
|
595
|
+
updatedJustNow: string;
|
|
596
|
+
updatedAgo: (seconds: number) => string;
|
|
597
|
+
stale: string;
|
|
598
|
+
paused: string;
|
|
599
|
+
live: string;
|
|
600
|
+
loading: string;
|
|
601
|
+
loadError: string;
|
|
602
|
+
retry: string;
|
|
603
|
+
refresh: string;
|
|
604
|
+
toggleFailed: string;
|
|
605
|
+
subgraphFailed: string;
|
|
606
|
+
currentPath: string;
|
|
607
|
+
empty: string;
|
|
608
|
+
emptyHint: string;
|
|
609
|
+
statuses: Record<string, string>;
|
|
610
|
+
types: Record<string, string>;
|
|
611
|
+
editor: string;
|
|
612
|
+
palette: string;
|
|
613
|
+
paletteHint: string;
|
|
614
|
+
properties: string;
|
|
615
|
+
issues: string;
|
|
616
|
+
noIssues: string;
|
|
617
|
+
issueCount: (errors: number, warnings: number) => string;
|
|
618
|
+
undo: string;
|
|
619
|
+
redo: string;
|
|
620
|
+
delete: string;
|
|
621
|
+
duplicate: string;
|
|
622
|
+
copy: string;
|
|
623
|
+
paste: string;
|
|
624
|
+
cut: string;
|
|
625
|
+
selectAll: string;
|
|
626
|
+
autoLayout: string;
|
|
627
|
+
align: string;
|
|
628
|
+
alignLeft: string;
|
|
629
|
+
alignCenter: string;
|
|
630
|
+
alignRight: string;
|
|
631
|
+
alignTop: string;
|
|
632
|
+
alignMiddle: string;
|
|
633
|
+
alignBottom: string;
|
|
634
|
+
distributeH: string;
|
|
635
|
+
distributeV: string;
|
|
636
|
+
snapToGrid: string;
|
|
637
|
+
more: string;
|
|
638
|
+
exportJson: string;
|
|
639
|
+
importJson: string;
|
|
640
|
+
importMermaid: string;
|
|
641
|
+
importApply: string;
|
|
642
|
+
importPlaceholderJson: string;
|
|
643
|
+
importPlaceholderMermaid: string;
|
|
644
|
+
importError: string;
|
|
645
|
+
cancel: string;
|
|
646
|
+
label: string;
|
|
647
|
+
description: string;
|
|
648
|
+
nodeType: string;
|
|
649
|
+
edgeKind: string;
|
|
650
|
+
transition: string;
|
|
651
|
+
association: string;
|
|
652
|
+
subgraphRef: string;
|
|
653
|
+
subgraphInline: (nodes: number) => string;
|
|
654
|
+
subgraphCreate: string;
|
|
655
|
+
subgraphOpen: string;
|
|
656
|
+
subgraphRemove: string;
|
|
657
|
+
addField: string;
|
|
658
|
+
key: string;
|
|
659
|
+
value: string;
|
|
660
|
+
removeField: string;
|
|
661
|
+
locked: string;
|
|
662
|
+
nothingSelected: string;
|
|
663
|
+
selectedCount: (n: number) => string;
|
|
664
|
+
graphTitle: string;
|
|
665
|
+
direction: string;
|
|
666
|
+
directionLR: string;
|
|
667
|
+
directionTB: string;
|
|
668
|
+
directionAuto: string;
|
|
669
|
+
addStart: string;
|
|
670
|
+
enable: string;
|
|
671
|
+
transitions: string;
|
|
672
|
+
addTransition: string;
|
|
673
|
+
disable: string;
|
|
674
|
+
addHere: string;
|
|
675
|
+
connectHint: string;
|
|
676
|
+
emptyEditorTitle: string;
|
|
677
|
+
emptyEditorHint: string;
|
|
678
|
+
edge: string;
|
|
679
|
+
node: string;
|
|
680
|
+
group: string;
|
|
681
|
+
readOnly: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
declare interface FlowNode {
|
|
685
|
+
id: string;
|
|
686
|
+
type: NodeType;
|
|
687
|
+
label?: string;
|
|
688
|
+
/** The node's centre. Nodes without one are placed by the auto layout. */
|
|
689
|
+
position?: Point;
|
|
690
|
+
/** The group (frame) the node sits in. */
|
|
691
|
+
group?: string;
|
|
692
|
+
data?: Record<string, DataValue>;
|
|
693
|
+
/** `false` disables the node: drawn dimmed and struck through. Enabled by default. */
|
|
694
|
+
enabled?: boolean;
|
|
695
|
+
/**
|
|
696
|
+
* The node's own process: an inline graph, or a reference the host resolves
|
|
697
|
+
* (`subgraphs` prop or `loadSubgraph`). Makes the node drillable.
|
|
698
|
+
*/
|
|
699
|
+
subgraph?: string | Graph;
|
|
700
|
+
/** Overrides the type's ports. */
|
|
701
|
+
ports?: Port[];
|
|
702
|
+
/** A short secondary line under the label. */
|
|
703
|
+
description?: string;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export declare const FlowNodeShape: typeof __VLS_export_3;
|
|
707
|
+
|
|
708
|
+
export declare const FlowView: typeof __VLS_export;
|
|
709
|
+
|
|
710
|
+
declare function focusElement(id: string): void;
|
|
711
|
+
|
|
712
|
+
declare interface Graph {
|
|
713
|
+
version: typeof GRAPH_VERSION;
|
|
714
|
+
nodes: FlowNode[];
|
|
715
|
+
edges: FlowEdge[];
|
|
716
|
+
groups?: FlowGroup[];
|
|
717
|
+
meta?: GraphMeta;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/** The model format this package reads and writes. */
|
|
721
|
+
declare const GRAPH_VERSION = 1;
|
|
722
|
+
|
|
723
|
+
declare interface GraphLayout {
|
|
724
|
+
direction: Direction;
|
|
725
|
+
routing: Routing;
|
|
726
|
+
nodes: Map<string, NodeGeometry>;
|
|
727
|
+
edges: Map<string, EdgeGeometry>;
|
|
728
|
+
groups: Map<string, GroupGeometry>;
|
|
729
|
+
/** Waypoints the layered layout chose, by edge; valid while both ends stay put. */
|
|
730
|
+
waypoints: Map<string, Point[]>;
|
|
731
|
+
bounds: {
|
|
732
|
+
x: number;
|
|
733
|
+
y: number;
|
|
734
|
+
width: number;
|
|
735
|
+
height: number;
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
declare interface GraphMeta {
|
|
740
|
+
title?: string;
|
|
741
|
+
/** Auto-layout direction; `LR` by default. */
|
|
742
|
+
direction?: 'TB' | 'LR';
|
|
743
|
+
[key: string]: DataValue | undefined;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
declare interface GroupGeometry extends NodeBox {
|
|
747
|
+
id: string;
|
|
748
|
+
label?: string;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
declare class History_2 {
|
|
752
|
+
private current;
|
|
753
|
+
private past;
|
|
754
|
+
private future;
|
|
755
|
+
private readonly limit;
|
|
756
|
+
private readonly mergeWindow;
|
|
757
|
+
private readonly now;
|
|
758
|
+
constructor(current: Graph, options?: HistoryOptions);
|
|
759
|
+
get graph(): Graph;
|
|
760
|
+
get canUndo(): boolean;
|
|
761
|
+
get canRedo(): boolean;
|
|
762
|
+
/** The entry `undo` would revert. */
|
|
763
|
+
get last(): HistoryEntry | undefined;
|
|
764
|
+
get next(): HistoryEntry | undefined;
|
|
765
|
+
/** Applies a command and records it. Throws CommandError and records nothing when it does not apply. */
|
|
766
|
+
execute(command: Command, mergeKey?: string): Graph;
|
|
767
|
+
undo(): HistoryEntry | undefined;
|
|
768
|
+
redo(): HistoryEntry | undefined;
|
|
769
|
+
/**
|
|
770
|
+
* Takes a graph from outside (the host changed the model). When it is the
|
|
771
|
+
* one history already holds, nothing happens; otherwise history restarts.
|
|
772
|
+
*/
|
|
773
|
+
reset(graph: Graph): void;
|
|
774
|
+
/** Ends merging: the next command starts a new entry even with the same key. */
|
|
775
|
+
seal(): void;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
declare interface HistoryEntry {
|
|
779
|
+
command: Command;
|
|
780
|
+
before: Graph;
|
|
781
|
+
after: Graph;
|
|
782
|
+
/** Entries with the same key in a row merge into one (a drag, arrow nudges). */
|
|
783
|
+
mergeKey?: string;
|
|
784
|
+
at: number;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
declare interface HistoryOptions {
|
|
788
|
+
/** Entries kept; 200 by default. */
|
|
789
|
+
limit?: number;
|
|
790
|
+
/** Merge window for entries with the same `mergeKey`, ms; 800 by default. */
|
|
791
|
+
mergeWindowMs?: number;
|
|
792
|
+
now?: () => number;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
declare interface Issue {
|
|
796
|
+
severity: IssueSeverity;
|
|
797
|
+
code: IssueCode;
|
|
798
|
+
message: string;
|
|
799
|
+
/** The element the issue is about, when there is one. */
|
|
800
|
+
target?: {
|
|
801
|
+
kind: ElementKind;
|
|
802
|
+
id: string;
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
declare type IssueCode = 'duplicate-id' | 'unknown-node' | 'unknown-port' | 'unknown-group' | 'group-cycle' | 'unknown-type' | 'missing-start' | 'missing-end' | 'start-incoming' | 'end-outgoing' | 'unreachable' | 'dead-end' | 'empty-label';
|
|
807
|
+
|
|
808
|
+
declare type IssueSeverity = 'error' | 'warning';
|
|
809
|
+
|
|
810
|
+
export declare const LOCALES: Readonly<Record<'en' | 'ru', FlowLabels>>;
|
|
811
|
+
|
|
812
|
+
export declare type MonitorApi = ReturnType<typeof useMonitor>;
|
|
813
|
+
|
|
814
|
+
/** One snapshot from the host: the JSON a monitoring endpoint returns. */
|
|
815
|
+
declare interface MonitorSnapshot {
|
|
816
|
+
nodes?: Record<string, NodeRunState>;
|
|
817
|
+
edges?: Record<string, EdgeRunState>;
|
|
818
|
+
/** The current instance's path: node ids in the order visited. */
|
|
819
|
+
path?: string[];
|
|
820
|
+
/** Nodes the current instance is in now. */
|
|
821
|
+
current?: string[];
|
|
822
|
+
/** When the host produced the snapshot (ISO or epoch ms). */
|
|
823
|
+
updatedAt?: string | number;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
declare interface MonitorState extends Required<Pick<MonitorSnapshot, 'nodes' | 'edges'>> {
|
|
827
|
+
path?: string[];
|
|
828
|
+
current?: string[];
|
|
829
|
+
/** Epoch ms of the last snapshot received. */
|
|
830
|
+
receivedAt?: number;
|
|
831
|
+
/** Epoch ms the host stamped on the last snapshot, if it did. */
|
|
832
|
+
updatedAt?: number;
|
|
833
|
+
/** The last polling error, cleared by the next snapshot. */
|
|
834
|
+
error?: string;
|
|
835
|
+
/** Errors in a row. */
|
|
836
|
+
failures: number;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export declare function mountFlow(target: string | Element, options: MountFlowOptions): FlowHandle;
|
|
840
|
+
|
|
841
|
+
export declare function mountFlowEditor(target: string | Element, options: MountFlowEditorOptions): FlowEditorHandle;
|
|
842
|
+
|
|
843
|
+
/** The props of FlowEditor; `modelValue` is the initial model, kept in sync by the handle. */
|
|
844
|
+
export declare interface MountFlowEditorOptions {
|
|
845
|
+
modelValue: Graph;
|
|
846
|
+
/** As in MountFlowOptions. */
|
|
847
|
+
appContext?: AppContext;
|
|
848
|
+
[prop: string]: unknown;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/** The props of FlowView, plus event handlers as `on*` functions (`onSelect`, `onToggle`…). */
|
|
852
|
+
export declare interface MountFlowOptions {
|
|
853
|
+
graph: Graph;
|
|
854
|
+
/**
|
|
855
|
+
* Render inside this Vue app's context (from `getCurrentInstance()!.appContext`
|
|
856
|
+
* or `app._context`) instead of a new app: the host's provides, plugins and
|
|
857
|
+
* global components (kit locale and theme, i18n, router) reach the component.
|
|
858
|
+
*/
|
|
859
|
+
appContext?: AppContext;
|
|
860
|
+
[prop: string]: unknown;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export declare interface NavigationLevel {
|
|
864
|
+
/** The sub-process node entered (empty for the root). */
|
|
865
|
+
nodeId: string;
|
|
866
|
+
label: string;
|
|
867
|
+
/** The node's `subgraph` when it is a reference. */
|
|
868
|
+
ref?: string;
|
|
869
|
+
graph: Graph;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export declare const NODE_ICONS: Readonly<Record<string, Component>>;
|
|
873
|
+
|
|
874
|
+
declare interface NodeBox {
|
|
875
|
+
/** Centre. */
|
|
876
|
+
x: number;
|
|
877
|
+
y: number;
|
|
878
|
+
width: number;
|
|
879
|
+
height: number;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
declare interface NodeGeometry extends NodeBox {
|
|
883
|
+
id: string;
|
|
884
|
+
lines: string[];
|
|
885
|
+
descriptionLines: string[];
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/** What a custom node renderer receives. */
|
|
889
|
+
export declare interface NodeRendererProps {
|
|
890
|
+
node: FlowNode;
|
|
891
|
+
geometry: NodeGeometry;
|
|
892
|
+
state?: MonitorState['nodes'][string];
|
|
893
|
+
selected: boolean;
|
|
894
|
+
disabled: boolean;
|
|
895
|
+
current: boolean;
|
|
896
|
+
labels: FlowLabels;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
declare interface NodeRunState {
|
|
900
|
+
status?: NodeStatus;
|
|
901
|
+
/** How many instances are in (or went through) the node. */
|
|
902
|
+
count?: number;
|
|
903
|
+
/** A short text or number on the node's corner (e.g. an error count). */
|
|
904
|
+
badge?: string | number;
|
|
905
|
+
/** A line for the details panel (e.g. the last error). */
|
|
906
|
+
message?: string;
|
|
907
|
+
/** ISO string or epoch milliseconds. */
|
|
908
|
+
updatedAt?: string | number;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/** Outlines the built-in renderer can draw. */
|
|
912
|
+
declare type NodeShape = 'rect' | 'rounded' | 'circle' | 'ring' | 'diamond' | 'note' | 'pill';
|
|
913
|
+
|
|
914
|
+
/** Built-in statuses; any other string is shown as a neutral status. */
|
|
915
|
+
declare type NodeStatus = 'active' | 'done' | 'error' | 'waiting' | 'skipped' | (string & {});
|
|
916
|
+
|
|
917
|
+
declare type NodeType = BuiltinNodeType | (string & {});
|
|
918
|
+
|
|
919
|
+
declare interface NodeTypeDef {
|
|
920
|
+
/** The type's name in the UI (palette, details). */
|
|
921
|
+
title: string;
|
|
922
|
+
shape: NodeShape;
|
|
923
|
+
/** A fixed size; otherwise the label decides the width between min and max. */
|
|
924
|
+
size?: {
|
|
925
|
+
width: number;
|
|
926
|
+
height: number;
|
|
927
|
+
};
|
|
928
|
+
minWidth?: number;
|
|
929
|
+
maxWidth?: number;
|
|
930
|
+
/** Minimum height; grows with wrapped label lines. */
|
|
931
|
+
height?: number;
|
|
932
|
+
/** Default ports; without them edges attach where they meet the outline. */
|
|
933
|
+
ports?: Port[];
|
|
934
|
+
/** An icon name the renderer maps to a glyph (`play`, `square`, `cog`, …). */
|
|
935
|
+
icon?: string;
|
|
936
|
+
/** The label is drawn outside the outline (start/end circles). */
|
|
937
|
+
labelOutside?: boolean;
|
|
938
|
+
/** Edges cannot end here (`start`) or start here (`end`). */
|
|
939
|
+
noIncoming?: boolean;
|
|
940
|
+
noOutgoing?: boolean;
|
|
941
|
+
/** Not part of the flow: no reachability or dead-end checks (`note`). */
|
|
942
|
+
annotation?: boolean;
|
|
943
|
+
/** The editor does not let a user change or delete nodes of this type. */
|
|
944
|
+
locked?: boolean;
|
|
945
|
+
/** The node can be drilled into (gets a "subgraph" field in the editor). */
|
|
946
|
+
drillable?: boolean;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
declare type NodeTypeRegistry = ReadonlyMap<string, NodeTypeDef>;
|
|
950
|
+
|
|
951
|
+
/** A patch sets fields; a field set to `null` is removed. */
|
|
952
|
+
declare type Patch<T> = {
|
|
953
|
+
[K in keyof T]?: T[K] | null;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
declare interface Point {
|
|
957
|
+
x: number;
|
|
958
|
+
y: number;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/** Where the viewer is: the node ids of the sub-processes entered, and the reference opened last. */
|
|
962
|
+
export declare interface PollContext {
|
|
963
|
+
/** Node ids from the root to the displayed graph; empty at the root. */
|
|
964
|
+
path: string[];
|
|
965
|
+
/** The `subgraph` reference of the displayed graph, when it was a string. */
|
|
966
|
+
ref?: string;
|
|
967
|
+
/** The host's `pollParams` (an instance id, a filter…); a change restarts polling at once. */
|
|
968
|
+
params?: unknown;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export declare interface PollOptions {
|
|
972
|
+
fetch: (signal: AbortSignal, context: PollContext) => Promise<MonitorSnapshot>;
|
|
973
|
+
intervalMs?: number;
|
|
974
|
+
backoff?: BackoffOptions | false;
|
|
975
|
+
/** Merge snapshots into the state instead of replacing it (for partial updates). */
|
|
976
|
+
merge?: boolean;
|
|
977
|
+
/** Pause while the page is hidden; on by default. */
|
|
978
|
+
visibilityPause?: boolean;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** A named connection point on a node's side. */
|
|
982
|
+
declare interface Port {
|
|
983
|
+
id: string;
|
|
984
|
+
side: PortSide;
|
|
985
|
+
/** Position along the side, 0…1 from its start (left or top); 0.5 by default. */
|
|
986
|
+
offset?: number;
|
|
987
|
+
/** `in` takes incoming edges only, `out` outgoing only; both by default. */
|
|
988
|
+
kind?: 'in' | 'out' | 'both';
|
|
989
|
+
label?: string;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
declare type PortSide = 'top' | 'right' | 'bottom' | 'left';
|
|
993
|
+
|
|
994
|
+
export declare interface ReconnectPayload {
|
|
995
|
+
id: string;
|
|
996
|
+
end: 'from' | 'to';
|
|
997
|
+
node: string;
|
|
998
|
+
port?: string;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
declare function redo(): void;
|
|
1002
|
+
|
|
1003
|
+
/** The dictionary for a locale, with the host's overrides on top. */
|
|
1004
|
+
export declare function resolveLabels(locale: string | undefined, overrides?: Partial<FlowLabels>): FlowLabels;
|
|
1005
|
+
|
|
1006
|
+
declare type Routing = 'spline' | 'orthogonal';
|
|
1007
|
+
|
|
1008
|
+
export declare const ru: FlowLabels;
|
|
1009
|
+
|
|
1010
|
+
declare function select(ids: string[]): void;
|
|
1011
|
+
|
|
1012
|
+
export declare const STATUS_ICONS: Readonly<Record<string, Component>>;
|
|
1013
|
+
|
|
1014
|
+
export declare interface ToggleChange {
|
|
1015
|
+
kind: 'node' | 'edge';
|
|
1016
|
+
id: string;
|
|
1017
|
+
enabled: boolean;
|
|
1018
|
+
/** Node ids of the sub-processes entered, root first; empty at the root. */
|
|
1019
|
+
path: string[];
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
declare function undo(): void;
|
|
1023
|
+
|
|
1024
|
+
export declare function useMonitor(options: {
|
|
1025
|
+
state: () => MonitorSnapshot | MonitorState | undefined;
|
|
1026
|
+
poll: () => PollOptions | undefined;
|
|
1027
|
+
context: () => PollContext;
|
|
1028
|
+
staleAfterMs: () => number | undefined;
|
|
1029
|
+
onError?: (error: unknown) => void;
|
|
1030
|
+
}): {
|
|
1031
|
+
state: ComputedRef<MonitorState | undefined>;
|
|
1032
|
+
loading: Ref<boolean, boolean>;
|
|
1033
|
+
paused: Ref<boolean, boolean>;
|
|
1034
|
+
stale: ComputedRef<boolean>;
|
|
1035
|
+
ageSeconds: ComputedRef<number | undefined>;
|
|
1036
|
+
now: Ref<number, number>;
|
|
1037
|
+
refresh: () => void | undefined;
|
|
1038
|
+
polling: ComputedRef<boolean>;
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
export { }
|