@html-graph/html-graph 4.0.0 → 4.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.
package/README.md CHANGED
@@ -8,85 +8,10 @@
8
8
  <img width="100%" src="https://raw.githubusercontent.com/html-graph/html-graph/master/media/full-demo.gif"/>
9
9
  </a>
10
10
 
11
- Visit the <a target="_blank" href="https://html-graph.github.io">DOCUMENTATION</a> for more details.
12
-
13
11
  ## Getting started:
14
12
 
15
13
  ```
16
14
  npm i @html-graph/html-graph
17
15
  ```
18
16
 
19
- ```javascript
20
- import { CanvasBuilder } from "@html-graph/html-graph";
21
-
22
- class Application {
23
- constructor(element) {
24
- this.canvas = new CanvasBuilder(element)
25
- .setDefaults({
26
- edges: {
27
- shape: {
28
- hasTargetArrow: true,
29
- },
30
- },
31
- })
32
- .enableUserDraggableNodes()
33
- .enableUserTransformableViewport()
34
- .enableBackground()
35
- .build();
36
- }
37
-
38
- initGraph() {
39
- this.canvas
40
- .addNode(
41
- this.createNode({
42
- name: "Node 1",
43
- x: 200,
44
- y: 400,
45
- frontPortId: "node-1-in",
46
- backPortId: "node-1-out",
47
- }),
48
- )
49
- .addNode(
50
- this.createNode({
51
- name: "Node 2",
52
- x: 600,
53
- y: 500,
54
- frontPortId: "node-2-in",
55
- backPortId: "node-2-out",
56
- }),
57
- )
58
- .addEdge({ from: "node-1-out", to: "node-2-in" });
59
- }
60
-
61
- createNode({ name, x, y, frontPortId, backPortId }) {
62
- const nodeElement = document.createElement("div");
63
- const text = document.createElement("div");
64
- const frontPortElement = document.createElement("div");
65
- const backPortElement = document.createElement("div");
66
-
67
- nodeElement.classList.add("node");
68
- frontPortElement.classList.add("port");
69
- backPortElement.classList.add("port");
70
- text.innerText = name;
71
-
72
- nodeElement.appendChild(frontPortElement);
73
- nodeElement.appendChild(text);
74
- nodeElement.appendChild(backPortElement);
75
-
76
- return {
77
- element: nodeElement,
78
- x: x,
79
- y: y,
80
- ports: [
81
- { id: frontPortId, element: frontPortElement },
82
- { id: backPortId, element: backPortElement },
83
- ],
84
- };
85
- }
86
- }
87
-
88
- const element = document.getElementById("canvas");
89
- const app = new Application(element);
90
-
91
- app.initGraph();
92
- ```
17
+ Visit the <a target="_blank" href="https://html-graph.github.io">DOCUMENTATION</a> for examples and API reference.
@@ -1,15 +1,15 @@
1
1
  export declare interface AddEdgeRequest {
2
- readonly id?: unknown | undefined;
3
- readonly from: unknown;
4
- readonly to: unknown;
2
+ readonly id?: Identifier | undefined;
3
+ readonly from: Identifier;
4
+ readonly to: Identifier;
5
5
  readonly shape?: EdgeShape | undefined;
6
6
  readonly priority?: number | undefined;
7
7
  }
8
8
 
9
9
  declare interface AddEdgeRequest_2 {
10
- readonly id: unknown;
11
- readonly from: unknown;
12
- readonly to: unknown;
10
+ readonly id: Identifier;
11
+ readonly from: Identifier;
12
+ readonly to: Identifier;
13
13
  readonly shape: EdgeShape;
14
14
  readonly priority: number;
15
15
  }
