@fragiola/flow-angular 0.0.0-stage → 0.1.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.
@@ -0,0 +1,1839 @@
1
+ import { AnyTypes, AutoPanOptions, BackgroundPattern, BackgroundVariant, Connection, CreateId, EdgePath, EdgeToolbarPosition, FitPadding, FitViewPayload, FlowEdge, FlowEdgeInput, FlowEngine, FlowEngineEventOf, FlowEngineOptions, FlowFeatures, FlowModel, FlowNode, FlowNodeInput, FlowTypes, HandleSide, HandleType, InternalNode, KeyPressKeys, KeyPressTarget, NodeConnection, NodeData, NodeToolbarPosition, PartAttributes, Rect, RenderLayer, StaticGeometry, Viewport, XY, ZIndexMode } from "@fragiola/flow";
2
+ import * as i0 from "@angular/core";
3
+ import { DoCheck, OnInit, OutputEmitterRef, Signal } from "@angular/core";
4
+ export * from "@fragiola/flow";
5
+ /**
6
+ * What a reader depends on:
7
+ * - `view`: anything, the viewport included (the layers' lists, the background, toolbars);
8
+ * - `entity`: one node's or edge's own view (its place, path, attributes, `z-index`), which a
9
+ * viewport step leaves alone, so a pan or a zoom never reads it again. A viewport step does
10
+ * change the nodes' `z-index` while there are several render levels (`node-z-index-by`, the
11
+ * levels follow the drawn edges): then it counts as an entity change too.
12
+ */
13
+ type FlowValueScope = "view" | "entity";
14
+ /**
15
+ * The node or the edge an `entity` reader shows: a change that is only a measurement
16
+ * (nodes mounted, a node resized) tells it only when the measurement changed it (its node's box or
17
+ * measured state, its edge's path), not every node and edge on screen
18
+ */
19
+ interface FlowEntity {
20
+ readonly kind: "node" | "edge";
21
+ readonly id: string;
22
+ }
23
+ /** The counters of one root, read by its `flowValue` computeds */
24
+ interface FlowStore {
25
+ /** every change: a commit of the model, every engine notification (the context's `revision`) */
26
+ readonly view: Signal<number>;
27
+ /**
28
+ * a change of every node and edge: a commit that changed the lists (or another model), a
29
+ * gesture, a notification while there are (or were) several render levels, a measurement
30
+ * with a viewport change
31
+ */
32
+ readonly entity: Signal<number>;
33
+ /** a notification that was only a measurement: what an `entity` reader without one hears */
34
+ readonly measure: Signal<number>;
35
+ /**
36
+ * the counter of a node's or an edge's measurements while it has a reader (`acquire`), else
37
+ * `measure` (every measurement)
38
+ */
39
+ counterOf(entity: FlowEntity): Signal<number>;
40
+ /** a reader of a node or an edge: its record is kept until released */
41
+ acquire(entity: FlowEntity): () => void;
42
+ /** a commit of `model` (another model than the last one: everything changed) */
43
+ commit(model: AnyFlowModel): void;
44
+ /** the engine, once created: its notifications are told from then on; returns the remover */
45
+ attach(engine: AnyFlowEngine, notified: () => void): () => void;
46
+ }
47
+ /** The model as the parts see it: any registry, any features. */
48
+ type AnyFlowModel = FlowModel<AnyTypes, FlowFeatures>;
49
+ /** The engine as the parts see it: any registry, every feature's keys. */
50
+ type AnyFlowEngine = FlowEngine<AnyTypes, FlowFeatures>;
51
+ /** The context of a `[flowRoot]`. */
52
+ interface FlowContext {
53
+ /** the root's model: its `model` input, or the one it created */
54
+ readonly model: Signal<AnyFlowModel>;
55
+ /** the engine, once the root is rendered in a browser (`null` before, and after it is destroyed) */
56
+ readonly engine: Signal<AnyFlowEngine | null>;
57
+ /** the engine as apps see it: always there, forwarding to the engine once it exists */
58
+ readonly publicEngine: AnyFlowEngine;
59
+ /** the root's element: what renders outside the zoom (a toolbar) goes into it */
60
+ readonly rootElement: HTMLElement;
61
+ /**
62
+ * a number that changes on every commit of the model and every view change of the engine
63
+ * (`engine.adapter.subscribe`): every part reads the model and the engine through it, so it
64
+ * follows them (the model's state is never made reactive)
65
+ */
66
+ readonly revision: Signal<number>;
67
+ /**
68
+ * the counters behind `revision`, by scope (`flowValue`'s `entity` readers: a node's or an
69
+ * edge's own view, told no viewport-only step and only the measurements that changed it)
70
+ */
71
+ readonly store: FlowStore;
72
+ /**
73
+ * the root culls (`onlyRenderVisible`): before the engine exists (the first render) the
74
+ * layers render no node and no edge, where they would draw every one's static geometry
75
+ */
76
+ readonly culled: Signal<boolean>;
77
+ /**
78
+ * the flow's geometry from its document alone (`staticGeometry`, with the root's options)
79
+ * while there is no engine (the first render), `null` once there is: the parts draw the
80
+ * edges and place the nodes from it, as the engine will before it measures anything
81
+ */
82
+ readonly geometry: Signal<StaticGeometry | null>;
83
+ /** the levels the flow is drawn in (`render-layers`, or the static geometry's) */
84
+ readonly layers: Signal<readonly RenderLayer[]>;
85
+ }
86
+ /** The node of a `[flowNode]` (or a host bound with `injectNode`), for the parts inside it. */
87
+ interface NodeContext {
88
+ /** its node's id (`undefined` before its input is set) */
89
+ readonly nodeId: Signal<string | undefined>;
90
+ }
91
+ /** The edge of a `[flowEdge]`, for the parts inside it (its path, label, reconnect anchors). */
92
+ interface EdgeContext {
93
+ /** its edge's id (`undefined` before its input is set) */
94
+ readonly edgeId: Signal<string | undefined>;
95
+ }
96
+ /** The enclosing root's context, or a clear error outside one. */
97
+ declare function injectFlowContext(part: string): FlowContext;
98
+ /** The enclosing node's context, if any (a part given its own `nodeId` needs none). */
99
+ declare function injectNodeContext(): NodeContext | null;
100
+ interface BackgroundState {
101
+ /** the pattern's tile on the screen, at the current viewport */
102
+ readonly pattern: BackgroundPattern;
103
+ }
104
+ /**
105
+ * The flow's background (`data-flow-part="background"`), on the app's `<svg flowBackground>`
106
+ * inside `[flowRoot]`, before `[flowViewport]`: an SVG pattern of dots, lines or crosses that
107
+ * pans and zooms with the viewport (`background-pattern`), drawn by the directive inside it (a
108
+ * `pattern` `background-pattern`, its `background-mark`, a `rect` `background-fill`). The marks are
109
+ * drawn in `currentColor`: set the `color` (and the background itself) in your style.
110
+ */
111
+ export declare class FlowBackgroundDirective {
112
+ /** the marks: `dots` (default), `lines` or `cross` */
113
+ readonly variant: import("@angular/core").InputSignal<BackgroundVariant | undefined>;
114
+ /** the distance between two marks, in flow units; default 20 (`[x, y]` for two) */
115
+ readonly gap: import("@angular/core").InputSignal<number | readonly [number, number] | undefined>;
116
+ /** dots: a dot's diameter (flow units); lines: the stroke width (screen pixels); cross: a bar's length */
117
+ readonly size: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
118
+ /** the pattern's shift from the flow's origin, in flow units */
119
+ readonly offset: import("@angular/core").InputSignal<number | readonly [number, number] | undefined>;
120
+ private readonly context;
121
+ private readonly pattern;
122
+ /** what it draws (`#bg="flowBackground"`, then `bg.state().pattern`) */
123
+ readonly state: Signal<BackgroundState>;
124
+ constructor();
125
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowBackgroundDirective, never>;
126
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowBackgroundDirective, "[flowBackground]", ["flowBackground"], {
127
+ "variant": {
128
+ "alias": "variant";
129
+ "required": false;
130
+ "isSignal": true;
131
+ };
132
+ "gap": {
133
+ "alias": "gap";
134
+ "required": false;
135
+ "isSignal": true;
136
+ };
137
+ "size": {
138
+ "alias": "size";
139
+ "required": false;
140
+ "isSignal": true;
141
+ };
142
+ "offset": {
143
+ "alias": "offset";
144
+ "required": false;
145
+ "isSignal": true;
146
+ };
147
+ }, {}, never, never, true, never>;
148
+ }
149
+ interface ConnectionLineState {
150
+ /** the connection being drawn */
151
+ readonly connection: Connection;
152
+ /** the drop would add the edge: `data-valid` */
153
+ readonly valid: boolean;
154
+ /** the drop would be refused (`model.can("edge.add")`, a middleware's veto): `data-invalid` */
155
+ readonly invalid: boolean;
156
+ }
157
+ /**
158
+ * The connection being drawn (`data-flow-part="connection-line"`, `data-valid` / `data-invalid`,
159
+ * `connection()`), on the app's `<svg flowConnectionLine>` inside `[flowViewport]`: in the
160
+ * document only while a connection is under way. It draws what the app writes inside it in flow
161
+ * coordinates (`#line="flowConnectionLine"`, then `line.state()?.connection.path`), or, when the
162
+ * app writes no element, an unfilled path of the connection (`data-flow-part="connection-path"`).
163
+ */
164
+ export declare class FlowConnectionLineDirective {
165
+ private readonly context;
166
+ private readonly connection;
167
+ private readonly attributes;
168
+ /** the line's state (`null` while no connection is drawn) */
169
+ readonly state: Signal<ConnectionLineState | null>;
170
+ constructor();
171
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowConnectionLineDirective, never>;
172
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowConnectionLineDirective, "[flowConnectionLine]", ["flowConnectionLine"], {}, {}, never, never, true, never>;
173
+ }
174
+ /** The state of `[flowControls]` (none: its buttons have their own). */
175
+ type ControlsState = Record<never, never>;
176
+ /**
177
+ * A group of the viewport's buttons (`data-flow-part="controls"`), on the app's element:
178
+ * `<div flowControls>` holding `[flowZoomIn]`, `[flowZoomOut]`, `[flowFitView]`,
179
+ * `[flowToggleInteractive]` or the app's own. Inside `[flowRoot]`, outside `[flowViewport]`;
180
+ * presses and the wheel over it are left to it. Place it with your style.
181
+ */
182
+ export declare class FlowControlsDirective {
183
+ /** its state: none (its buttons have their own) */
184
+ readonly state: Signal<ControlsState>;
185
+ constructor();
186
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowControlsDirective, never>;
187
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowControlsDirective, "[flowControls]", ["flowControls"], {}, {}, never, never, true, never>;
188
+ }
189
+ /** What a `flowValue` depends on: its scope, and the node or edge it shows */
190
+ interface FlowValueOptions {
191
+ /** `view` (the default): every change; `entity`: a node's or an edge's own view */
192
+ readonly scope?: FlowValueScope;
193
+ /**
194
+ * the node or edge an `entity` reader shows (`undefined` while its input is not set): a
195
+ * measurement tells it only when it changed that node's box or that edge's path. Given, the
196
+ * value is made in an injection context (its record is released on destroy)
197
+ */
198
+ readonly entity?: () => FlowEntity | undefined;
199
+ }
200
+ /**
201
+ * A value read from the model and the engine, as a signal that changes only when the value does
202
+ * (`equal`; records by their entries by default): it is read again on every commit of the model,
203
+ * every view change of the engine (measurements, the viewport, a gesture) and every change of a
204
+ * signal `read` reads (an input), and a value equal to the last one keeps the last object, so
205
+ * nothing that reads it updates. An `entity` reader (a node's or an edge's own view) is not read
206
+ * again on a viewport-only step, nor on a measurement that did not change its node or edge.
207
+ */
208
+ declare function flowValue<S>(context: FlowContext, read: () => S, equal?: (a: S, b: S) => boolean, options?: FlowValueOptions): Signal<S>;
209
+ /** A value an injection function takes: a signal (an input), a getter, or the value itself. */
210
+ type ValueOrSignal<T> = T | Signal<T> | (() => T);
211
+ /**
212
+ * The id of the node (or edge) a part belongs to: its own input, else the enclosing one's. A part
213
+ * with neither is reported once rendered (React's "must be rendered inside Flow.Node"), unless
214
+ * `needed` answers false then (a toolbar of several nodes needs no node).
215
+ */
216
+ declare function partOwnerId(part: string, own: () => string | undefined, around: NodeContext | EdgeContext | null, kind: "node" | "edge", needed?: () => boolean): Signal<string | undefined>;
217
+ /** What an edge shows: its state on screen. */
218
+ interface EdgeState<T extends FlowTypes = AnyTypes> {
219
+ readonly edgeId: string;
220
+ /** the edge, as the model holds it */
221
+ readonly edge: FlowEdge<T>;
222
+ /**
223
+ * its path, label point and ends (`edge-path-by`), once both its nodes have a size; an app
224
+ * type gets the bezier path, and its ends to draw its own
225
+ */
226
+ readonly path: EdgePath | undefined;
227
+ /** `data-selected` (`selection()`) */
228
+ readonly selected: boolean;
229
+ /** one of its ends is being moved (`reconnection()`) */
230
+ readonly reconnecting: boolean;
231
+ /** it takes DOM focus (`keyboard()`): `tabindex="0"` */
232
+ readonly focusable: boolean;
233
+ readonly attributes: PartAttributes;
234
+ }
235
+ interface InjectEdgeResult<T extends FlowTypes = AnyTypes> {
236
+ /** the edge's state (`undefined` while its edge input is not set yet) */
237
+ readonly state: Signal<EdgeState<T> | undefined>;
238
+ }
239
+ /**
240
+ * An edge's state, and its element bound (React's `useEdge`), for an edge drawn by hand: call it
241
+ * in the constructor (or a field) of the component or directive whose host element is the edge
242
+ * (an SVG group inside `[flowEdges]`; `[flowEdge]` uses it). The element gets the edge's
243
+ * attributes, its `tabindex` and `pointer-events: visibleStroke`.
244
+ */
245
+ export declare function injectEdge<T extends FlowTypes = AnyTypes>(edge: ValueOrSignal<FlowEdge<T>>): InjectEdgeResult<T>;
246
+ /**
247
+ * One edge (`data-flow-part="edge"`, `data-flow-id`), on the app's SVG group inside
248
+ * `<ng-template flowEdgesItem let-edge>`: `<svg:g [flowEdge]="edge">`, drawn once both its nodes
249
+ * have a size. It renders what the app writes inside it (`[flowEdgePath]`, `[flowEdgeLabel]`,
250
+ * `[flowReconnectAnchor]`), and an edge path when the app writes no element; a press on its stroke
251
+ * selects it (`selection()`). Its state is in its `data-*` and in `#e="flowEdge"`.
252
+ */
253
+ export declare class FlowEdgeDirective<T extends FlowTypes = AnyTypes> {
254
+ /** the edge it draws: the one `flowEdgesItem` gives its template */
255
+ readonly flowEdge: import("@angular/core").InputSignal<FlowEdge<T>>;
256
+ private readonly edge;
257
+ /** the edge's state (`undefined` on a binding's first read, before its input is set) */
258
+ readonly state: Signal<EdgeState<T> | undefined>;
259
+ constructor();
260
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgeDirective<any>, never>;
261
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgeDirective<any>, "[flowEdge]", ["flowEdge"], {
262
+ "flowEdge": {
263
+ "alias": "flowEdge";
264
+ "required": true;
265
+ "isSignal": true;
266
+ };
267
+ }, {}, never, never, true, never>;
268
+ }
269
+ interface EdgeLabelState {
270
+ readonly edgeId: string;
271
+ /** the edge's path, label point and ends */
272
+ readonly path: EdgePath;
273
+ /** `data-selected` (`selection()`) */
274
+ readonly selected: boolean;
275
+ }
276
+ /**
277
+ * An edge's label (`data-flow-part="edge-label"`): the app's HTML element, written inside
278
+ * `[flowEdge]` with the `xhtml:` prefix (`<xhtml:div flowEdgeLabel>`: the edge is SVG, the label
279
+ * HTML) and moved into the HTML layer of `[flowEdges]` (SVG holds no HTML; with several render
280
+ * levels, its edge's level wrapper), centred on the path's
281
+ * label point in flow coordinates. It holds only what the app writes; a press on it selects its
282
+ * edge. It is out of the document while its edge has no path.
283
+ */
284
+ export declare class FlowEdgeLabelDirective {
285
+ /** the edge; default the enclosing `[flowEdge]`'s */
286
+ readonly edgeId: import("@angular/core").InputSignal<string | undefined>;
287
+ private readonly context;
288
+ private readonly id;
289
+ private readonly path;
290
+ private readonly attributes;
291
+ /** the label's state (`undefined` while its edge has no path) */
292
+ readonly state: Signal<EdgeLabelState | undefined>;
293
+ constructor();
294
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgeLabelDirective, never>;
295
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgeLabelDirective, "[flowEdgeLabel]", ["flowEdgeLabel"], {
296
+ "edgeId": {
297
+ "alias": "edgeId";
298
+ "required": false;
299
+ "isSignal": true;
300
+ };
301
+ }, {}, never, never, true, never>;
302
+ }
303
+ interface EdgePathState {
304
+ readonly edgeId: string;
305
+ /** the edge's path, label point and ends */
306
+ readonly path: EdgePath;
307
+ /** `data-selected` (`selection()`) */
308
+ readonly selected: boolean;
309
+ }
310
+ /**
311
+ * An edge's path (`data-flow-part="edge-path"`), on the app's SVG `<path>` inside `[flowEdge]`:
312
+ * `<svg:path flowEdgePath />`. Its `d` is the engine's (`edge-path-by`, D9) and it is unfilled;
313
+ * a `d` (or a `fill`) of the app's own wins: an app type is drawn from `state().path`'s ends.
314
+ * Several may share an edge: a wide transparent one is a bigger press target.
315
+ */
316
+ export declare class FlowEdgePathDirective {
317
+ /** the edge; default the enclosing `[flowEdge]`'s */
318
+ readonly edgeId: import("@angular/core").InputSignal<string | undefined>;
319
+ /** the path's state (`undefined` until the edge has a path) */
320
+ readonly state: Signal<EdgePathState | undefined>;
321
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgePathDirective, never>;
322
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgePathDirective, "[flowEdgePath]", ["flowEdgePath"], {
323
+ "edgeId": {
324
+ "alias": "edgeId";
325
+ "required": false;
326
+ "isSignal": true;
327
+ };
328
+ }, {}, never, never, true, never>;
329
+ }
330
+ interface EdgeToolbarState {
331
+ readonly edgeId: string;
332
+ /** the point of the edge it stands at */
333
+ readonly position: "label" | "source" | "target";
334
+ /** where it is anchored (its `alignX` / `alignY` point), in pixels relative to the root */
335
+ readonly anchor: EdgeToolbarPosition;
336
+ }
337
+ /**
338
+ * A toolbar on an edge (`data-flow-part="toolbar"`, `data-flow-id` its edge's id), on the app's
339
+ * HTML element, written inside `[flowEdge]` with the `xhtml:` prefix (`<xhtml:div
340
+ * flowEdgeToolbar>`: the edge is SVG, the toolbar HTML) and moved into `[flowRoot]` (outside the
341
+ * zoom), at the point `edge-toolbar-by` gives (the edge's label point, one of its ends or its
342
+ * `point`; centred unless `alignX` / `alignY` say otherwise), so it keeps its size at any zoom. It
343
+ * is in the document only while it is shown (`open`; by default while its edge is selected).
344
+ * Presses and the wheel over it are left to it. It holds only what the app writes (its buttons).
345
+ */
346
+ export declare class FlowEdgeToolbarDirective {
347
+ /** its edge; default the enclosing `[flowEdge]`'s */
348
+ readonly edgeId: import("@angular/core").InputSignal<string | undefined>;
349
+ /** the point of the edge it stands at: its label point, its source or its target end; default `"label"` */
350
+ readonly position: import("@angular/core").InputSignal<"label" | "source" | "target" | undefined>;
351
+ /** a flow point it stands at instead (absolute flow coordinates); wins over `position` */
352
+ readonly point: import("@angular/core").InputSignal<XY | undefined>;
353
+ /** a screen offset from that point, in pixels; default `{ x: 0, y: 0 }` */
354
+ readonly offset: import("@angular/core").InputSignal<XY | undefined>;
355
+ /** which of its edges goes at the point across: its left (`"start"`), centre (default) or right */
356
+ readonly alignX: import("@angular/core").InputSignal<"start" | "center" | "end" | undefined>;
357
+ /** which of its edges goes at the point down: its top (`"start"`), centre (default) or bottom */
358
+ readonly alignY: import("@angular/core").InputSignal<"start" | "center" | "end" | undefined>;
359
+ /** whether it is shown; default while its edge is selected (`selection()`) */
360
+ readonly open: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
361
+ private readonly context;
362
+ private readonly id;
363
+ private readonly view;
364
+ /** the toolbar's state (`null` while it is not shown) */
365
+ readonly state: Signal<EdgeToolbarState | null>;
366
+ constructor();
367
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgeToolbarDirective, never>;
368
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgeToolbarDirective, "[flowEdgeToolbar]", ["flowEdgeToolbar"], {
369
+ "edgeId": {
370
+ "alias": "edgeId";
371
+ "required": false;
372
+ "isSignal": true;
373
+ };
374
+ "position": {
375
+ "alias": "position";
376
+ "required": false;
377
+ "isSignal": true;
378
+ };
379
+ "point": {
380
+ "alias": "point";
381
+ "required": false;
382
+ "isSignal": true;
383
+ };
384
+ "offset": {
385
+ "alias": "offset";
386
+ "required": false;
387
+ "isSignal": true;
388
+ };
389
+ "alignX": {
390
+ "alias": "alignX";
391
+ "required": false;
392
+ "isSignal": true;
393
+ };
394
+ "alignY": {
395
+ "alias": "alignY";
396
+ "required": false;
397
+ "isSignal": true;
398
+ };
399
+ "open": {
400
+ "alias": "open";
401
+ "required": false;
402
+ "isSignal": true;
403
+ };
404
+ }, {}, never, never, true, never>;
405
+ }
406
+ interface NodesState {
407
+ /** how many nodes are rendered */
408
+ count: number;
409
+ }
410
+ /** The context of the `flowNodesItem` template: the node (`let-node`). */
411
+ interface NodesItemContext<T extends FlowTypes = AnyTypes> {
412
+ $implicit: FlowNode<T>;
413
+ node: FlowNode<T>;
414
+ }
415
+ /** What types a template's entities by a registry: the model (`[flowNodesItem]="model"`), or nothing. */
416
+ type TypedBy<T extends FlowTypes> = FlowModel<T, FlowFeatures> | "" | null | undefined;
417
+ /**
418
+ * The layer of the nodes (`data-flow-part="nodes"`), on the app's element inside `[flowViewport]`:
419
+ * `<div flowNodes>`. Its `<ng-template flowNodesItem let-node>` renders each node that is not
420
+ * hidden (with `onlyRenderVisible`, each one in view, `visible-nodes`, and none before the engine
421
+ * exists), in drawing order, keyed by its id (a node keeps its view and its element when it moves).
422
+ */
423
+ export declare class FlowNodesDirective {
424
+ private readonly context;
425
+ /** what it shows (`#nodes="flowNodes"`, then `nodes.state().count`) */
426
+ readonly state: Signal<NodesState>;
427
+ constructor();
428
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodesDirective, never>;
429
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodesDirective, "[flowNodes]", ["flowNodes"], {}, {}, never, never, true, never>;
430
+ }
431
+ /**
432
+ * Renders one node, inside `[flowNodes]`: `<ng-template flowNodesItem let-node>` (or
433
+ * `<div *flowNodesItem="let node" [flowNode]="node">`), usually a `[flowNode]` with its content
434
+ * and handles. `[flowNodesItem]="model"` types the node by the model's registry. A node's view is
435
+ * rendered again only when its node changes (the model shares the nodes it did not change): a drag
436
+ * step renders the moved nodes only. Another template (an `@if` around two) renders every node
437
+ * again with it.
438
+ */
439
+ export declare class FlowNodesItemDirective<T extends FlowTypes = AnyTypes> implements DoCheck {
440
+ /** what types the template's node (optional): the model */
441
+ readonly flowNodesItem: import("@angular/core").InputSignal<TypedBy<T>>;
442
+ static ngTemplateContextGuard<T extends FlowTypes>(_directive: FlowNodesItemDirective<T>, _context: unknown): _context is NodesItemContext<T>;
443
+ private readonly views;
444
+ constructor();
445
+ /** its views are checked whenever the template it is in is (Angular's embedded views are) */
446
+ ngDoCheck(): void;
447
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodesItemDirective<any>, never>;
448
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodesItemDirective<any>, "ng-template[flowNodesItem]", never, {
449
+ "flowNodesItem": {
450
+ "alias": "flowNodesItem";
451
+ "required": false;
452
+ "isSignal": true;
453
+ };
454
+ }, {}, never, never, true, never>;
455
+ }
456
+ interface EdgesState {
457
+ /** how many edges are drawn */
458
+ count: number;
459
+ }
460
+ /** The context of the `flowEdgesItem` template: the edge (`let-edge`). */
461
+ interface EdgesItemContext<T extends FlowTypes = AnyTypes> {
462
+ $implicit: FlowEdge<T>;
463
+ edge: FlowEdge<T>;
464
+ }
465
+ /**
466
+ * The layer of the edges (`data-flow-part="edges"`), on the app's element inside `[flowViewport]`,
467
+ * before `[flowNodes]`: `<div flowEdges>`. It holds an SVG of its own (`data-flow-part="edges"`
468
+ * too) where its `<ng-template flowEdgesItem let-edge>` draws each edge, once both its nodes have
469
+ * a size (before the engine exists, from the document's sizes: the static geometry), in the
470
+ * core's drawing order (`drawn-edges`: by stack value), and it is the HTML layer edge labels go
471
+ * to. When an edge stands above some node (`render-layers` has several levels), each level gets a
472
+ * wrapper (`data-flow-part="edges-layer"`, `data-level`, the level's `z-index`) holding its own
473
+ * SVG and its edges' labels, and the nodes interleave with them; the nodes never move. It lets
474
+ * presses through to the pane; the edges' own parts take them.
475
+ */
476
+ export declare class FlowEdgesDirective {
477
+ private readonly context;
478
+ /** each level's wrapper and SVG, made when first needed (level 0's SVG is {@link svg}) */
479
+ private readonly levels;
480
+ private readonly injector;
481
+ /** what it shows (`#edges="flowEdges"`, then `edges.state().count`) */
482
+ readonly state: Signal<EdgesState>;
483
+ constructor();
484
+ /** a level's wrapper and SVG, made once (they stay out of the document while not drawn) */
485
+ private level;
486
+ private createLevel;
487
+ /**
488
+ * brings the elements to `count` levels; level 0's SVG moving into or out of its wrapper
489
+ * takes the focus from an edge in it, given back after the move
490
+ */
491
+ private arrange;
492
+ private place;
493
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgesDirective, never>;
494
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgesDirective, "[flowEdges]", ["flowEdges"], {}, {}, never, never, true, never>;
495
+ }
496
+ /**
497
+ * Draws one edge, inside `[flowEdges]`: `<ng-template flowEdgesItem let-edge>`, usually a
498
+ * `<svg:g [flowEdge]="edge">` with its path and label (the `svg:` prefix: the template is written
499
+ * in the HTML layer, its views go into the SVG). `[flowEdgesItem]="model"` types the edge by the
500
+ * model's registry. An edge's view is rendered again only when its edge changes; its path follows
501
+ * the engine by itself.
502
+ */
503
+ export declare class FlowEdgesItemDirective<T extends FlowTypes = AnyTypes> implements DoCheck {
504
+ /** what types the template's edge (optional): the model */
505
+ readonly flowEdgesItem: import("@angular/core").InputSignal<TypedBy<T>>;
506
+ static ngTemplateContextGuard<T extends FlowTypes>(_directive: FlowEdgesItemDirective<T>, _context: unknown): _context is EdgesItemContext<T>;
507
+ private readonly views;
508
+ constructor();
509
+ /** its views are checked whenever the template it is in is (Angular's embedded views are) */
510
+ ngDoCheck(): void;
511
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowEdgesItemDirective<any>, never>;
512
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowEdgesItemDirective<any>, "ng-template[flowEdgesItem]", never, {
513
+ "flowEdgesItem": {
514
+ "alias": "flowEdgesItem";
515
+ "required": false;
516
+ "isSignal": true;
517
+ };
518
+ }, {}, never, never, true, never>;
519
+ }
520
+ /** What a control button shows. */
521
+ interface ControlButtonState {
522
+ /** the engine refuses its action now (a zoom at its limit, `fit-view` before a size) */
523
+ readonly disabled: boolean;
524
+ }
525
+ /**
526
+ * A button (`data-flow-part="fit-view"`), on the app's `<button flowFitView>`: fits every node in
527
+ * the root, or its `nodeIds` (`fit-view`, with its inputs as the payload), disabled before a node
528
+ * is measured. It holds only what the app writes (an icon, a label); `type="button"` unless the
529
+ * app sets one.
530
+ */
531
+ export declare class FlowFitViewDirective {
532
+ /** disabled whatever the engine says */
533
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
534
+ /** how long its viewport change animates, in milliseconds (the root's `easing`); default 0: at once */
535
+ readonly duration: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
536
+ /**
537
+ * the room kept free on every side: a share of the root's size, `"<n>px"`, or each side's
538
+ * (`{ top, right, bottom, left }`); default the engine's 0.1
539
+ */
540
+ readonly padding: import("@angular/core").InputSignal<FitPadding | undefined>;
541
+ /** only these nodes; default every node that is not hidden */
542
+ readonly nodeIds: import("@angular/core").InputSignal<string[] | undefined>;
543
+ /** without `nodeIds`, the hidden nodes of known size too; default false */
544
+ readonly includeHidden: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
545
+ /** the least zoom it may pick (within the root's limits); default the root's `minZoom` */
546
+ readonly minZoom: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
547
+ /** the greatest zoom it may pick (within the root's limits); default the root's `maxZoom` */
548
+ readonly maxZoom: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
549
+ private readonly button;
550
+ /** the button's state (`#b="flowFitView"`, then `b.state().disabled`) */
551
+ readonly state: Signal<ControlButtonState>;
552
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowFitViewDirective, never>;
553
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowFitViewDirective, "[flowFitView]", ["flowFitView"], {
554
+ "disabled": {
555
+ "alias": "disabled";
556
+ "required": false;
557
+ "isSignal": true;
558
+ };
559
+ "duration": {
560
+ "alias": "duration";
561
+ "required": false;
562
+ "isSignal": true;
563
+ };
564
+ "padding": {
565
+ "alias": "padding";
566
+ "required": false;
567
+ "isSignal": true;
568
+ };
569
+ "nodeIds": {
570
+ "alias": "nodeIds";
571
+ "required": false;
572
+ "isSignal": true;
573
+ };
574
+ "includeHidden": {
575
+ "alias": "includeHidden";
576
+ "required": false;
577
+ "isSignal": true;
578
+ };
579
+ "minZoom": {
580
+ "alias": "minZoom";
581
+ "required": false;
582
+ "isSignal": true;
583
+ };
584
+ "maxZoom": {
585
+ "alias": "maxZoom";
586
+ "required": false;
587
+ "isSignal": true;
588
+ };
589
+ }, {}, never, never, true, never>;
590
+ }
591
+ interface InjectHandleOptions {
592
+ /** whether edges start (`source`) or end (`target`) here */
593
+ type: HandleType;
594
+ /** the side of the node it sits on: the direction its edges leave or enter by */
595
+ side: HandleSide;
596
+ /** its id among the node's handles of its type (none: the node's default handle) */
597
+ handleId?: string | undefined;
598
+ /** whether a connection may start or end here; default true */
599
+ connectable?: boolean | undefined;
600
+ /** whether a connection may start here (a drag, a tap, a key); default true */
601
+ connectableStart?: boolean | undefined;
602
+ /** whether a connection may end here (be its target); default true */
603
+ connectableEnd?: boolean | undefined;
604
+ /** its node; default the enclosing `[flowNode]`'s */
605
+ nodeId?: string | undefined;
606
+ }
607
+ /** What a handle shows. */
608
+ interface HandleState {
609
+ readonly nodeId: string;
610
+ readonly handleId: string | undefined;
611
+ readonly type: HandleType;
612
+ readonly side: HandleSide;
613
+ /** a connection may start or end here (its flag and its node's): `data-connectable` */
614
+ readonly connectable: boolean;
615
+ /** a connection may start here: `data-connectable-start` */
616
+ readonly connectableStart: boolean;
617
+ /** a connection may end here: `data-connectable-end` */
618
+ readonly connectableEnd: boolean;
619
+ /** the connection under way starts here (`connection()`): `data-connecting` */
620
+ readonly connecting: boolean;
621
+ /** the connection under way would end here and be accepted: `data-valid` */
622
+ readonly valid: boolean;
623
+ /** the connection under way would end here and be refused: `data-invalid` */
624
+ readonly invalid: boolean;
625
+ readonly attributes: PartAttributes;
626
+ }
627
+ interface InjectHandleResult {
628
+ /** the handle's state (`undefined` until its node and its inputs are known) */
629
+ readonly state: Signal<HandleState | undefined>;
630
+ }
631
+ /**
632
+ * A handle's state, and its element bound (React's `useHandle`), for a handle rendered by hand:
633
+ * call it in the constructor (or a field) of the component or directive whose host element is the
634
+ * handle, inside a `[flowNode]` (`[flowHandle]` uses it). The element gets the handle's attributes
635
+ * and its place (absolute, centred on its side by default: a style may move it), and is registered
636
+ * with the engine (D8), which measures its centre.
637
+ */
638
+ export declare function injectHandle(options: ValueOrSignal<InjectHandleOptions>): InjectHandleResult;
639
+ /**
640
+ * A node's connection point (`data-flow-part="handle"`, `data-handle-type`, `data-side`), on the
641
+ * app's element inside `[flowNode]`: `<div flowHandle type="source" side="bottom">`. It is
642
+ * registered with the engine (D8), which measures its centre; with `connection()`, a press on it
643
+ * draws a connection. Absolutely positioned at the middle of its `side` by default: the app's
644
+ * style may place it elsewhere on the node. Give it its size and look.
645
+ */
646
+ export declare class FlowHandleDirective {
647
+ /** whether edges start (`source`) or end (`target`) here */
648
+ readonly type: import("@angular/core").InputSignal<HandleType>;
649
+ /** the side of the node it sits on: the direction its edges leave or enter by */
650
+ readonly side: import("@angular/core").InputSignal<HandleSide>;
651
+ /** its id among the node's handles of its type (none: the node's default handle) */
652
+ readonly handleId: import("@angular/core").InputSignal<string | undefined>;
653
+ /** whether a connection may start or end here; default true */
654
+ readonly connectable: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
655
+ /** whether a connection may start here (a drag, a tap, a key); default true */
656
+ readonly connectableStart: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
657
+ /** whether a connection may end here (be its target); default true */
658
+ readonly connectableEnd: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
659
+ /** its node; default the enclosing `[flowNode]`'s */
660
+ readonly nodeId: import("@angular/core").InputSignal<string | undefined>;
661
+ /** the handle's state (`#h="flowHandle"`, then `h.state()?.valid`) */
662
+ readonly state: Signal<HandleState | undefined>;
663
+ constructor();
664
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowHandleDirective, never>;
665
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowHandleDirective, "[flowHandle]", ["flowHandle"], {
666
+ "type": {
667
+ "alias": "type";
668
+ "required": true;
669
+ "isSignal": true;
670
+ };
671
+ "side": {
672
+ "alias": "side";
673
+ "required": true;
674
+ "isSignal": true;
675
+ };
676
+ "handleId": {
677
+ "alias": "handleId";
678
+ "required": false;
679
+ "isSignal": true;
680
+ };
681
+ "connectable": {
682
+ "alias": "connectable";
683
+ "required": false;
684
+ "isSignal": true;
685
+ };
686
+ "connectableStart": {
687
+ "alias": "connectableStart";
688
+ "required": false;
689
+ "isSignal": true;
690
+ };
691
+ "connectableEnd": {
692
+ "alias": "connectableEnd";
693
+ "required": false;
694
+ "isSignal": true;
695
+ };
696
+ "nodeId": {
697
+ "alias": "nodeId";
698
+ "required": false;
699
+ "isSignal": true;
700
+ };
701
+ }, {}, never, never, true, never>;
702
+ }
703
+ /** The host element of the directive (or component) being created. */
704
+ declare function injectHost<E extends Element = HTMLElement>(): E;
705
+ /** Runs `teardown` when the directive (or component) being created is destroyed. */
706
+ declare function onDestroy(teardown: () => void): void;
707
+ /** Like {@link booleanInput}, keeping `undefined` (the core's default). */
708
+ declare function optionalBoolean(value: unknown): boolean | undefined;
709
+ /** A number input that also takes its attribute's text (`minZoom="0.5"`), keeping `undefined`. */
710
+ declare function optionalNumber(value: unknown): number | undefined;
711
+ /**
712
+ * What `read` returns, or `fallback` while a required input it reads is not set yet. A part's
713
+ * `state()` may be read by bindings on its own element (`[class.selected]="n.state().selected"`),
714
+ * and Angular may read a binding before it sets the inputs of its element's directives: the input
715
+ * then throws (NG0950). The read still tracks the input, so the computed that calls this runs
716
+ * again once the input is set.
717
+ */
718
+ declare function beforeInputs<V>(fallback: V, read: () => V): V;
719
+ /** Structural inline style, camelCase keys (`pointerEvents`): an undefined value leaves the key alone. */
720
+ type StructuralStyle = Readonly<Record<string, string | number | undefined>>;
721
+ /** A length in pixels for an inline style. */
722
+ declare function px(value: number | undefined): string | undefined;
723
+ /**
724
+ * Applies a part's structural style to its element, and keeps it applied as it changes: the keys
725
+ * it sets win over the consumer's static `style` (the directive writes them after the element is
726
+ * created; a host style binding would lose to it) and over the consumer's style bindings
727
+ * (`[style.position]`, `[style]`), which Angular writes when they change: every render ends by
728
+ * writing the structural keys back where a binding replaced them. A key it stops setting gets
729
+ * the consumer's value back (the last one a binding wrote). Every other key of the consumer's
730
+ * style is untouched, and so is what the engine writes itself (the viewport's transform, the
731
+ * root's `touch-action`).
732
+ */
733
+ declare function bindStructuralStyle(element: HTMLElement | SVGElement, style: () => StructuralStyle): void;
734
+ /** An element's attributes, by name: `undefined` (or absent) removes one. */
735
+ type AttributeRecord = Readonly<Record<string, string | undefined>>;
736
+ /**
737
+ * Keeps a part's attributes on its element: the engine's record for the part (`data-flow-part`,
738
+ * `data-flow-id`, its state as `""` or absent) and the part's own (`tabindex`, `d`): sets the ones
739
+ * given, removes the ones no longer given. A host binding is static; these follow the engine
740
+ * (a state attribute comes and goes with a gesture). Never writes `"false"`.
741
+ */
742
+ declare function bindAttributes(element: Element, attributes: () => AttributeRecord): void;
743
+ /**
744
+ * Applies attributes the consumer overrides (an SVG part's `fill`, an edge path's `d`, a button's
745
+ * `type`): an attribute is written only while the element has none of its own (none, or the value
746
+ * written here last), so the consumer's static attribute or `[attr.*]` binding wins.
747
+ */
748
+ declare function bindBaseAttributes(element: Element, attributes: () => AttributeRecord): void;
749
+ /** What a node shows: its state on screen. */
750
+ interface NodeState<T extends FlowTypes = AnyTypes> {
751
+ readonly nodeId: string;
752
+ /** the node, as the model holds it */
753
+ readonly node: FlowNode<T>;
754
+ /** its top-left corner in absolute flow coordinates (its parents' positions added) */
755
+ readonly x: number;
756
+ readonly y: number;
757
+ /** `data-selected` (`selection()`) */
758
+ readonly selected: boolean;
759
+ /** `data-dragging` (`drag()`) */
760
+ readonly dragging: boolean;
761
+ /** `data-resizing` (`resize()`) */
762
+ readonly resizing: boolean;
763
+ /** its size is known (measured or given): `data-measured` */
764
+ readonly measured: boolean;
765
+ /** it takes DOM focus (`keyboard()`): `tabindex="0"` */
766
+ readonly focusable: boolean;
767
+ /** the attributes its element carries (`data-flow-part`, `data-flow-id`, the state) */
768
+ readonly attributes: PartAttributes;
769
+ }
770
+ /** What a node's element gets: its attributes (`tabindex` too) and its structural style. */
771
+ interface NodeElementProps {
772
+ readonly attributes: AttributeRecord;
773
+ readonly style: StructuralStyle;
774
+ }
775
+ interface InjectNodeResult<T extends FlowTypes = AnyTypes> {
776
+ /** the node's state (`undefined` while its node input is not set yet) */
777
+ readonly state: Signal<NodeState<T> | undefined>;
778
+ /** what the element is given (applied already) */
779
+ readonly props: Signal<NodeElementProps>;
780
+ }
781
+ /**
782
+ * A node's state, and its element bound (React's `useNode`), for a node rendered by hand: call it
783
+ * in the constructor (or a field) of the component or directive whose host element is the node
784
+ * (`[flowNode]` uses it). That element gets the node's attributes, its `tabindex`, its structural
785
+ * style (absolute, at its place, its `z-index` among the nodes, with the document's size when given) and is registered with the
786
+ * engine, which measures it and resolves presses on it.
787
+ *
788
+ * ```ts
789
+ * @Component({ selector: "article[appNode]", template: "…" })
790
+ * class AppNode {
791
+ * readonly node = input.required<FlowNode<Types>>({ alias: "appNode" });
792
+ * readonly own = injectNode(this.node);
793
+ * }
794
+ * ```
795
+ */
796
+ export declare function injectNode<T extends FlowTypes = AnyTypes>(node: ValueOrSignal<FlowNode<T>>): InjectNodeResult<T>;
797
+ /**
798
+ * One node (`data-flow-part="node"`, `data-flow-id`), on the app's element:
799
+ * `<div [flowNode]="node">`, inside `<ng-template flowNodesItem let-node>`. It is absolutely
800
+ * positioned at its place in the viewport (a structural `transform`), registered with the engine,
801
+ * which measures it and resolves presses on it (drag, select, connect from its handles). It renders
802
+ * only what the app writes: the content, `[flowHandle]`s, a resizer, a toolbar, which belong to it.
803
+ * Its state is in its `data-*` and in `#n="flowNode"` (`n.state()?.selected`).
804
+ */
805
+ export declare class FlowNodeDirective<T extends FlowTypes = AnyTypes> {
806
+ /** the node it renders: the one `flowNodesItem` gives its template */
807
+ readonly flowNode: import("@angular/core").InputSignal<FlowNode<T>>;
808
+ private readonly node;
809
+ /** the node's state (`undefined` on a binding's first read, before its input is set) */
810
+ readonly state: Signal<NodeState<T> | undefined>;
811
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodeDirective<any>, never>;
812
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodeDirective<any>, "[flowNode]", ["flowNode"], {
813
+ "flowNode": {
814
+ "alias": "flowNode";
815
+ "required": true;
816
+ "isSignal": true;
817
+ };
818
+ }, {}, never, never, true, never>;
819
+ }
820
+ interface NodeToolbarState {
821
+ /** its node (undefined for several nodes' toolbar) */
822
+ readonly nodeId: string | undefined;
823
+ /** the nodes it stands beside: `nodeIds`, or its one node */
824
+ readonly nodeIds: readonly string[];
825
+ /** where it is anchored, in pixels relative to the root */
826
+ readonly position: NodeToolbarPosition;
827
+ readonly side: HandleSide;
828
+ }
829
+ /**
830
+ * A toolbar next to a node (`data-flow-part="toolbar"`), on the app's element inside `[flowNode]`:
831
+ * `<div flowNodeToolbar>`, or anywhere in `[flowRoot]` beside several nodes' bounds
832
+ * (`[nodeIds]`), moved into `[flowRoot]` (outside the zoom) at the anchor `node-toolbar-by` gives,
833
+ * so it keeps its size at any zoom. It is in the document only while it is shown (`open`; by
834
+ * default while its node, or every node of `nodeIds`, is selected). Presses and the wheel over it are left
835
+ * to it. It holds only what the app writes (its buttons).
836
+ */
837
+ export declare class FlowNodeToolbarDirective {
838
+ /** its node; default the enclosing `[flowNode]`'s */
839
+ readonly nodeId: import("@angular/core").InputSignal<string | undefined>;
840
+ /**
841
+ * several nodes it stands beside (their bounds), instead of one; when not empty it wins over
842
+ * `nodeId`, and the toolbar is shown by default while every one of them is selected
843
+ */
844
+ readonly nodeIds: import("@angular/core").InputSignal<readonly string[] | undefined>;
845
+ /** the node's side it stands on; default `"top"` */
846
+ readonly side: import("@angular/core").InputSignal<HandleSide | undefined>;
847
+ /** where along that side; default `"center"` */
848
+ readonly align: import("@angular/core").InputSignal<"start" | "center" | "end" | undefined>;
849
+ /** the gap between the node and the toolbar, in pixels; default 10 */
850
+ readonly offset: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
851
+ /** whether it is shown; default while its node (every node of `nodeIds`) is selected (`selection()`) */
852
+ readonly open: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
853
+ private readonly context;
854
+ private readonly many;
855
+ private readonly id;
856
+ private readonly view;
857
+ /** the toolbar's state (`null` while it is not shown) */
858
+ readonly state: Signal<NodeToolbarState | null>;
859
+ constructor();
860
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodeToolbarDirective, never>;
861
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodeToolbarDirective, "[flowNodeToolbar]", ["flowNodeToolbar"], {
862
+ "nodeId": {
863
+ "alias": "nodeId";
864
+ "required": false;
865
+ "isSignal": true;
866
+ };
867
+ "nodeIds": {
868
+ "alias": "nodeIds";
869
+ "required": false;
870
+ "isSignal": true;
871
+ };
872
+ "side": {
873
+ "alias": "side";
874
+ "required": false;
875
+ "isSignal": true;
876
+ };
877
+ "align": {
878
+ "alias": "align";
879
+ "required": false;
880
+ "isSignal": true;
881
+ };
882
+ "offset": {
883
+ "alias": "offset";
884
+ "required": false;
885
+ "isSignal": true;
886
+ };
887
+ "open": {
888
+ "alias": "open";
889
+ "required": false;
890
+ "isSignal": true;
891
+ };
892
+ }, {}, never, never, true, never>;
893
+ }
894
+ interface NodesSelectionState {
895
+ /** the rectangle around the selected nodes, in flow coordinates */
896
+ readonly rect: Rect;
897
+ /** the selection is being dragged by it: `data-dragging` */
898
+ readonly dragging: boolean;
899
+ }
900
+ /**
901
+ * The rectangle around the selected nodes (`data-flow-part="nodes-selection"`, `selection()`), on
902
+ * the app's element: `<div flowNodesSelection>` inside `[flowViewport]`, after `[flowNodes]` (it
903
+ * is in flow coordinates). It is in the document only at `selection-rect`: while two or more nodes
904
+ * are selected by a box (or always, with `selection({ rect: "always" })`). A press on it drags the
905
+ * selection (`drag()`), its context menu is the selection's. With `keyboard()` it takes focus
906
+ * (`tabindex`), and its keys are a focused selected node's: the arrows move the selection, the
907
+ * delete keys remove it, Escape clears it. Give it its look.
908
+ */
909
+ export declare class FlowNodesSelectionDirective {
910
+ private readonly context;
911
+ private readonly rect;
912
+ private readonly attributes;
913
+ /** the rectangle's state (`null` while it is not shown) */
914
+ readonly state: Signal<NodesSelectionState | null>;
915
+ constructor();
916
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowNodesSelectionDirective, never>;
917
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowNodesSelectionDirective, "[flowNodesSelection]", ["flowNodesSelection"], {}, {}, never, never, true, never>;
918
+ }
919
+ interface ReconnectAnchorState {
920
+ readonly edgeId: string;
921
+ /** which end of the edge it moves */
922
+ readonly end: "source" | "target";
923
+ /** the edge's path and ends */
924
+ readonly path: EdgePath;
925
+ /** this edge's end is being moved */
926
+ readonly reconnecting: boolean;
927
+ }
928
+ /**
929
+ * An edge end's grab area (`data-flow-part="reconnect-anchor"`, `data-end`), on the app's SVG
930
+ * circle inside `[flowEdge]`: `<svg:circle flowReconnectAnchor end="target" />`, at that end.
931
+ * With `reconnection()`, a press on it moves that end to another handle; an end its edge's
932
+ * `reconnectable` keeps fixed (`false`, or the other end's name) has none: the element leaves the
933
+ * document meanwhile. Transparent by default; give it its radius (`r`, default 10) and look.
934
+ */
935
+ export declare class FlowReconnectAnchorDirective {
936
+ /** which end of the edge it moves */
937
+ readonly end: import("@angular/core").InputSignal<"source" | "target">;
938
+ /** the edge; default the enclosing `[flowEdge]`'s */
939
+ readonly edgeId: import("@angular/core").InputSignal<string | undefined>;
940
+ private readonly context;
941
+ private readonly id;
942
+ private readonly path;
943
+ /**
944
+ * this end may move (`edge-reconnectable`): `reconnectable: "source"` (or `"target"`, or
945
+ * false) keeps the other end fixed, which draws no anchor
946
+ */
947
+ private readonly movable;
948
+ private readonly view;
949
+ /** the anchor's state (`undefined` while its edge has no path, or its end may not move) */
950
+ readonly state: Signal<ReconnectAnchorState | undefined>;
951
+ constructor();
952
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowReconnectAnchorDirective, never>;
953
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowReconnectAnchorDirective, "[flowReconnectAnchor]", ["flowReconnectAnchor"], {
954
+ "end": {
955
+ "alias": "end";
956
+ "required": true;
957
+ "isSignal": true;
958
+ };
959
+ "edgeId": {
960
+ "alias": "edgeId";
961
+ "required": false;
962
+ "isSignal": true;
963
+ };
964
+ }, {}, never, never, true, never>;
965
+ }
966
+ /** What a flow ref gives once its `[flowRoot]` is rendered: the root's model and engine. */
967
+ interface FlowRefValue<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []> {
968
+ readonly model: FlowModel<T, F>;
969
+ readonly engine: FlowEngine<T, F>;
970
+ }
971
+ /**
972
+ * Access to a `[flowRoot]` from outside it (a toolbar, a menu, a test): pass it as the root's
973
+ * `flowRef`; `current` is the root's model and engine while it lives, `null` otherwise. Reading
974
+ * `current` in a template, a `computed` or an `effect` follows it.
975
+ */
976
+ interface FlowRef<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []> {
977
+ readonly current: FlowRefValue<T, F> | null;
978
+ }
979
+ /**
980
+ * Creates a flow ref, anywhere (a module, a service, a test, a component's field).
981
+ *
982
+ * ```ts
983
+ * readonly flow = createFlowRef<Types, typeof features>();
984
+ * // <div flowRoot [flowRef]="flow" [features]="features" [defaultNodes]="nodes">…</div>
985
+ * fit() { this.flow.current?.engine.run("fit-view"); }
986
+ * ```
987
+ */
988
+ export declare function createFlowRef<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []>(): FlowRef<T, F>;
989
+ interface RootState {
990
+ /** the gestures and keys may change the flow (`set-interactive`, `data-interactive`) */
991
+ interactive: boolean;
992
+ /** the viewport is being panned (`data-panning`) */
993
+ panning: boolean;
994
+ /** nodes are being dragged (`drag()`, `data-dragging`) */
995
+ dragging: boolean;
996
+ /** a connection is being drawn (`connection()`, `data-connecting`) */
997
+ connecting: boolean;
998
+ /** a box selection is being drawn (`selection()`, `data-selecting`) */
999
+ selecting: boolean;
1000
+ }
1001
+ /** The engine's options a root takes as inputs: each one that changes applies at once. */
1002
+ type RootEngineProps = Pick<FlowEngineOptions, "minZoom" | "maxZoom" | "translateExtent" | "panOnDrag" | "panOnScroll" | "zoomOnScroll" | "zoomOnPinch" | "zoomOnDoubleClick" | "zoomStep" | "interactive" | "onlyRenderVisible" | "pathOptions" | "autoPan" | "panActivationKey" | "panOnScrollMode" | "panOnScrollSpeed" | "zoomActivationKey" | "easing" | "nodeOrigin" | "nodeExtent" | "elevateNodesOnSelect" | "elevateEdgesOnSelect" | "zIndexMode" | "paneClickDistance" | "nodeClickDistance" | "preventScrolling" | "nodesFocusable" | "edgesFocusable">;
1003
+ /** A viewport change, as `(viewportMove)` tells it (React's `onViewportChange(viewport, gesture)`). */
1004
+ interface ViewportMoveEvent {
1005
+ readonly viewport: Viewport;
1006
+ /** a gesture moved it (a pan, the wheel, a pinch), not an action */
1007
+ readonly gesture: boolean;
1008
+ }
1009
+ /**
1010
+ * The flow (`data-flow-part="root"`), on the element the flow renders in:
1011
+ * `<div flowRoot [features]="features" [defaultNodes]="nodes">`. It owns the model (unless given
1012
+ * one) and the engine, attaches the engine to its element (the engine listens to it: pointer,
1013
+ * wheel, keys, focus) and provides the flow to the parts inside. Give it a size (the flow fills
1014
+ * it). `#flow="flowRoot"` gives the rest of the template its `model()`, its `engine` and its
1015
+ * `state()`.
1016
+ *
1017
+ * The engine is created once the root is rendered in a browser (`afterNextRender`), one per model
1018
+ * (another `model` destroys it and creates one at the last viewport), and destroyed with the root.
1019
+ */
1020
+ export declare class FlowRootDirective<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []> implements OnInit {
1021
+ /**
1022
+ * the flow model. Its middleware (`model.use`) sees every command the flow runs, and its
1023
+ * listeners (`model.subscribe`) every change. Give it, or let the root create one from
1024
+ * `nodes` / `defaultNodes` and `edges` / `defaultEdges`. Another model gets another engine
1025
+ */
1026
+ readonly modelInput: import("@angular/core").InputSignal<FlowModel<T, F> | undefined>;
1027
+ /** the nodes of the model the root creates (read once, when it creates it) */
1028
+ readonly defaultNodes: import("@angular/core").InputSignal<readonly FlowNodeInput<T>[] | undefined>;
1029
+ /** the edges of the model the root creates (read once, when it creates it) */
1030
+ readonly defaultEdges: import("@angular/core").InputSignal<readonly FlowEdgeInput<T>[] | undefined>;
1031
+ /**
1032
+ * controlled nodes (`[(nodes)]`): each new list brings the model to it with the commands a
1033
+ * user would run (`model.get("commands-to")`, one `batch`); every change of the model's nodes
1034
+ * emits `nodesChange`. Give every node its id
1035
+ */
1036
+ readonly nodes: import("@angular/core").InputSignal<readonly FlowNode<T>[] | undefined>;
1037
+ /** controlled edges (`[(edges)]`), as `nodes` */
1038
+ readonly edges: import("@angular/core").InputSignal<readonly FlowEdge<T>[] | undefined>;
1039
+ /**
1040
+ * the opt-in features of the model the root creates (read once, when it creates it):
1041
+ * `[selection(), drag(), connection()]`, each from its entry (`@fragiola/flow-angular/drag`).
1042
+ * A `model` has its own
1043
+ */
1044
+ readonly features: import("@angular/core").InputSignal<F | undefined>;
1045
+ /** the id generator of the model the root creates (read once, when it creates it) */
1046
+ readonly createId: import("@angular/core").InputSignal<CreateId | undefined>;
1047
+ /**
1048
+ * the fields every `edge.add` of the model the root creates fills in where it leaves them out
1049
+ * (read once, when it creates it: the model option `defaultEdgeOptions`)
1050
+ */
1051
+ readonly defaultEdgeOptions: import("@angular/core").InputSignal<Partial<Omit<FlowEdgeInput<T>, "id" | "source" | "target" | "sourceHandle" | "targetHandle">> | undefined>;
1052
+ /** controlled viewport (`[(viewport)]`): a new value is set on the engine (`set-viewport`) */
1053
+ readonly viewport: import("@angular/core").InputSignal<Viewport | undefined>;
1054
+ /** the viewport the flow starts at (read once); default `{ x: 0, y: 0, zoom: 1 }` */
1055
+ readonly defaultViewport: import("@angular/core").InputSignal<Viewport | undefined>;
1056
+ /**
1057
+ * fits the nodes once their sizes are known, again once measured (read once): a bare
1058
+ * `fitView`, or a payload
1059
+ */
1060
+ readonly fitView: import("@angular/core").InputSignalWithTransform<boolean | FitViewPayload | undefined, boolean | "" | FitViewPayload | null | undefined>;
1061
+ /** access to the model and the engine from outside the root (`createFlowRef`) */
1062
+ readonly flowRef: import("@angular/core").InputSignal<FlowRef<T, F> | undefined>;
1063
+ /** the engine's options (React's root props): each one that changes applies at once */
1064
+ readonly minZoom: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1065
+ readonly maxZoom: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1066
+ readonly translateExtent: import("@angular/core").InputSignal<import("@fragiola/flow").Rect | undefined>;
1067
+ readonly panOnDrag: import("@angular/core").InputSignalWithTransform<boolean | readonly number[] | undefined, boolean | "" | readonly number[] | null | undefined>;
1068
+ readonly panOnScroll: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1069
+ readonly zoomOnScroll: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1070
+ readonly zoomOnPinch: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1071
+ readonly zoomOnDoubleClick: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1072
+ readonly zoomStep: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1073
+ readonly interactive: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1074
+ readonly onlyRenderVisible: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1075
+ readonly pathOptions: import("@angular/core").InputSignal<import("@fragiola/flow").PathOptions | undefined>;
1076
+ readonly autoPan: import("@angular/core").InputSignalWithTransform<boolean | AutoPanOptions | undefined, boolean | "" | AutoPanOptions | null | undefined>;
1077
+ readonly panActivationKey: import("@angular/core").InputSignal<string | null | undefined>;
1078
+ readonly panOnScrollMode: import("@angular/core").InputSignal<import("@fragiola/flow").PanOnScrollMode | undefined>;
1079
+ readonly panOnScrollSpeed: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1080
+ readonly zoomActivationKey: import("@angular/core").InputSignal<string | null | undefined>;
1081
+ readonly easing: import("@angular/core").InputSignal<import("@fragiola/flow").ViewportEasing | undefined>;
1082
+ readonly nodeOrigin: import("@angular/core").InputSignal<import("@fragiola/flow").XY | undefined>;
1083
+ readonly nodeExtent: import("@angular/core").InputSignal<import("@fragiola/flow").Rect | undefined>;
1084
+ readonly elevateNodesOnSelect: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1085
+ readonly elevateEdgesOnSelect: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1086
+ /** how nodes and edges stack (`"basic"`, `"auto"`: the default, `"manual"`) */
1087
+ readonly zIndexMode: import("@angular/core").InputSignal<ZIndexMode | undefined>;
1088
+ readonly paneClickDistance: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1089
+ readonly nodeClickDistance: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1090
+ readonly preventScrolling: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1091
+ readonly nodesFocusable: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1092
+ readonly edgesFocusable: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1093
+ /** the model's nodes after every command that changes them (a drag step too), but the controlled ones' */
1094
+ readonly nodesChange: OutputEmitterRef<readonly FlowNode<T>[]>;
1095
+ /** the model's edges after every command that changes them, but the controlled ones' */
1096
+ readonly edgesChange: OutputEmitterRef<readonly FlowEdge<T>[]>;
1097
+ /** the viewport after every change, by a gesture or an action (`[(viewport)]`) */
1098
+ readonly viewportChange: OutputEmitterRef<Viewport>;
1099
+ /** every viewport change with what made it (`gesture: true` for a pan, the wheel, a pinch) */
1100
+ readonly viewportMove: OutputEmitterRef<ViewportMoveEvent>;
1101
+ readonly moveStart: OutputEmitterRef<FlowEngineEventOf<"viewport-change-start">>;
1102
+ readonly moveEnd: OutputEmitterRef<FlowEngineEventOf<"viewport-change-end">>;
1103
+ readonly init: OutputEmitterRef<{
1104
+ readonly type: "ready";
1105
+ }>;
1106
+ readonly nodeClick: OutputEmitterRef<{
1107
+ readonly type: "node-click";
1108
+ readonly nodeId: string;
1109
+ } & import("@fragiola/flow").FlowPointerInfo>;
1110
+ readonly nodeDoubleClick: OutputEmitterRef<{
1111
+ readonly type: "node-double-click";
1112
+ readonly nodeId: string;
1113
+ } & import("@fragiola/flow").FlowPointerInfo>;
1114
+ readonly nodeContextMenu: OutputEmitterRef<{
1115
+ readonly type: "node-context-menu";
1116
+ readonly nodeId: string;
1117
+ } & import("@fragiola/flow").FlowPointerInfo>;
1118
+ readonly edgeClick: OutputEmitterRef<{
1119
+ readonly type: "edge-click";
1120
+ readonly edgeId: string;
1121
+ } & import("@fragiola/flow").FlowPointerInfo>;
1122
+ readonly edgeDoubleClick: OutputEmitterRef<{
1123
+ readonly type: "edge-double-click";
1124
+ readonly edgeId: string;
1125
+ } & import("@fragiola/flow").FlowPointerInfo>;
1126
+ readonly edgeContextMenu: OutputEmitterRef<{
1127
+ readonly type: "edge-context-menu";
1128
+ readonly edgeId: string;
1129
+ } & import("@fragiola/flow").FlowPointerInfo>;
1130
+ readonly paneClick: OutputEmitterRef<{
1131
+ readonly type: "pane-click";
1132
+ } & import("@fragiola/flow").FlowPointerInfo>;
1133
+ readonly paneDoubleClick: OutputEmitterRef<{
1134
+ readonly type: "pane-double-click";
1135
+ } & import("@fragiola/flow").FlowPointerInfo>;
1136
+ readonly paneContextMenu: OutputEmitterRef<{
1137
+ readonly type: "pane-context-menu";
1138
+ } & import("@fragiola/flow").FlowPointerInfo>;
1139
+ readonly selectionContextMenu: OutputEmitterRef<{
1140
+ readonly type: "selection-context-menu";
1141
+ readonly nodeIds: readonly string[];
1142
+ readonly edgeIds: readonly string[];
1143
+ } & import("@fragiola/flow").FlowPointerInfo>;
1144
+ readonly selectionStart: OutputEmitterRef<{
1145
+ readonly type: "box-select-start";
1146
+ readonly client: import("@fragiola/flow").XY;
1147
+ readonly point: import("@fragiola/flow").XY;
1148
+ }>;
1149
+ readonly selectionEnd: OutputEmitterRef<{
1150
+ readonly type: "box-select";
1151
+ readonly nodeIds: readonly string[];
1152
+ readonly edgeIds: readonly string[];
1153
+ }>;
1154
+ readonly nodeDragStart: OutputEmitterRef<{
1155
+ readonly type: "drag-start";
1156
+ readonly nodeIds: readonly string[];
1157
+ }>;
1158
+ readonly nodesMove: OutputEmitterRef<{
1159
+ readonly type: "nodes-move";
1160
+ readonly nodeIds: readonly string[];
1161
+ readonly source: import("@fragiola/flow").MoveSource;
1162
+ }>;
1163
+ readonly nodeDragCancel: OutputEmitterRef<{
1164
+ readonly type: "drag-cancel";
1165
+ readonly nodeIds: readonly string[];
1166
+ }>;
1167
+ readonly selectionDragStart: OutputEmitterRef<{
1168
+ readonly type: "selection-drag-start";
1169
+ } & import("@fragiola/flow").SelectionDragStep>;
1170
+ readonly selectionDrag: OutputEmitterRef<{
1171
+ readonly type: "selection-drag";
1172
+ } & import("@fragiola/flow").SelectionDragStep>;
1173
+ readonly selectionDragStop: OutputEmitterRef<{
1174
+ readonly type: "selection-drag-end";
1175
+ } & import("@fragiola/flow").SelectionDragStep>;
1176
+ readonly connectStart: OutputEmitterRef<{
1177
+ readonly type: "connect-start";
1178
+ readonly nodeId: string;
1179
+ readonly handleId: string | undefined;
1180
+ readonly handleType: import("@fragiola/flow").HandleType;
1181
+ readonly input: import("@fragiola/flow").MoveSource;
1182
+ }>;
1183
+ readonly connectTarget: OutputEmitterRef<{
1184
+ readonly type: "connect-target";
1185
+ readonly nodeId: string | undefined;
1186
+ readonly handleId: string | undefined;
1187
+ readonly handleType: import("@fragiola/flow").HandleType | undefined;
1188
+ readonly index: number;
1189
+ readonly count: number;
1190
+ }>;
1191
+ readonly connect: OutputEmitterRef<{
1192
+ readonly type: "connect";
1193
+ readonly edgeId: string;
1194
+ readonly source: string;
1195
+ readonly target: string;
1196
+ readonly input: import("@fragiola/flow").MoveSource;
1197
+ }>;
1198
+ readonly connectCancel: OutputEmitterRef<{
1199
+ readonly type: "connect-cancel";
1200
+ readonly refused: boolean;
1201
+ readonly input: import("@fragiola/flow").MoveSource;
1202
+ } & import("@fragiola/flow").ConnectionDrop>;
1203
+ readonly reconnectStart: OutputEmitterRef<{
1204
+ readonly type: "reconnect-start";
1205
+ readonly edgeId: string;
1206
+ readonly end: "source" | "target";
1207
+ }>;
1208
+ readonly reconnect: OutputEmitterRef<{
1209
+ readonly type: "reconnect";
1210
+ readonly edgeId: string;
1211
+ readonly source: string;
1212
+ readonly target: string;
1213
+ }>;
1214
+ readonly reconnectCancel: OutputEmitterRef<{
1215
+ readonly type: "reconnect-cancel";
1216
+ readonly edgeId: string;
1217
+ readonly end: "source" | "target";
1218
+ readonly refused: boolean;
1219
+ } & import("@fragiola/flow").ConnectionDrop>;
1220
+ readonly resizeStart: OutputEmitterRef<{
1221
+ readonly type: "resize-start";
1222
+ readonly nodeId: string;
1223
+ readonly width: number;
1224
+ readonly height: number;
1225
+ }>;
1226
+ readonly resizeEnd: OutputEmitterRef<{
1227
+ readonly type: "resize";
1228
+ readonly nodeId: string;
1229
+ readonly width: number;
1230
+ readonly height: number;
1231
+ readonly source: import("@fragiola/flow").MoveSource;
1232
+ }>;
1233
+ readonly resizeCancel: OutputEmitterRef<{
1234
+ readonly type: "resize-cancel";
1235
+ readonly nodeId: string;
1236
+ }>;
1237
+ readonly delete: OutputEmitterRef<{
1238
+ readonly type: "remove";
1239
+ readonly nodeIds: readonly string[];
1240
+ readonly edgeIds: readonly string[];
1241
+ }>;
1242
+ /** each engine event's output, by the event's type */
1243
+ private readonly eventOutputs;
1244
+ private readonly host;
1245
+ /** its inputs are set (`ngOnInit`) */
1246
+ private readonly initialized;
1247
+ /** the model the root created, once it needs one */
1248
+ private own;
1249
+ /** the names of the features the root's own model was created with */
1250
+ private createdWith;
1251
+ /** the root's model: its `model` input, or the one it created from its inputs */
1252
+ readonly model: Signal<FlowModel<T, F>>;
1253
+ private readonly erased;
1254
+ /** the viewport a new engine starts at: the last one's (another model), else the inputs' */
1255
+ private start;
1256
+ private readonly facade;
1257
+ /**
1258
+ * the engine of the flow on screen, as apps see it: screen actions (`engine.run("fit-view")`),
1259
+ * screen facts (`engine.get("viewport")`) and its events (`engine.subscribe`). It is there
1260
+ * from the start; before the root created its engine an action is refused and a read is empty
1261
+ */
1262
+ readonly engine: FlowEngine<T, F>;
1263
+ private readonly current;
1264
+ /**
1265
+ * the root's one store (React's `flow-store`): its counters are bumped once per commit of the
1266
+ * model and engine notification, each told to the readers it may concern; its listeners are
1267
+ * the root's effects, gone with it
1268
+ */
1269
+ private readonly store;
1270
+ private readonly revision;
1271
+ /** a commit of the model: told to the readers, then rendered before the next task */
1272
+ private readonly committed;
1273
+ private readonly application;
1274
+ private readonly errorHandler;
1275
+ private renderQueued;
1276
+ /**
1277
+ * Renders a change of the flow before the next task (a microtask), as Vue and Svelte flush
1278
+ * theirs: zoneless Angular would render it in a later task (a timeout or a frame), so a key
1279
+ * press or a click that moved a node or reached a zoom limit would still show the old view to
1280
+ * whatever reads the page right after it (an assistive technology, a test). One render per
1281
+ * root and task, however many commits and view changes it had; none once the application is
1282
+ * destroyed. An error of that render goes to the app's `ErrorHandler`, as one of Angular's
1283
+ * own scheduled renders does (thrown from a microtask, it would reach no handler).
1284
+ */
1285
+ private renderSoon;
1286
+ /** the static geometry last computed, and what it was computed from */
1287
+ private staticFrom;
1288
+ /**
1289
+ * The flow's geometry from its document while there is no engine (the first render): one
1290
+ * object per document and options (every part reads the same), `null` once the engine exists.
1291
+ */
1292
+ private readonly geometry;
1293
+ /** the levels the flow is drawn in: the engine's, else the static geometry's */
1294
+ private readonly layers;
1295
+ private readonly attributes;
1296
+ /** what the root shows as `data-*` (`#flow="flowRoot"`, then `flow.state().connecting`) */
1297
+ readonly state: Signal<RootState>;
1298
+ /** the engine's options as the inputs give them */
1299
+ private readonly engineProps;
1300
+ /** the controlled lists the model was last brought to (a model the root created starts at them) */
1301
+ private sent;
1302
+ constructor();
1303
+ ngOnInit(): void;
1304
+ /**
1305
+ * Brings the model to the controlled lists that changed (packages/react's algorithm): one
1306
+ * `batch` with `meta: { source: "controlled" }`, step by step after a veto, and the model's
1307
+ * lists emitted when they differ from the inputs (a veto, a rule that kept a node in its
1308
+ * parent, a middleware that rewrote a payload): the app's state follows the model.
1309
+ */
1310
+ private syncControlled;
1311
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowRootDirective<any, any>, never>;
1312
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowRootDirective<any, any>, "[flowRoot]", ["flowRoot"], {
1313
+ "modelInput": {
1314
+ "alias": "model";
1315
+ "required": false;
1316
+ "isSignal": true;
1317
+ };
1318
+ "defaultNodes": {
1319
+ "alias": "defaultNodes";
1320
+ "required": false;
1321
+ "isSignal": true;
1322
+ };
1323
+ "defaultEdges": {
1324
+ "alias": "defaultEdges";
1325
+ "required": false;
1326
+ "isSignal": true;
1327
+ };
1328
+ "nodes": {
1329
+ "alias": "nodes";
1330
+ "required": false;
1331
+ "isSignal": true;
1332
+ };
1333
+ "edges": {
1334
+ "alias": "edges";
1335
+ "required": false;
1336
+ "isSignal": true;
1337
+ };
1338
+ "features": {
1339
+ "alias": "features";
1340
+ "required": false;
1341
+ "isSignal": true;
1342
+ };
1343
+ "createId": {
1344
+ "alias": "createId";
1345
+ "required": false;
1346
+ "isSignal": true;
1347
+ };
1348
+ "defaultEdgeOptions": {
1349
+ "alias": "defaultEdgeOptions";
1350
+ "required": false;
1351
+ "isSignal": true;
1352
+ };
1353
+ "viewport": {
1354
+ "alias": "viewport";
1355
+ "required": false;
1356
+ "isSignal": true;
1357
+ };
1358
+ "defaultViewport": {
1359
+ "alias": "defaultViewport";
1360
+ "required": false;
1361
+ "isSignal": true;
1362
+ };
1363
+ "fitView": {
1364
+ "alias": "fitView";
1365
+ "required": false;
1366
+ "isSignal": true;
1367
+ };
1368
+ "flowRef": {
1369
+ "alias": "flowRef";
1370
+ "required": false;
1371
+ "isSignal": true;
1372
+ };
1373
+ "minZoom": {
1374
+ "alias": "minZoom";
1375
+ "required": false;
1376
+ "isSignal": true;
1377
+ };
1378
+ "maxZoom": {
1379
+ "alias": "maxZoom";
1380
+ "required": false;
1381
+ "isSignal": true;
1382
+ };
1383
+ "translateExtent": {
1384
+ "alias": "translateExtent";
1385
+ "required": false;
1386
+ "isSignal": true;
1387
+ };
1388
+ "panOnDrag": {
1389
+ "alias": "panOnDrag";
1390
+ "required": false;
1391
+ "isSignal": true;
1392
+ };
1393
+ "panOnScroll": {
1394
+ "alias": "panOnScroll";
1395
+ "required": false;
1396
+ "isSignal": true;
1397
+ };
1398
+ "zoomOnScroll": {
1399
+ "alias": "zoomOnScroll";
1400
+ "required": false;
1401
+ "isSignal": true;
1402
+ };
1403
+ "zoomOnPinch": {
1404
+ "alias": "zoomOnPinch";
1405
+ "required": false;
1406
+ "isSignal": true;
1407
+ };
1408
+ "zoomOnDoubleClick": {
1409
+ "alias": "zoomOnDoubleClick";
1410
+ "required": false;
1411
+ "isSignal": true;
1412
+ };
1413
+ "zoomStep": {
1414
+ "alias": "zoomStep";
1415
+ "required": false;
1416
+ "isSignal": true;
1417
+ };
1418
+ "interactive": {
1419
+ "alias": "interactive";
1420
+ "required": false;
1421
+ "isSignal": true;
1422
+ };
1423
+ "onlyRenderVisible": {
1424
+ "alias": "onlyRenderVisible";
1425
+ "required": false;
1426
+ "isSignal": true;
1427
+ };
1428
+ "pathOptions": {
1429
+ "alias": "pathOptions";
1430
+ "required": false;
1431
+ "isSignal": true;
1432
+ };
1433
+ "autoPan": {
1434
+ "alias": "autoPan";
1435
+ "required": false;
1436
+ "isSignal": true;
1437
+ };
1438
+ "panActivationKey": {
1439
+ "alias": "panActivationKey";
1440
+ "required": false;
1441
+ "isSignal": true;
1442
+ };
1443
+ "panOnScrollMode": {
1444
+ "alias": "panOnScrollMode";
1445
+ "required": false;
1446
+ "isSignal": true;
1447
+ };
1448
+ "panOnScrollSpeed": {
1449
+ "alias": "panOnScrollSpeed";
1450
+ "required": false;
1451
+ "isSignal": true;
1452
+ };
1453
+ "zoomActivationKey": {
1454
+ "alias": "zoomActivationKey";
1455
+ "required": false;
1456
+ "isSignal": true;
1457
+ };
1458
+ "easing": {
1459
+ "alias": "easing";
1460
+ "required": false;
1461
+ "isSignal": true;
1462
+ };
1463
+ "nodeOrigin": {
1464
+ "alias": "nodeOrigin";
1465
+ "required": false;
1466
+ "isSignal": true;
1467
+ };
1468
+ "nodeExtent": {
1469
+ "alias": "nodeExtent";
1470
+ "required": false;
1471
+ "isSignal": true;
1472
+ };
1473
+ "elevateNodesOnSelect": {
1474
+ "alias": "elevateNodesOnSelect";
1475
+ "required": false;
1476
+ "isSignal": true;
1477
+ };
1478
+ "elevateEdgesOnSelect": {
1479
+ "alias": "elevateEdgesOnSelect";
1480
+ "required": false;
1481
+ "isSignal": true;
1482
+ };
1483
+ "zIndexMode": {
1484
+ "alias": "zIndexMode";
1485
+ "required": false;
1486
+ "isSignal": true;
1487
+ };
1488
+ "paneClickDistance": {
1489
+ "alias": "paneClickDistance";
1490
+ "required": false;
1491
+ "isSignal": true;
1492
+ };
1493
+ "nodeClickDistance": {
1494
+ "alias": "nodeClickDistance";
1495
+ "required": false;
1496
+ "isSignal": true;
1497
+ };
1498
+ "preventScrolling": {
1499
+ "alias": "preventScrolling";
1500
+ "required": false;
1501
+ "isSignal": true;
1502
+ };
1503
+ "nodesFocusable": {
1504
+ "alias": "nodesFocusable";
1505
+ "required": false;
1506
+ "isSignal": true;
1507
+ };
1508
+ "edgesFocusable": {
1509
+ "alias": "edgesFocusable";
1510
+ "required": false;
1511
+ "isSignal": true;
1512
+ };
1513
+ }, {
1514
+ "nodesChange": "nodesChange";
1515
+ "edgesChange": "edgesChange";
1516
+ "viewportChange": "viewportChange";
1517
+ "viewportMove": "viewportMove";
1518
+ "moveStart": "moveStart";
1519
+ "moveEnd": "moveEnd";
1520
+ "init": "init";
1521
+ "nodeClick": "nodeClick";
1522
+ "nodeDoubleClick": "nodeDoubleClick";
1523
+ "nodeContextMenu": "nodeContextMenu";
1524
+ "edgeClick": "edgeClick";
1525
+ "edgeDoubleClick": "edgeDoubleClick";
1526
+ "edgeContextMenu": "edgeContextMenu";
1527
+ "paneClick": "paneClick";
1528
+ "paneDoubleClick": "paneDoubleClick";
1529
+ "paneContextMenu": "paneContextMenu";
1530
+ "selectionContextMenu": "selectionContextMenu";
1531
+ "selectionStart": "selectionStart";
1532
+ "selectionEnd": "selectionEnd";
1533
+ "nodeDragStart": "nodeDragStart";
1534
+ "nodesMove": "nodesMove";
1535
+ "nodeDragCancel": "nodeDragCancel";
1536
+ "selectionDragStart": "selectionDragStart";
1537
+ "selectionDrag": "selectionDrag";
1538
+ "selectionDragStop": "selectionDragStop";
1539
+ "connectStart": "connectStart";
1540
+ "connectTarget": "connectTarget";
1541
+ "connect": "connect";
1542
+ "connectCancel": "connectCancel";
1543
+ "reconnectStart": "reconnectStart";
1544
+ "reconnect": "reconnect";
1545
+ "reconnectCancel": "reconnectCancel";
1546
+ "resizeStart": "resizeStart";
1547
+ "resizeEnd": "resizeEnd";
1548
+ "resizeCancel": "resizeCancel";
1549
+ "delete": "delete";
1550
+ }, never, never, true, never>;
1551
+ }
1552
+ interface SelectionBoxState {
1553
+ /** the box, in pixels relative to the root */
1554
+ readonly box: Rect;
1555
+ }
1556
+ /**
1557
+ * The box selection being drawn (`data-flow-part="selection-box"`, `selection()`), on the app's
1558
+ * element: `<div flowSelectionBox>`, absolutely positioned in `[flowRoot]` (outside
1559
+ * `[flowViewport]`: it is in screen pixels). It is in the document only while a box is drawn.
1560
+ * Give it its look.
1561
+ */
1562
+ export declare class FlowSelectionBoxDirective {
1563
+ private readonly context;
1564
+ private readonly box;
1565
+ private readonly attributes;
1566
+ /** the box's state (`null` while no box is drawn) */
1567
+ readonly state: Signal<SelectionBoxState | null>;
1568
+ constructor();
1569
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowSelectionBoxDirective, never>;
1570
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowSelectionBoxDirective, "[flowSelectionBox]", ["flowSelectionBox"], {}, {}, never, never, true, never>;
1571
+ }
1572
+ interface ToggleInteractiveState {
1573
+ /**
1574
+ * the flow is not locked: it is interactive and one of dragging, connecting and selecting at
1575
+ * least is on (`interactive-by`)
1576
+ */
1577
+ readonly interactive: boolean;
1578
+ }
1579
+ /**
1580
+ * A toggle button (`data-flow-part="toggle-interactive"`, `aria-pressed` while the flow is locked,
1581
+ * `data-interactive`), on the app's `<button flowToggleInteractive>`: locks and unlocks the flow,
1582
+ * React Flow's interactive button: locking turns dragging, connecting and selecting off
1583
+ * (`set-interactive { drag, connect, select }`), unlocking turns them and `interactive` on; pan
1584
+ * and zoom stay. It holds only what the app writes; `type="button"` unless the app sets one.
1585
+ */
1586
+ export declare class FlowToggleInteractiveDirective {
1587
+ private readonly context;
1588
+ private readonly interactive;
1589
+ /** the toggle's state (`#t="flowToggleInteractive"`, then `t.state().interactive`) */
1590
+ readonly state: Signal<ToggleInteractiveState>;
1591
+ constructor();
1592
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowToggleInteractiveDirective, never>;
1593
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowToggleInteractiveDirective, "[flowToggleInteractive]", ["flowToggleInteractive"], {}, {}, never, never, true, never>;
1594
+ }
1595
+ interface ViewportState {
1596
+ /** the viewport: the pan (`x`, `y`, pixels) and the zoom */
1597
+ viewport: Viewport;
1598
+ }
1599
+ /**
1600
+ * The pannable, zoomable layer (`data-flow-part="viewport"`), on the app's element inside
1601
+ * `[flowRoot]`: `<div flowViewport>`. What is inside is in flow coordinates (`[flowEdges]`,
1602
+ * `[flowNodes]`, `[flowConnectionLine]`). The engine writes its `transform` itself (D4), never
1603
+ * Angular: a pan or a zoom renders nothing inside it again.
1604
+ */
1605
+ export declare class FlowViewportDirective {
1606
+ private readonly context;
1607
+ private readonly viewport;
1608
+ /** what it shows (`#v="flowViewport"`, then `v.state().viewport.zoom`) */
1609
+ readonly state: Signal<ViewportState>;
1610
+ constructor();
1611
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowViewportDirective, never>;
1612
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowViewportDirective, "[flowViewport]", ["flowViewport"], {}, {}, never, never, true, never>;
1613
+ }
1614
+ /**
1615
+ * A button (`data-flow-part="zoom-in"`), on the app's `<button flowZoomIn>`: zooms in by a step
1616
+ * around the root's centre (`zoom-in`), disabled at the greatest zoom. It holds only what the app
1617
+ * writes (an icon, a label); `type="button"` unless the app sets one.
1618
+ */
1619
+ export declare class FlowZoomInDirective {
1620
+ /** disabled whatever the engine says */
1621
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1622
+ /** how long its viewport change animates, in milliseconds (the root's `easing`); default 0: at once */
1623
+ readonly duration: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1624
+ private readonly button;
1625
+ /** the button's state (`#b="flowZoomIn"`, then `b.state().disabled`) */
1626
+ readonly state: Signal<ControlButtonState>;
1627
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowZoomInDirective, never>;
1628
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowZoomInDirective, "[flowZoomIn]", ["flowZoomIn"], {
1629
+ "disabled": {
1630
+ "alias": "disabled";
1631
+ "required": false;
1632
+ "isSignal": true;
1633
+ };
1634
+ "duration": {
1635
+ "alias": "duration";
1636
+ "required": false;
1637
+ "isSignal": true;
1638
+ };
1639
+ }, {}, never, never, true, never>;
1640
+ }
1641
+ /**
1642
+ * A button (`data-flow-part="zoom-out"`), on the app's `<button flowZoomOut>`: zooms out by a step
1643
+ * around the root's centre (`zoom-out`), disabled at the least zoom. It holds only what the app
1644
+ * writes (an icon, a label); `type="button"` unless the app sets one.
1645
+ */
1646
+ export declare class FlowZoomOutDirective {
1647
+ /** disabled whatever the engine says */
1648
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
1649
+ /** how long its viewport change animates, in milliseconds (the root's `easing`); default 0: at once */
1650
+ readonly duration: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
1651
+ private readonly button;
1652
+ /** the button's state (`#b="flowZoomOut"`, then `b.state().disabled`) */
1653
+ readonly state: Signal<ControlButtonState>;
1654
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowZoomOutDirective, never>;
1655
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FlowZoomOutDirective, "[flowZoomOut]", ["flowZoomOut"], {
1656
+ "disabled": {
1657
+ "alias": "disabled";
1658
+ "required": false;
1659
+ "isSignal": true;
1660
+ };
1661
+ "duration": {
1662
+ "alias": "duration";
1663
+ "required": false;
1664
+ "isSignal": true;
1665
+ };
1666
+ }, {}, never, never, true, never>;
1667
+ }
1668
+ /**
1669
+ * Every Flow directive of the main entry, for a standalone component's `imports`:
1670
+ * `@Component({ imports: [FLOW], … })` (React's `Flow` namespace). The features' directives are
1671
+ * on their entries (`FLOW_MINIMAP` on `@fragiola/flow-angular/minimap`, `FLOW_RESIZE` on
1672
+ * `/resize`).
1673
+ */
1674
+ export declare const FLOW: readonly [typeof FlowRootDirective, typeof FlowViewportDirective, typeof FlowNodesDirective, typeof FlowNodesItemDirective, typeof FlowNodeDirective, typeof FlowHandleDirective, typeof FlowEdgesDirective, typeof FlowEdgesItemDirective, typeof FlowEdgeDirective, typeof FlowEdgePathDirective, typeof FlowEdgeLabelDirective, typeof FlowReconnectAnchorDirective, typeof FlowConnectionLineDirective, typeof FlowNodesSelectionDirective, typeof FlowSelectionBoxDirective, typeof FlowBackgroundDirective, typeof FlowControlsDirective, typeof FlowZoomInDirective, typeof FlowZoomOutDirective, typeof FlowFitViewDirective, typeof FlowToggleInteractiveDirective, typeof FlowNodeToolbarDirective, typeof FlowEdgeToolbarDirective];
1675
+ /**
1676
+ * The connection being drawn from a handle (`connection()`), or null, as a signal that changes
1677
+ * with it: where it starts and ends, the handle it would end at and whether the drop would be
1678
+ * accepted (`status`). Call it in an injection context.
1679
+ */
1680
+ export declare function injectConnection(): Signal<Connection | null>;
1681
+ /**
1682
+ * Every edge of the enclosing `[flowRoot]`, in drawing order, as a signal that changes on every
1683
+ * change of one. Call it in an injection context.
1684
+ */
1685
+ export declare function injectEdges<T extends FlowTypes = AnyTypes>(): Signal<readonly FlowEdge<T>[]>;
1686
+ interface InjectFlowResult<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []> {
1687
+ /**
1688
+ * the model of the enclosing `[flowRoot]`: the flow's document and its rules. Change it with
1689
+ * `model().run("node.move", { nodeId, position })`, read it with `model().get` / `model().is`
1690
+ */
1691
+ readonly model: Signal<FlowModel<T, F>>;
1692
+ /**
1693
+ * the engine of the flow on screen: screen actions (`engine.run("fit-view")`), screen facts
1694
+ * (`engine.get("viewport")`) and its events (`engine.subscribe`). It is there from the start;
1695
+ * before the root created its engine an action is refused and a read is empty
1696
+ */
1697
+ readonly engine: FlowEngine<T, F>;
1698
+ }
1699
+ /**
1700
+ * The model and the engine of the enclosing `[flowRoot]` (React's `useFlow`). Pass the registry
1701
+ * and the features as the type arguments (`injectFlow<Types, typeof features>()`): a child cannot
1702
+ * infer them through injection. Call it in an injection context (a constructor or a field).
1703
+ */
1704
+ export declare function injectFlow<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []>(): InjectFlowResult<T, F>;
1705
+ /**
1706
+ * A flow ref kept by the component that makes it (React's `useFlowRef`): give it to a
1707
+ * `[flowRoot]` and read `flow.current` in the template (a toolbar next to the flow) or in
1708
+ * handlers. Its `current` is a signal's value, so the template follows the root as it attaches
1709
+ * and detaches; it is `createFlowRef()`, named for a field next to the other injection functions.
1710
+ *
1711
+ * ```ts
1712
+ * readonly flow = injectFlowRef<Types>();
1713
+ * // <button type="button" (click)="flow.current?.engine.run('fit-view')">Fit</button>
1714
+ * // <div flowRoot [flowRef]="flow" [defaultNodes]="nodes">…</div>
1715
+ * ```
1716
+ */
1717
+ export declare function injectFlowRef<T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []>(): FlowRef<T, F>;
1718
+ /**
1719
+ * A value selected from the model and the engine of the enclosing `[flowRoot]` (React's
1720
+ * `useFlowStore`), as a signal that changes only when the value does (`equal`, default
1721
+ * `Object.is`): `selector` runs again on every change of the model, every view change of the
1722
+ * engine (a measurement, the viewport, a gesture) and every change of a signal it reads. Pass the
1723
+ * registry and the features as the type arguments after the selected value's
1724
+ * (`injectFlowStore<number, Types, typeof features>(…)`). Keep a selector that builds an object or
1725
+ * an array with an `equal` that compares it (`sameFlowValue`), or it changes on every change. Call
1726
+ * it in an injection context (a constructor or a field).
1727
+ */
1728
+ export declare function injectFlowStore<S, T extends FlowTypes = AnyTypes, F extends FlowFeatures = readonly []>(selector: (flow: FlowRefValue<T, F>) => S, equal?: (a: S, b: S) => boolean): Signal<S>;
1729
+ /**
1730
+ * A node as the engine knows it on screen (`internal-node-by`, React's `useInternalNode`): the
1731
+ * document's node, its absolute position and box (`nodeOrigin` applied), whether its size is
1732
+ * known, its z-index and its handles with their centres; undefined while it does not exist or
1733
+ * before the root created its engine. The signal changes only when one of them does (compared by
1734
+ * value): a pan does not. The id is a value, a signal or a getter. Call it in an injection context
1735
+ * (a constructor or a field).
1736
+ */
1737
+ export declare function injectInternalNode<T extends FlowTypes = AnyTypes>(nodeId: ValueOrSignal<string>): Signal<InternalNode<T> | undefined>;
1738
+ interface InjectKeyPressOptions {
1739
+ /**
1740
+ * where the keys are read: a window, a document or an element (`null`: nowhere); default the
1741
+ * root's window
1742
+ */
1743
+ target?: ValueOrSignal<KeyPressTarget | null | undefined>;
1744
+ }
1745
+ /**
1746
+ * Whether a key, or a combo of keys, is held (React's `useKeyPress`), as a signal. `keys` is a
1747
+ * combo or several (any of them): key names joined by `+`, held at once (`"Shift"`, `"Meta+s"`,
1748
+ * `["Meta+z", "Control+z"]`); a name is a `KeyboardEvent.key` or `.code`, without case
1749
+ * (`watchKeyPress`). The keys are read on `target`, by default the window of the enclosing
1750
+ * `[flowRoot]`'s element (never the global one): false outside a root without a `target`. The
1751
+ * keys and the target are values, signals or getters. Call it in an injection context (a
1752
+ * constructor or a field).
1753
+ */
1754
+ export declare function injectKeyPress(keys: ValueOrSignal<KeyPressKeys>, options?: InjectKeyPressOptions): Signal<boolean>;
1755
+ interface InjectNodeConnectionsOptions {
1756
+ /** the node; default the enclosing `[flowNode]`'s */
1757
+ id?: string | undefined;
1758
+ /** only the connections at this handle of it */
1759
+ handleId?: string | undefined;
1760
+ /** only those that start (`"source"`) or end (`"target"`) at it */
1761
+ type?: HandleType | undefined;
1762
+ }
1763
+ /**
1764
+ * The connections at a node (`node-connections-by`, React's `useNodeConnections`): each edge that
1765
+ * starts or ends at it, as its `edgeId`, `source`, `sourceHandle`, `target` and `targetHandle`, in
1766
+ * the document's order. The signal changes only when they do (an edge added, removed or
1767
+ * reconnected there), not when a node moves or an edge's data changes. The options are a value, a
1768
+ * signal or a getter; outside `[flowNode]` they need an `id` (reported once rendered). Call it in
1769
+ * an injection context (a constructor or a field).
1770
+ */
1771
+ export declare function injectNodeConnections(options?: ValueOrSignal<InjectNodeConnectionsOptions>): Signal<readonly NodeConnection[]>;
1772
+ /**
1773
+ * The id of the node the component or directive is inside (`[flowNode]`), or null outside one
1774
+ * (React's `useNodeId`): a custom node's piece reads its own node without being given its id. Call
1775
+ * it in an injection context (a constructor or a field).
1776
+ */
1777
+ export declare function injectNodeId(): Signal<string | null>;
1778
+ /**
1779
+ * Every node of the enclosing `[flowRoot]`, in drawing order, as a signal that changes on every
1780
+ * change of one. Call it in an injection context.
1781
+ */
1782
+ export declare function injectNodes<T extends FlowTypes = AnyTypes>(): Signal<readonly FlowNode<T>[]>;
1783
+ /**
1784
+ * A node's id, type and data (`nodes-data-by`), or null while it does not exist; given several
1785
+ * ids, each existing one's in the order given (React's `useNodesData`). The signal changes only
1786
+ * when one of them does (its type or its data, compared by value), not when a node moves or another
1787
+ * changes. The ids are a value, a signal or a getter (an input is followed); an id not set yet (an
1788
+ * input still `undefined`) gives null, as a single id does: only a list gives a list. Call it in an
1789
+ * injection context (a constructor or a field).
1790
+ */
1791
+ export declare function injectNodesData<T extends FlowTypes = AnyTypes>(nodeId: ValueOrSignal<string | undefined>): Signal<NodeData<T> | null>;
1792
+ export declare function injectNodesData<T extends FlowTypes = AnyTypes>(nodeIds: ValueOrSignal<readonly string[]>): Signal<readonly NodeData<T>[]>;
1793
+ interface InjectOnViewportChangeOptions {
1794
+ /** the viewport starts changing (`viewport-change-start`): a pan, a zoom, an animation */
1795
+ onStart?: ((viewport: Viewport, gesture: boolean) => void) | undefined;
1796
+ /** each change of the viewport (`viewport-change`) */
1797
+ onChange?: ((viewport: Viewport, gesture: boolean) => void) | undefined;
1798
+ /** the viewport stopped changing (`viewport-change-end`) */
1799
+ onEnd?: ((viewport: Viewport, gesture: boolean) => void) | undefined;
1800
+ }
1801
+ /**
1802
+ * Calls back on the viewport's changes of the enclosing `[flowRoot]` (the engine's events, React's
1803
+ * `useOnViewportChange`), marking nothing for a check: `gesture` is true for a pan, the wheel, a
1804
+ * pinch or auto-pan, false for an action. The options are a value, a signal or a getter, read at
1805
+ * each event (the latest callbacks are called). Call it in an injection context (a constructor or
1806
+ * a field).
1807
+ */
1808
+ export declare function injectOnViewportChange(options: ValueOrSignal<InjectOnViewportChangeOptions>): void;
1809
+ /** What is selected. */
1810
+ interface FlowSelection<T extends FlowTypes = AnyTypes> {
1811
+ readonly nodes: readonly FlowNode<T>[];
1812
+ readonly edges: readonly FlowEdge<T>[];
1813
+ }
1814
+ /**
1815
+ * The selected nodes and edges of the enclosing `[flowRoot]` (`selection()`; none without it), as
1816
+ * a signal that changes with them: a panel showing the selection, a Delete button. Call it in an
1817
+ * injection context.
1818
+ */
1819
+ export declare function injectSelection<T extends FlowTypes = AnyTypes>(): Signal<FlowSelection<T>>;
1820
+ /**
1821
+ * The viewport of the enclosing `[flowRoot]` (`{ x, y, zoom }`), as a signal that changes with it:
1822
+ * a zoom level readout, a control's state. Change it with `engine.run("set-viewport")`. Call it in
1823
+ * an injection context (a constructor or a field initializer).
1824
+ */
1825
+ export declare function injectViewport(): Signal<Viewport>;
1826
+ /**
1827
+ * Once rendered, when `element` holds no element of the app's (nor one moved away), `create(document)` gives the
1828
+ * elements to add (run in the directive's injection context: their bindings live with it); they
1829
+ * go with the directive.
1830
+ */
1831
+ declare function defaultContent(element: Element, create: (document: Document) => readonly Element[]): void;
1832
+ /** Where an element goes: its own place (`"here"`), into another element, or nowhere (`null`). */
1833
+ type Presence = "here" | Element | null;
1834
+ /**
1835
+ * Keeps `element` where `where()` says, as it changes; on destroy, its place's comment goes, and
1836
+ * an element moved elsewhere goes too (its view no longer holds it).
1837
+ */
1838
+ declare function bindPresence(element: Element, where: () => Presence): void;
1839
+ export { type AttributeRecord, type BackgroundState, type ConnectionLineState, type ControlButtonState, type ControlsState, type EdgeLabelState, type EdgePathState, type EdgeState, type EdgeToolbarState, type EdgesItemContext, type EdgesState, type FlowRef, type FlowRefValue, type FlowSelection, type HandleState, type InjectEdgeResult, type InjectFlowResult, type InjectHandleOptions, type InjectHandleResult, type InjectKeyPressOptions, type InjectNodeConnectionsOptions, type InjectNodeResult, type InjectOnViewportChangeOptions, type NodeElementProps, type NodeState, type NodeToolbarState, type NodesItemContext, type NodesSelectionState, type NodesState, type ReconnectAnchorState, type RootEngineProps, type RootState, type SelectionBoxState, type StructuralStyle, type ToggleInteractiveState, type TypedBy, type ValueOrSignal, type ViewportMoveEvent, type ViewportState, type AnyFlowEngine as ɵAnyFlowEngine, type AnyFlowModel as ɵAnyFlowModel, type FlowContext as ɵFlowContext, beforeInputs as ɵbeforeInputs, bindAttributes as ɵbindAttributes, bindBaseAttributes as ɵbindBaseAttributes, bindPresence as ɵbindPresence, bindStructuralStyle as ɵbindStructuralStyle, defaultContent as ɵdefaultContent, flowValue as ɵflowValue, injectFlowContext as ɵinjectFlowContext, injectHost as ɵinjectHost, injectNodeContext as ɵinjectNodeContext, onDestroy as ɵonDestroy, optionalBoolean as ɵoptionalBoolean, optionalNumber as ɵoptionalNumber, partOwnerId as ɵpartOwnerId, px as ɵpx };