@html-graph/html-graph 4.0.0 → 5.0.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.
@@ -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,12 +36,33 @@ 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
  }
44
44
 
45
+ export declare type ArrowRenderer = (params: ArrowRenderingParams) => string;
46
+
47
+ export declare type ArrowRendererConfig = {
48
+ readonly type?: "wedge";
49
+ readonly radius?: number | undefined;
50
+ readonly smallRadius?: number | undefined;
51
+ readonly angle?: number | undefined;
52
+ } | {
53
+ readonly type: "triangle";
54
+ readonly radius?: number | undefined;
55
+ } | {
56
+ readonly type: "arc";
57
+ readonly radius?: number | undefined;
58
+ } | ArrowRenderer;
59
+
60
+ export declare interface ArrowRenderingParams {
61
+ readonly direction: Point;
62
+ readonly shift: Point;
63
+ readonly arrowLength: number;
64
+ }
65
+
45
66
  export declare interface BackgroundConfig {
46
67
  readonly tileDimensions?: {
47
68
  readonly width?: number;
@@ -55,7 +76,7 @@ export declare interface BezierEdgeParams {
55
76
  readonly color?: string | undefined;
56
77
  readonly width?: number | undefined;
57
78
  readonly arrowLength?: number | undefined;
58
- readonly arrowWidth?: number | undefined;
79
+ readonly arrowRenderer?: ArrowRendererConfig | undefined;
59
80
  readonly curvature?: number | undefined;
60
81
  readonly hasSourceArrow?: boolean | undefined;
61
82
  readonly hasTargetArrow?: boolean | undefined;
@@ -73,7 +94,6 @@ export declare class BezierEdgeShape implements StructuredEdgeShape {
73
94
  readonly targetArrow: SVGPathElement | null;
74
95
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
75
96
  private readonly arrowLength;
76
- private readonly arrowWidth;
77
97
  private readonly curvature;
78
98
  private readonly portCycleRadius;
79
99
  private readonly portCycleSmallRadius;
@@ -135,13 +155,13 @@ export declare class Canvas {
135
155
  /**
136
156
  * updates node parameters
137
157
  */
138
- updateNode(nodeId: unknown, request?: UpdateNodeRequest): Canvas;
158
+ updateNode(nodeId: Identifier, request?: UpdateNodeRequest): Canvas;
139
159
  /**
140
160
  * removes specified node
141
161
  * all the ports of node get unmarked
142
162
  * all the edges adjacent to node get removed
143
163
  */
144
- removeNode(nodeId: unknown): Canvas;
164
+ removeNode(nodeId: Identifier): Canvas;
145
165
  /**
146
166
  * marks specified element as a port for specified node
147
167
  */
@@ -149,12 +169,12 @@ export declare class Canvas {
149
169
  /**
150
170
  * updates port and edges attached to it
151
171
  */
152
- updatePort(portId: unknown, request?: UpdatePortRequest): Canvas;
172
+ updatePort(portId: Identifier, request?: UpdatePortRequest): Canvas;
153
173
  /**
154
174
  * unmarks specified port
155
175
  * all the edges adjacent to the port get removed
156
176
  */
157
- unmarkPort(portId: unknown): Canvas;
177
+ unmarkPort(portId: Identifier): Canvas;
158
178
  /**
159
179
  * adds new edge
160
180
  */
@@ -162,11 +182,11 @@ export declare class Canvas {
162
182
  /**
163
183
  * updates specified edge
164
184
  */
165
- updateEdge(edgeId: unknown, request?: UpdateEdgeRequest): Canvas;
185
+ updateEdge(edgeId: Identifier, request?: UpdateEdgeRequest): Canvas;
166
186
  /**
167
187
  * removes specified edge
168
188
  */
169
- removeEdge(edgeId: unknown): Canvas;
189
+ removeEdge(edgeId: Identifier): Canvas;
170
190
  /**
171
191
  * applies transformation for viewport matrix
172
192
  */
@@ -203,7 +223,9 @@ export declare class CanvasBuilder {
203
223
  private hasBackground;
204
224
  private hasUserConnectablePorts;
205
225
  private hasUserDraggableEdges;
206
- private boxRenderingTrigger;
226
+ private readonly boxRenderingTrigger;
227
+ private readonly graphStore;
228
+ private readonly viewportStore;
207
229
  private readonly window;
208
230
  constructor(element: HTMLElement);
209
231
  /**
@@ -313,9 +335,9 @@ export declare interface ConnectablePortsConfig {
313
335
  readonly mouseUpEventVerifier?: MouseEventVerifier;
314
336
  readonly dragPortDirection?: number | undefined;
315
337
  readonly events?: {
316
- readonly onAfterEdgeCreated?: (edgeId: unknown) => void;
338
+ readonly onAfterEdgeCreated?: (edgeId: Identifier) => void;
317
339
  readonly onEdgeCreationInterrupted?: (params: {
318
- readonly staticPortId: unknown;
340
+ readonly staticPortId: Identifier;
319
341
  readonly isDirect: boolean;
320
342
  }) => void;
321
343
  readonly onEdgeCreationPrevented?: (request: AddEdgeRequest) => void;
@@ -330,7 +352,7 @@ export declare enum ConnectionCategory {
330
352
 
331
353
  export declare type ConnectionPreprocessor = (request: AddEdgeRequest) => AddEdgeRequest | null;
332
354
 
333
- export declare type ConnectionTypeResolver = (portId: unknown) => "direct" | "reverse" | null;
355
+ export declare type ConnectionTypeResolver = (portId: Identifier) => "direct" | "reverse" | null;
334
356
 
335
357
  declare type ConstantPriority = number;
336
358
 
@@ -340,7 +362,7 @@ export declare interface DirectEdgeParams {
340
362
  readonly color?: string | undefined;
341
363
  readonly width?: number | undefined;
342
364
  readonly arrowLength?: number | undefined;
343
- readonly arrowWidth?: number | undefined;
365
+ readonly arrowRenderer?: ArrowRendererConfig | undefined;
344
366
  readonly hasSourceArrow?: boolean | undefined;
345
367
  readonly hasTargetArrow?: boolean | undefined;
346
368
  readonly sourceOffset?: number | undefined;
@@ -356,11 +378,11 @@ export declare class DirectEdgeShape implements StructuredEdgeShape {
356
378
  private readonly color;
357
379
  private readonly width;
358
380
  private readonly arrowLength;
359
- private readonly arrowWidth;
360
381
  private readonly sourceOffset;
361
382
  private readonly targetOffset;
362
383
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
363
384
  private readonly afterRenderEmitter;
385
+ private readonly arrowRenderer;
364
386
  constructor(params?: DirectEdgeParams);
365
387
  render(params: EdgeRenderParams): void;
366
388
  }
@@ -381,7 +403,7 @@ declare interface DraggableEdgesConfig {
381
403
  readonly draggingEdgeResolver?: DraggingEdgeResolver;
382
404
  readonly draggingEdgeShape?: EdgeShapeConfig;
383
405
  readonly events?: {
384
- readonly onAfterEdgeReattached?: (edgeId: unknown) => void;
406
+ readonly onAfterEdgeReattached?: (edgeId: Identifier) => void;
385
407
  readonly onEdgeReattachInterrupted?: (edge: GraphEdge) => void;
386
408
  readonly onEdgeReattachPrevented?: (request: AddEdgeRequest) => void;
387
409
  };
@@ -391,32 +413,25 @@ export declare interface DraggableNodesConfig {
391
413
  readonly moveOnTop?: boolean;
392
414
  readonly moveEdgesOnTop?: boolean;
393
415
  readonly gridSize?: number | null;
394
- readonly nodeDragVerifier?: (nodeId: unknown) => boolean;
416
+ readonly nodeDragVerifier?: (nodeId: Identifier) => boolean;
395
417
  readonly mouse?: {
396
418
  readonly dragCursor?: string | null;
397
419
  readonly mouseDownEventVerifier?: MouseEventVerifier;
398
420
  readonly mouseUpEventVerifier?: MouseEventVerifier;
399
421
  };
400
422
  readonly events?: {
401
- readonly onNodeDrag?: (nodeId: unknown) => void;
402
- readonly onNodeDragFinished?: (nodeId: unknown) => void;
423
+ readonly onNodeDrag?: (nodeId: Identifier) => void;
424
+ readonly onNodeDragFinished?: (nodeId: Identifier) => void;
403
425
  };
404
426
  }
405
427
 
406
- export declare type DraggingEdgeResolver = (portId: unknown) => unknown | null;
428
+ export declare type DraggingEdgeResolver = (portId: Identifier) => Identifier | null;
407
429
 
408
430
  declare interface EdgePath {
409
431
  readonly path: string;
410
432
  readonly midpoint: Point;
411
433
  }
412
434
 
413
- declare interface EdgePayload {
414
- readonly from: unknown;
415
- readonly to: unknown;
416
- shape: EdgeShape;
417
- priority: number;
418
- }
419
-
420
435
  export declare interface EdgeRenderParams {
421
436
  readonly from: EdgeRenderPort;
422
437
  readonly to: EdgeRenderPort;
@@ -438,7 +453,7 @@ export declare interface EdgeShape {
438
453
 
439
454
  declare type EdgeShapeConfig = BezierEdgeShapeConfig | StraightEdgeShapeConfig | HorizontalEdgeShapeConfig | VerticalEdgeShapeConfig | DirectEdgeShapeConfig | EdgeShapeFactory;
440
455
 
441
- declare type EdgeShapeFactory = (edgeId: unknown) => EdgeShape;
456
+ declare type EdgeShapeFactory = (edgeId: Identifier) => EdgeShape;
442
457
 
443
458
  declare interface EventHandler<T> {
444
459
  subscribe(callback: (payload: T) => void): void;
@@ -447,42 +462,42 @@ declare interface EventHandler<T> {
447
462
 
448
463
  export declare class Graph {
449
464
  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>;
465
+ readonly onAfterNodeAdded: EventHandler<Identifier>;
466
+ readonly onAfterNodeUpdated: EventHandler<Identifier>;
467
+ readonly onAfterNodePriorityUpdated: EventHandler<Identifier>;
468
+ readonly onBeforeNodeRemoved: EventHandler<Identifier>;
469
+ readonly onAfterPortMarked: EventHandler<Identifier>;
470
+ readonly onAfterPortUpdated: EventHandler<Identifier>;
471
+ readonly onBeforePortUnmarked: EventHandler<Identifier>;
472
+ readonly onAfterEdgeAdded: EventHandler<Identifier>;
473
+ readonly onAfterEdgeShapeUpdated: EventHandler<Identifier>;
474
+ readonly onAfterEdgeUpdated: EventHandler<Identifier>;
475
+ readonly onAfterEdgePriorityUpdated: EventHandler<Identifier>;
476
+ readonly onBeforeEdgeRemoved: EventHandler<Identifier>;
462
477
  readonly onBeforeClear: EventHandler<void>;
463
478
  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;
479
+ getNode(nodeId: Identifier): GraphNode | null;
480
+ getElementNodeId(element: HTMLElement): Identifier | null;
481
+ getAllNodeIds(): readonly Identifier[];
482
+ getPort(portId: Identifier): GraphPort | null;
483
+ getAllPortIds(): readonly Identifier[];
484
+ getNodePortIds(nodeId: Identifier): readonly Identifier[] | null;
485
+ getElementPortIds(element: HTMLElement): readonly Identifier[];
486
+ getAllEdgeIds(): readonly Identifier[];
487
+ getEdge(edgeId: Identifier): GraphEdge | null;
488
+ getPortIncomingEdgeIds(portId: Identifier): readonly Identifier[] | null;
489
+ getPortOutgoingEdgeIds(portId: Identifier): readonly Identifier[] | null;
490
+ getPortCycleEdgeIds(portId: Identifier): readonly Identifier[] | null;
491
+ getPortAdjacentEdgeIds(portId: Identifier): readonly Identifier[] | null;
492
+ getNodeIncomingEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
493
+ getNodeOutgoingEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
494
+ getNodeCycleEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
495
+ getNodeAdjacentEdgeIds(nodeId: Identifier): readonly Identifier[] | null;
481
496
  }
482
497
 
483
498
  export declare interface GraphEdge {
484
- readonly from: unknown;
485
- readonly to: unknown;
499
+ readonly from: Identifier;
500
+ readonly to: Identifier;
486
501
  readonly priority: number;
487
502
  readonly shape: EdgeShape;
488
503
  }
@@ -498,7 +513,7 @@ export declare interface GraphNode {
498
513
  export declare interface GraphPort {
499
514
  readonly element: HTMLElement;
500
515
  readonly direction: number;
501
- readonly nodeId: unknown;
516
+ readonly nodeId: Identifier;
502
517
  }
503
518
 
504
519
  declare class GraphStore {
@@ -511,59 +526,59 @@ declare class GraphStore {
511
526
  private readonly cycleEdges;
512
527
  private readonly elementPorts;
513
528
  private readonly afterNodeAddedEmitter;
514
- readonly onAfterNodeAdded: EventHandler<unknown>;
529
+ readonly onAfterNodeAdded: EventHandler<Identifier>;
515
530
  private readonly afterNodeUpdatedEmitter;
516
- readonly onAfterNodeUpdated: EventHandler<unknown>;
531
+ readonly onAfterNodeUpdated: EventHandler<Identifier>;
517
532
  private readonly afterNodePriorityUpdatedEmitter;
518
- readonly onAfterNodePriorityUpdated: EventHandler<unknown>;
533
+ readonly onAfterNodePriorityUpdated: EventHandler<Identifier>;
519
534
  private readonly beforeNodeRemovedEmitter;
520
- readonly onBeforeNodeRemoved: EventHandler<unknown>;
535
+ readonly onBeforeNodeRemoved: EventHandler<Identifier>;
521
536
  private readonly afterPortAddedEmitter;
522
- readonly onAfterPortAdded: EventHandler<unknown>;
537
+ readonly onAfterPortAdded: EventHandler<Identifier>;
523
538
  private readonly afterPortUpdatedEmitter;
524
- readonly onAfterPortUpdated: EventHandler<unknown>;
539
+ readonly onAfterPortUpdated: EventHandler<Identifier>;
525
540
  private readonly beforePortRemovedEmitter;
526
- readonly onBeforePortRemoved: EventHandler<unknown>;
541
+ readonly onBeforePortRemoved: EventHandler<Identifier>;
527
542
  private readonly afterEdgeAddedEmitter;
528
- readonly onAfterEdgeAdded: EventHandler<unknown>;
543
+ readonly onAfterEdgeAdded: EventHandler<Identifier>;
529
544
  private readonly afterEdgeShapeUpdatedEmitter;
530
- readonly onAfterEdgeShapeUpdated: EventHandler<unknown>;
545
+ readonly onAfterEdgeShapeUpdated: EventHandler<Identifier>;
531
546
  private readonly afterEdgeUpdatedEmitter;
532
- readonly onAfterEdgeUpdated: EventHandler<unknown>;
547
+ readonly onAfterEdgeUpdated: EventHandler<Identifier>;
533
548
  private readonly afterEdgePriorityUpdatedEmitter;
534
- readonly onAfterEdgePriorityUpdated: EventHandler<unknown>;
549
+ readonly onAfterEdgePriorityUpdated: EventHandler<Identifier>;
535
550
  private readonly beforeEdgeRemovedEmitter;
536
- readonly onBeforeEdgeRemoved: EventHandler<unknown>;
551
+ readonly onBeforeEdgeRemoved: EventHandler<Identifier>;
537
552
  private readonly beforeClearEmitter;
538
553
  readonly onBeforeClear: EventHandler<void>;
539
554
  constructor();
540
555
  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;
556
+ getAllNodeIds(): readonly Identifier[];
557
+ getNode(nodeId: Identifier): StoreNode | undefined;
558
+ getElementNodeId(element: HTMLElement): Identifier | undefined;
559
+ updateNode(nodeId: Identifier, request: UpdateNodeRequest_2): void;
560
+ removeNode(nodeId: Identifier): void;
546
561
  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;
562
+ getPort(portId: Identifier): StorePort | undefined;
563
+ updatePort(portId: Identifier, request: UpdatePortRequest_2): void;
564
+ getAllPortIds(): readonly Identifier[];
565
+ getElementPortIds(element: HTMLElement): readonly Identifier[];
566
+ getNodePortIds(nodeId: Identifier): readonly Identifier[] | undefined;
567
+ removePort(portId: Identifier): void;
553
568
  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;
569
+ updateEdge(edgeId: Identifier, request: UpdateEdgeRequest_2): void;
570
+ getAllEdgeIds(): readonly Identifier[];
571
+ getEdge(edgeId: Identifier): StoreEdge | undefined;
572
+ removeEdge(edgeId: Identifier): void;
558
573
  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[];
574
+ getPortIncomingEdgeIds(portId: Identifier): readonly Identifier[];
575
+ getPortOutgoingEdgeIds(portId: Identifier): readonly Identifier[];
576
+ getPortCycleEdgeIds(portId: Identifier): readonly Identifier[];
577
+ getPortAdjacentEdgeIds(portId: Identifier): readonly Identifier[];
578
+ getNodeIncomingEdgeIds(nodeId: Identifier): readonly Identifier[];
579
+ getNodeOutgoingEdgeIds(nodeId: Identifier): readonly Identifier[];
580
+ getNodeCycleEdgeIds(nodeId: Identifier): readonly Identifier[];
581
+ getNodeAdjacentEdgeIds(nodeId: Identifier): readonly Identifier[];
567
582
  private addEdgeInternal;
568
583
  private removeEdgeInternal;
569
584
  }
@@ -572,7 +587,7 @@ export declare interface HorizontalEdgeParams {
572
587
  readonly color?: string | undefined;
573
588
  readonly width?: number | undefined;
574
589
  readonly arrowLength?: number | undefined;
575
- readonly arrowWidth?: number | undefined;
590
+ readonly arrowRenderer?: ArrowRendererConfig | undefined;
576
591
  readonly arrowOffset?: number | undefined;
577
592
  readonly hasSourceArrow?: boolean | undefined;
578
593
  readonly hasTargetArrow?: boolean | undefined;
@@ -589,7 +604,6 @@ export declare class HorizontalEdgeShape implements StructuredEdgeShape {
589
604
  readonly targetArrow: SVGPathElement | null;
590
605
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
591
606
  private readonly arrowLength;
592
- private readonly arrowWidth;
593
607
  private readonly arrowOffset;
594
608
  private readonly roundness;
595
609
  private readonly cycleSquareSide;
@@ -609,19 +623,21 @@ declare type HorizontalEdgeShapeConfig = {
609
623
  } & HorizontalEdgeParams;
610
624
 
611
625
  declare interface HtmlView {
612
- attachNode(nodeId: unknown): void;
613
- detachNode(nodeId: unknown): void;
614
- attachEdge(edgeId: unknown): void;
615
- detachEdge(edgeId: unknown): void;
626
+ attachNode(nodeId: Identifier): void;
627
+ detachNode(nodeId: Identifier): void;
628
+ attachEdge(edgeId: Identifier): void;
629
+ detachEdge(edgeId: Identifier): void;
616
630
  clear(): void;
617
631
  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;
632
+ updateNodePosition(nodeId: Identifier): void;
633
+ updateNodePriority(nodeId: Identifier): void;
634
+ updateEdgeShape(edgeId: Identifier): void;
635
+ renderEdge(edgeId: Identifier): void;
636
+ updateEdgePriority(edgeId: Identifier): void;
623
637
  }
624
638
 
639
+ export declare type Identifier = NonNullable<unknown>;
640
+
625
641
  declare type IncrementalPriority = "incremental";
626
642
 
627
643
  export declare class InteractiveEdgeError extends Error {
@@ -649,15 +665,15 @@ export declare class InteractiveEdgeShape implements StructuredEdgeShape {
649
665
  }
650
666
 
651
667
  export declare type MarkNodePortRequest = {
652
- readonly id?: unknown | undefined;
668
+ readonly id?: Identifier | undefined;
653
669
  readonly element: HTMLElement;
654
670
  readonly direction?: number | undefined;
655
671
  };
656
672
 
657
673
  export declare interface MarkPortRequest {
658
- readonly id?: unknown;
674
+ readonly id?: Identifier;
659
675
  readonly element: HTMLElement;
660
- readonly nodeId: unknown;
676
+ readonly nodeId: Identifier;
661
677
  readonly direction?: number;
662
678
  }
663
679
 
@@ -676,15 +692,6 @@ export declare class MidpointEdgeShape implements StructuredEdgeShape {
676
692
 
677
693
  export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
678
694
 
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
695
  export declare interface PatchMatrixRequest {
689
696
  readonly scale?: number | undefined;
690
697
  readonly x?: number | undefined;
@@ -702,12 +709,6 @@ export declare interface Point {
702
709
  readonly y: number;
703
710
  }
704
711
 
705
- declare interface PortPayload {
706
- readonly element: HTMLElement;
707
- direction: number;
708
- readonly nodeId: unknown;
709
- }
710
-
711
712
  declare type Priority = ConstantPriority | IncrementalPriority | CustomPriority;
712
713
 
713
714
  export declare type PriorityFn = () => number;
@@ -724,12 +725,40 @@ export declare interface ShiftLimitPreprocessorParams {
724
725
  readonly maxY: number | null;
725
726
  }
726
727
 
728
+ declare interface StoreEdge {
729
+ readonly from: Identifier;
730
+ readonly to: Identifier;
731
+ readonly payload: {
732
+ shape: EdgeShape;
733
+ priority: number;
734
+ };
735
+ }
736
+
737
+ declare interface StoreNode {
738
+ readonly element: HTMLElement;
739
+ readonly payload: {
740
+ x: number;
741
+ y: number;
742
+ centerFn: CenterFn;
743
+ priority: number;
744
+ };
745
+ readonly ports: Map<Identifier, HTMLElement>;
746
+ }
747
+
748
+ declare interface StorePort {
749
+ readonly element: HTMLElement;
750
+ readonly payload: {
751
+ direction: number;
752
+ };
753
+ readonly nodeId: Identifier;
754
+ }
755
+
727
756
  export declare interface StraightEdgeParams {
728
757
  readonly color?: string | undefined;
729
758
  readonly width?: number | undefined;
730
759
  readonly arrowLength?: number | undefined;
731
- readonly arrowWidth?: number | undefined;
732
760
  readonly arrowOffset?: number | undefined;
761
+ readonly arrowRenderer?: ArrowRendererConfig | undefined;
733
762
  readonly hasSourceArrow?: boolean | undefined;
734
763
  readonly hasTargetArrow?: boolean | undefined;
735
764
  readonly cycleSquareSide?: number | undefined;
@@ -746,7 +775,6 @@ export declare class StraightEdgeShape implements StructuredEdgeShape {
746
775
  readonly targetArrow: SVGPathElement | null;
747
776
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
748
777
  private readonly arrowLength;
749
- private readonly arrowWidth;
750
778
  private readonly arrowOffset;
751
779
  private readonly roundness;
752
780
  private readonly cycleSquareSide;
@@ -814,15 +842,15 @@ declare interface TransformState {
814
842
  }
815
843
 
816
844
  export declare interface UpdateEdgeRequest {
817
- readonly from?: unknown | undefined;
818
- readonly to?: unknown | undefined;
845
+ readonly from?: Identifier | undefined;
846
+ readonly to?: Identifier | undefined;
819
847
  readonly shape?: EdgeShape | undefined;
820
848
  readonly priority?: number | undefined;
821
849
  }
822
850
 
823
851
  declare interface UpdateEdgeRequest_2 {
824
- readonly from?: unknown;
825
- readonly to?: unknown;
852
+ readonly from?: Identifier;
853
+ readonly to?: Identifier;
826
854
  readonly shape?: EdgeShape;
827
855
  readonly priority?: number;
828
856
  }
@@ -853,8 +881,8 @@ export declare interface VerticalEdgeParams {
853
881
  readonly color?: string | undefined;
854
882
  readonly width?: number | undefined;
855
883
  readonly arrowLength?: number | undefined;
856
- readonly arrowWidth?: number | undefined;
857
884
  readonly arrowOffset?: number | undefined;
885
+ readonly arrowRenderer?: ArrowRendererConfig | undefined;
858
886
  readonly hasSourceArrow?: boolean | undefined;
859
887
  readonly hasTargetArrow?: boolean | undefined;
860
888
  readonly cycleSquareSide?: number | undefined;
@@ -870,7 +898,6 @@ export declare class VerticalEdgeShape implements StructuredEdgeShape {
870
898
  readonly targetArrow: SVGPathElement | null;
871
899
  readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
872
900
  private readonly arrowLength;
873
- private readonly arrowWidth;
874
901
  private readonly arrowOffset;
875
902
  private readonly roundness;
876
903
  private readonly cycleSquareSide;
@@ -937,8 +964,8 @@ export declare interface VirtualScrollConfig {
937
964
  readonly horizontal: number;
938
965
  };
939
966
  readonly events?: {
940
- readonly onBeforeNodeAttached?: (nodeId: unknown) => void;
941
- readonly onAfterNodeDetached?: (nodeId: unknown) => void;
967
+ readonly onBeforeNodeAttached?: (nodeId: Identifier) => void;
968
+ readonly onAfterNodeDetached?: (nodeId: Identifier) => void;
942
969
  };
943
970
  }
944
971