@@ -17,7 +17,7 @@ declare interface AddEdgeRequest_2 {
17
17
  export declare type AddNodePorts = Iterable<MarkNodePortRequest>;
18
18
 
19
19
  export declare interface AddNodeRequest {
20
- readonly id?: unknown | undefined;
20
+ readonly id?: Identifier;
21
21
  readonly element: HTMLElement;
22
22
  readonly x: number;
23
23
  readonly y: number;
@@ -27,7 +27,7 @@ export declare interface AddNodeRequest {
27
27
  }
28
28
 
29
29
  declare interface AddNodeRequest_2 {
30
- readonly id: unknown;
30
+ readonly id: Identifier;
31
31
  readonly element: HTMLElement;
32
32
  readonly x: number;
33
33
  readonly y: number;
@@ -36,8 +36,8 @@ declare interface AddNodeRequest_2 {
36
36
  }
37
37
 
38
38
  declare interface AddPortRequest {
39
- readonly id: unknown;
40
- readonly nodeId: unknown;
39
+ readonly id: Identifier;
40
+ readonly nodeId: Identifier;
41
41
  readonly element: HTMLElement;
42
42
  readonly direction: number;
43
43
  }
@@ -135,13 +135,13 @@ export declare class Canvas {
135
135
  /**
136
136
  * updates node parameters
137
137
  */
138
- updateNode(nodeId: unknown, request?: UpdateNodeRequest): Canvas;
138
+ updateNode(nodeId: Identifier, request?: UpdateNodeRequest): Canvas;
139
139
  /**
140
140
  * removes specified node
141
141
  * all the ports of node get unmarked
142
142
  * all the edges adjacent to node get removed
143
143
  */
144
- removeNode(nodeId: unknown): Canvas;
144
+ removeNode(nodeId: Identifier): Canvas;
145
145
  /**
146
146
  * marks specified element as a port for specified node
147
147
  */
@@ -149,12 +149,12 @@ export declare class Canvas {
149
149
  /**
150
150
  * updates port and edges attached to it
151
151
  */
152
- updatePort(portId: unknown, request?: UpdatePortRequest): Canvas;
152
+ updatePort(portId: Identifier, request?: UpdatePortRequest): Canvas;
153
153
  /**
154
154
  * unmarks specified port
155
155
  * all the edges adjacent to the port get removed
156
156
  */
157
- unmarkPort(portId: unknown): Canvas;
157
+ unmarkPort(portId: Identifier): Canvas;
158
158
  /**
159
159
  * adds new edge
160
160
  */
@@ -162,11 +162,11 @@ export declare class Canvas {
162
162
  /**
163
163
  * updates specified edge
164
164
  */
165
- updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): Canvas;
165
+ updateEdge(edgeId: Identifier, request?: UpdateEdgeRequest): Canvas;
166
166
  /**
167
167
  * removes specified edge
168
168
  */
169
- removeEdge(edgeId: unknown): Canvas;
169
+ removeEdge(edgeId: Identifier): Canvas;
170
170
  /**
171
171
  * applies transformation for viewport matrix
172
172
  */
@@ -203,7 +203,9 @@ export declare class CanvasBuilder {
203
203
  private hasBackground;
204
204
  private hasUserConnectablePorts;
205
205
  private hasUserDraggableEdges;
206
- private boxRenderingTrigger;
206
+ private readonly boxRenderingTrigger;
207
+ private readonly graphStore;
208
+ private readonly viewportStore;
207
209
  private readonly window;
208
210
  constructor(element: HTMLElement);
209
211
  /**
@@ -313,9 +315,9 @@ export declare interface ConnectablePortsConfig {
313
315
  readonly mouseUpEventVerifier?: MouseEventVerifier;
314
316
  readonly dragPortDirection?: number | undefined;
315
317
  readonly events?: {
316
- readonly onAfterEdgeCreated?: (edgeId: unknown) => void;
318
+ readonly onAfterEdgeCreated?: (edgeId: Identifier) => void;
317
319
  readonly onEdgeCreationInterrupted?: (params: {
318
- readonly staticPortId: unknown;
320
+ readonly staticPortId: Identifier;
319
321
  readonly isDirect: boolean;
320
322
  }) => void;
321
323
  readonly onEdgeCreationPrevented?: (request: AddEdgeRequest) => void;
@@ -330,7 +332,7 @@ export declare enum ConnectionCategory {
330
332
 
331
333
  export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest | null;
332
334
 
333
- export declare type ConnectionTypeResolver = (portId: unknown) => "direct" | "reverse" | null;
335
+ export declare type ConnectionTypeResolver = (portId: Identifier) => "direct" | "reverse" | null;
334
336
 
335
337
  declare type ConstantPriority = number;
336
338
 
@@ -381,7 +383,7 @@ declare interface DraggableEdgesConfig {
381
383
  readonly draggingEdgeResolver?: DraggingEdgeResolver;
382
384
  readonly draggingEdgeShape?: EdgeShapeConfig;
383
385
  readonly events?: {
384
- readonly onAfterEdgeReattached?: (edgeId: unknown) => void;
386
+ readonly onAfterEdgeReattached?: (edgeId: Identifier) => void;
385
387
  readonly onEdgeReattachInterrupted?: (edge: GraphEdge) => void;
386
388
  readonly onEdgeReattachPrevented?: (request: AddEdgeRequest) => void;
387
389
  };
@@ -391,32 +393,25 @@ export declare interface DraggableNodesConfig {
391
393
  readonly moveOnTop?: boolean;
392
394
  readonly moveEdgesOnTop?: boolean;
393
395
  readonly gridSize?: number | null;
394
- readonly nodeDragVerifier?: (nodeId: unknown) => boolean;
396
+ readonly nodeDragVerifier?: (nodeId: Identifier) => boolean;
395
397
  readonly mouse?: {
396
398
  readonly dragCursor?: string | null;
397
399
  readonly mouseDownEventVerifier?: MouseEventVerifier;
398
400
  readonly mouseUpEventVerifier?: MouseEventVerifier;
399
401
  };
400
402
  readonly events?: {
401
- readonly onNodeDrag?: (nodeId: unknown) => void;
402
- readonly onNodeDragFinished?: (nodeId: unknown) => void;
403
+ readonly onNodeDrag?: (nodeId: Identifier) => void;
404
+ readonly onNodeDragFinished?: (nodeId: Identifier) => void;
403
405
  };
404
406
  }
405
407
 
406
- export declare type DraggingEdgeResolver = (portId: unknown) => unknown | null;
408
+ export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
407
409
 
408
410
  declare interface EdgePath {
409
411
  readonly path: string;
410
412
  readonly midpoint: Point;
411
413
  }
412
414
 
413
- declare interface EdgePayload {
414
- readonly from: unknown;
415
- readonly to: unknown;
416
- shape: EdgeShape;
417
- priority: number;
418
- }
419
-
420
415
  export declare interface EdgeRenderParams {
421
416
  readonly from: EdgeRenderPort;
422
417
  readonly to: EdgeRenderPort;
@@ -438,7 +433,7 @@ export declare interface EdgeShape {
438
433
 
439
434
  declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | DirectEdgeShapeConfig | EdgeShapeFactory;
440
435
 
441
- declare type EdgeShapeFactory = (edgeId: unknown) => EdgeShape;
436
+ declare type EdgeShapeFactory = (edgeId: Identifier) => EdgeShape;
442
437
 
443
438
  declare interface EventHandler<T> {
444
439
  subscribe(callback: (payload: T) => void): void;
@@ -447,42 +442,42 @@ declare interface EventHandler<T> {
447
442
 
448
443
  export declare class Graph {
449
444
  private readonly graphStore;
450
- readonly onAfterNodeAdded: EventHandler<unknown>;
451
- readonly onAfterNodeUpdated: EventHandler<unknown>;
452
- readonly onAfterNodePriorityUpdated: EventHandler<unknown>;
453
- readonly onBeforeNodeRemoved: EventHandler<unknown>;
454
- readonly onAfterPortMarked: EventHandler<unknown>;
455
- readonly onAfterPortUpdated: EventHandler<unknown>;
456
- readonly onBeforePortUnmarked: EventHandler<unknown>;
457
- readonly onAfterEdgeAdded: EventHandler<unknown>;
458
- readonly onAfterEdgeShapeUpdated: EventHandler<unknown>;
459
- readonly onAfterEdgeUpdated: EventHandler<unknown>;
460
- readonly onAfterEdgePriorityUpdated: EventHandler<unknown>;
461
- readonly onBeforeEdgeRemoved: EventHandler<unknown>;
445
+ readonly onAfterNodeAdded: EventHandler<Identifier>;
446
+ readonly onAfterNodeUpdated: EventHandler<Identifier>;
447
+ readonly onAfterNodePriorityUpdated: EventHandler<Identifier>;
448
+ readonly onBeforeNodeRemoved: EventHandler<Identifier>;
449
+ readonly onAfterPortMarked: EventHandler<Identifier>;
450
+ readonly onAfterPortUpdated: EventHandler<Identifier>;
451
+ readonly onBeforePortUnmarked: EventHandler<Identifier>;
452
+ readonly onAfterEdgeAdded: EventHandler<Identifier>;
453
+ readonly onAfterEdgeShapeUpdated: EventHandler<Identifier>;
454
+ readonly onAfterEdgeUpdated: EventHandler<Identifier>;
455
+ readonly onAfterEdgePriorityUpdated: EventHandler<Identifier>;
456
+ readonly onBeforeEdgeRemoved: EventHandler<Identifier>;
462
457
  readonly onBeforeClear: EventHandler<void>;
463
458
  constructor(graphStore: GraphStore);
464
- getNode(nodeId: unknown): GraphNode | null;
465
- getElementNodeId(element: HTMLElement): unknown | null;
466
- getAllNodeIds(): readonly unknown[];
467
- getPort(portId: unknown): GraphPort | null;
468
- getAllPortIds(): readonly unknown[];
469
- getNodePortIds(nodeId: unknown): readonly unknown[] | null;
470
- getElementPortIds(element: HTMLElement): readonly unknown[];
471
- getAllEdgeIds(): readonly unknown[];
472
- getEdge(edgeId: unknown): GraphEdge | null;
473
- getPortIncomingEdgeIds(portId: unknown): readonly unknown[] | null;
474
- getPortOutgoingEdgeIds(portId: unknown): readonly unknown[] | null;
475
- getPortCycleEdgeIds(portId: unknown): readonly unknown[] | null;
476
- getPortAdjacentEdgeIds(portId: unknown): readonly unknown[] | null;
477
- getNodeIncomingEdgeIds(nodeId: unknown): readonly unknown[] | null;
478
- getNodeOutgoingEdgeIds(nodeId: unknown): readonly unknown[] | null;
479
- getNodeCycleEdgeIds(nodeId: unknown): readonly unknown[] | null;
480
- getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[] | null;
459
+ getNode(nodeId: Identifier): GraphNode | null;
460
+ getElementNodeId(element: HTMLElement): Identifier | null;
461
+ getAllNodeIds(): readonly Identifier[];
462
+ getPort(portId: Identifier): GraphPort | null;
463
+ getAllPortIds(): readonly Identifier[];
464
+ getNodePortIds(nodeId: Identifier): readonly Identifier[] | null;
465
+ getElementPortIds(element: HTMLElement): readonly Identifier[];
466
+ getAllEdgeIds(): readonly Identifier[];
467
+ getEdge(edgeId: Identifier): GraphEdge | null;
468
+ getPortIncomingEdgeIds(portId: Identifier): readonly Identifier[] | null;
469
+ getPortOutgoingEdgeIds(portId: Identifier): readonly Identifier[] | null;
470
+ getPortCycleEdgeIds(portId: Identifier): readonly Identifier[] | null;
471
+ getPortAdjacentEdgeIds(portId: Identifier): readonly Identifier[] | null;
472
+ getNodeIncomingEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
473
+ getNodeOutgoingEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
474
+ getNodeCycleEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
475
+ getNodeAdjacentEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
481
476
  }
482
477
 
483
478
  export declare interface GraphEdge {
484
- readonly from: unknown;
485
- readonly to: unknown;
479
+ readonly from: Identifier;
480
+ readonly to: Identifier;
486
481
  readonly priority: number;
487
482
  readonly shape: EdgeShape;
488
483
  }
@@ -498,7 +493,7 @@ export declare interface GraphNode {
498
493
  export declare interface GraphPort {
499
494
  readonly element: HTMLElement;
500
495
  readonly direction: number;
501
- readonly nodeId: unknown;
496
+ readonly nodeId: Identifier;
502
497
  }
503
498
 
504
499
  declare class GraphStore {
@@ -511,59 +506,59 @@ declare class GraphStore {
511
506
  private readonly cycleEdges;
512
507
  private readonly elementPorts;
513
508
  private readonly afterNodeAddedEmitter;
514
- readonly onAfterNodeAdded: EventHandler<unknown>;
509
+ readonly onAfterNodeAdded: EventHandler<Identifier>;
515
510
  private readonly afterNodeUpdatedEmitter;
516
- readonly onAfterNodeUpdated: EventHandler<unknown>;
511
+ readonly onAfterNodeUpdated: EventHandler<Identifier>;
517
512
  private readonly afterNodePriorityUpdatedEmitter;
518
- readonly onAfterNodePriorityUpdated: EventHandler<unknown>;
513
+ readonly onAfterNodePriorityUpdated: EventHandler<Identifier>;
519
514
  private readonly beforeNodeRemovedEmitter;
520
- readonly onBeforeNodeRemoved: EventHandler<unknown>;
515
+ readonly onBeforeNodeRemoved: EventHandler<Identifier>;
521
516
  private readonly afterPortAddedEmitter;
522
- readonly onAfterPortAdded: EventHandler<unknown>;
517
+ readonly onAfterPortAdded: EventHandler<Identifier>;
523
518
  private readonly afterPortUpdatedEmitter;
524
- readonly onAfterPortUpdated: EventHandler<unknown>;
519
+ readonly onAfterPortUpdated: EventHandler<Identifier>;
525
520
  private readonly beforePortRemovedEmitter;
526
- readonly onBeforePortRemoved: EventHandler<unknown>;
521
+ readonly onBeforePortRemoved: EventHandler<Identifier>;
527
522
  private readonly afterEdgeAddedEmitter;
528
- readonly onAfterEdgeAdded: EventHandler<unknown>;
523
+ readonly onAfterEdgeAdded: EventHandler<Identifier>;
529
524
  private readonly afterEdgeShapeUpdatedEmitter;
530
- readonly onAfterEdgeShapeUpdated: EventHandler<unknown>;
525
+ readonly onAfterEdgeShapeUpdated: EventHandler<Identifier>;
531
526
  private readonly afterEdgeUpdatedEmitter;
532
- readonly onAfterEdgeUpdated: EventHandler<unknown>;
527
+ readonly onAfterEdgeUpdated: EventHandler<Identifier>;
533
528
  private readonly afterEdgePriorityUpdatedEmitter;
534
- readonly onAfterEdgePriorityUpdated: EventHandler<unknown>;
529
+ readonly onAfterEdgePriorityUpdated: EventHandler<Identifier>;
535
530
  private readonly beforeEdgeRemovedEmitter;
536
- readonly onBeforeEdgeRemoved: EventHandler<unknown>;
531
+ readonly onBeforeEdgeRemoved: EventHandler<Identifier>;
537
532
  private readonly beforeClearEmitter;
538
533
  readonly onBeforeClear: EventHandler<void>;
539
534
  constructor();
540
535
  addNode(request: AddNodeRequest_2): void;
541
- getAllNodeIds(): readonly unknown[];
542
- getNode(nodeId: unknown): NodePayload | undefined;
543
- getElementNodeId(element: HTMLElement): unknown | undefined;
544
- updateNode(nodeId: unknown, request: UpdateNodeRequest_2): void;
545
- removeNode(nodeId: unknown): void;
536
+ getAllNodeIds(): readonly Identifier[];
537
+ getNode(nodeId: Identifier): StoreNode | undefined;
538
+ getElementNodeId(element: HTMLElement): Identifier | undefined;
539
+ updateNode(nodeId: Identifier, request: UpdateNodeRequest_2): void;
540
+ removeNode(nodeId: Identifier): void;
546
541
  addPort(request: AddPortRequest): void;
547
- getPort(portId: unknown): PortPayload | undefined;
548
- updatePort(portId: unknown, request: UpdatePortRequest_2): void;
549
- getAllPortIds(): readonly unknown[];
550
- getElementPortIds(element: HTMLElement): readonly unknown[];
551
- getNodePortIds(nodeId: unknown): readonly unknown[] | undefined;
552
- removePort(portId: unknown): void;
542
+ getPort(portId: Identifier): StorePort | undefined;
543
+ updatePort(portId: Identifier, request: UpdatePortRequest_2): void;
544
+ getAllPortIds(): readonly Identifier[];
545
+ getElementPortIds(element: HTMLElement): readonly Identifier[];
546
+ getNodePortIds(nodeId: Identifier): readonly Identifier[] | undefined;
547
+ removePort(portId: Identifier): void;
553
548
  addEdge(request: AddEdgeRequest_2): void;
554
- updateEdge(edgeId: unknown, request: UpdateEdgeRequest_2): void;
555
- getAllEdgeIds(): readonly unknown[];
556
- getEdge(edgeId: unknown): EdgePayload | undefined;
557
- removeEdge(edgeId: unknown): void;
549
+ updateEdge(edgeId: Identifier, request: UpdateEdgeRequest_2): void;
550
+ getAllEdgeIds(): readonly Identifier[];
551
+ getEdge(edgeId: Identifier): StoreEdge | undefined;
552
+ removeEdge(edgeId: Identifier): void;
558
553
  clear(): void;
559
- getPortIncomingEdgeIds(portId: unknown): readonly unknown[];
560
- getPortOutgoingEdgeIds(portId: unknown): readonly unknown[];
561
- getPortCycleEdgeIds(portId: unknown): readonly unknown[];
562
- getPortAdjacentEdgeIds(portId: unknown): readonly unknown[];
563
- getNodeIncomingEdgeIds(nodeId: unknown): readonly unknown[];
564
- getNodeOutgoingEdgeIds(nodeId: unknown): readonly unknown[];
565
- getNodeCycleEdgeIds(nodeId: unknown): readonly unknown[];
566
- getNodeAdjacentEdgeIds(nodeId: unknown): readonly unknown[];
554
+ getPortIncomingEdgeIds(portId: Identifier): readonly Identifier[];
555
+ getPortOutgoingEdgeIds(portId: Identifier): readonly Identifier[];
556
+ getPortCycleEdgeIds(portId: Identifier): readonly Identifier[];
557
+ getPortAdjacentEdgeIds(portId: Identifier): readonly Identifier[];
558
+ getNodeIncomingEdgeIds(nodeId: Identifier): readonly Identifier[];
559
+ getNodeOutgoingEdgeIds(nodeId: Identifier): readonly Identifier[];
560
+ getNodeCycleEdgeIds(nodeId: Identifier): readonly Identifier[];
561
+ getNodeAdjacentEdgeIds(nodeId: Identifier): readonly Identifier[];
567
562
  private addEdgeInternal;
568
563
  private removeEdgeInternal;
569
564
  }
@@ -609,19 +604,21 @@ declare type HorizontalEdgeShapeConfig = {
609
604
  } & HorizontalEdgeParams;
610
605
 
611
606
  declare interface HtmlView {
612
- attachNode(nodeId: unknown): void;
613
- detachNode(nodeId: unknown): void;
614
- attachEdge(edgeId: unknown): void;
615
- detachEdge(edgeId: unknown): void;
607
+ attachNode(nodeId: Identifier): void;
608
+ detachNode(nodeId: Identifier): void;
609
+ attachEdge(edgeId: Identifier): void;
610
+ detachEdge(edgeId: Identifier): void;
616
611
  clear(): void;
617
612
  destroy(): void;
618
- updateNodePosition(nodeId: unknown): void;
619
- updateNodePriority(nodeId: unknown): void;
620
- updateEdgeShape(edgeId: unknown): void;
621
- renderEdge(edgeId: unknown): void;
622
- updateEdgePriority(edgeId: unknown): void;
613
+ updateNodePosition(nodeId: Identifier): void;
614
+ updateNodePriority(nodeId: Identifier): void;
615
+ updateEdgeShape(edgeId: Identifier): void;
616
+ renderEdge(edgeId: Identifier): void;
617
+ updateEdgePriority(edgeId: Identifier): void;
623
618
  }
624
619
 
620
+ export declare type Identifier = NonNullable<unknown>;
621
+
625
622
  declare type IncrementalPriority = "incremental";
626
623
 
627
624
  export declare class InteractiveEdgeError extends Error {
@@ -649,15 +646,15 @@ export declare class InteractiveEdgeShape implements StructuredEdgeShape {
649
646
  }
650
647
 
651
648
  export declare type MarkNodePortRequest = {
652
- readonly id?: unknown | undefined;
649
+ readonly id?: Identifier | undefined;
653
650
  readonly element: HTMLElement;
654
651
  readonly direction?: number | undefined;
655
652
  };
656
653
 
657
654
  export declare interface MarkPortRequest {
658
- readonly id?: unknown;
655
+ readonly id?: Identifier;
659
656
  readonly element: HTMLElement;
660
- readonly nodeId: unknown;
657
+ readonly nodeId: Identifier;
661
658
  readonly direction?: number;
662
659
  }
663
660
 
@@ -676,15 +673,6 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
676
673
 
677
674
  export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
678
675
 
679
- declare interface NodePayload {
680
- readonly element: HTMLElement;
681
- x: number;
682
- y: number;
683
- centerFn: CenterFn;
684
- priority: number;
685
- readonly ports: Map<unknown, HTMLElement>;
686
- }
687
-
688
676
  export declare interface PatchMatrixRequest {
689
677
  readonly scale?: number | undefined;
690
678
  readonly x?: number | undefined;
@@ -702,12 +690,6 @@ export declare interface Point {
702
690
  readonly y: number;
703
691
  }
704
692
 
705
- declare interface PortPayload {
706
- readonly element: HTMLElement;
707
- direction: number;
708
- readonly nodeId: unknown;
709
- }
710
-
711
693
  declare type Priority = ConstantPriority | IncrementalPriority | CustomPriority;
712
694
 
713
695
  export declare type PriorityFn = () => number;
@@ -724,6 +706,34 @@ export declare interface ShiftLimitPreprocessorParams {
724
706
  readonly maxY: number | null;
725
707
  }
726
708
 
709
+ declare interface StoreEdge {
710
+ readonly from: Identifier;
711
+ readonly to: Identifier;
712
+ readonly payload: {
713
+ shape: EdgeShape;
714
+ priority: number;
715
+ };
716
+ }
717
+
718
+ declare interface StoreNode {
719
+ readonly element: HTMLElement;
720
+ readonly payload: {
721
+ x: number;
722
+ y: number;
723
+ centerFn: CenterFn;
724
+ priority: number;
725
+ };
726
+ readonly ports: Map<Identifier, HTMLElement>;
727
+ }
728
+
729
+ declare interface StorePort {
730
+ readonly element: HTMLElement;
731
+ readonly payload: {
732
+ direction: number;
733
+ };
734
+ readonly nodeId: Identifier;
735
+ }
736
+
727
737
  export declare interface StraightEdgeParams {
728
738
  readonly color?: string | undefined;
729
739
  readonly width?: number | undefined;
@@ -814,15 +824,15 @@ declare interface TransformState {
814
824
  }
815
825
 
816
826
  export declare interface UpdateEdgeRequest {
817
- readonly from?: unknown | undefined;
818
- readonly to?: unknown | undefined;
827
+ readonly from?: Identifier | undefined;
828
+ readonly to?: Identifier | undefined;
819
829
  readonly shape?: EdgeShape | undefined;
820
830
  readonly priority?: number | undefined;
821
831
  }
822
832
 
823
833
  declare interface UpdateEdgeRequest_2 {
824
- readonly from?: unknown;
825
- readonly to?: unknown;
834
+ readonly from?: Identifier;
835
+ readonly to?: Identifier;
826
836
  readonly shape?: EdgeShape;
827
837
  readonly priority?: number;
828
838
  }
@@ -937,8 +947,8 @@ export declare interface VirtualScrollConfig {
937
947
  readonly horizontal: number;
938
948
  };
939
949
  readonly events?: {
940
- readonly onBeforeNodeAttached?: (nodeId: unknown) => void;
941
- readonly onAfterNodeDetached?: (nodeId: unknown) => void;
950
+ readonly onBeforeNodeAttached?: (nodeId: Identifier) => void;
951
+ readonly onAfterNodeDetached?: (nodeId: Identifier) => void;
942
952
  };
943
953
  }
944
954