@@ -6,23 +6,47 @@ declare interface Point {
66 y : number ;
77}
88
9+ declare enum RoutingParameter {
10+ "segmentPenalty" ,
11+ "anglePenalty" ,
12+ "crossingPenalty" ,
13+ "clusterCrossingPenalty" ,
14+ "fixedSharedPathPenalty" ,
15+ "portDirectionPenalty" ,
16+ "shapeBufferDistance" ,
17+ "idealNudgingDistance" ,
18+ "reverseDirectionPenalty" ,
19+ }
20+
21+ declare enum RoutingOption {
22+ "nudgeOrthogonalSegmentsConnectedToShapes" ,
23+ "improveHyperedgeRoutesMovingJunctions" ,
24+ "penaliseOrthogonalSharedPathsAtConnEnds" ,
25+ "nudgeOrthogonalTouchingColinearSegments" ,
26+ "performUnifyingNudgingPreprocessingStep" ,
27+ "improveHyperedgeRoutesMovingAddingAndDeletingJunctions" ,
28+ "nudgeSharedPathsWithCommonEndPoint" ,
29+ }
30+
931declare interface Router {
1032 new ( flags : number ) : Router ;
1133
1234 processTransaction ( ) : void ;
1335 printInfo ( ) : void ;
1436 deleteConnector ( connRef : ConnRef ) : void ;
1537
16- moveShape ( shape : ShapeRef , newPolygon : Polygon ) ;
17- moveShape ( shape : ShapeRef , xDiff : number , yDiff : number ) ;
38+ moveShape_poly ( shape : ShapeRef , newPolygon : Polygon ) ;
39+ moveShape_delta ( shape : ShapeRef , xDiff : number , yDiff : number ) ;
1840 deleteShape ( shape : ShapeRef ) ;
19- setRoutingParameter ( parameter : number , value : number ) : void ;
20- setRoutingOption ( option : number , value : boolean ) : void ;
41+ setRoutingParameter ( parameter : RoutingParameter , value : number ) : void ;
42+ setRoutingOption ( option : RoutingOption , value : boolean ) : void ;
43+
44+ delete ( ) : void ;
2145}
2246
2347declare interface PolyLine {
2448 size ( ) : number ;
25- get_ps ( index : number ) : Point ;
49+ at ( index : number ) : Point ;
2650}
2751
2852declare interface ConnEnd {
@@ -31,6 +55,16 @@ declare interface ConnEnd {
3155 createConnEndFromJunctionRef ( JunctionRef : JunctionRef , classId : number ) : ConnEnd ;
3256}
3357
58+ declare interface Checkpoint {
59+ new ( point : Point ) : Checkpoint ;
60+ new ( point : Point , ad : ConnDirFlags , dd : ConnDirFlags ) : Checkpoint ;
61+ }
62+
63+ declare interface CheckpointVector {
64+ new ( ) : CheckpointVector ;
65+ push_back ( checkpoint : Checkpoint ) : void ;
66+ }
67+
3468declare interface ConnRef {
3569 new ( router : Router ) : ConnRef ;
3670 new ( router : Router , srcConnEnd : ConnEnd , dstConnEnd : ConnEnd ) : ConnRef ;
@@ -39,6 +73,9 @@ declare interface ConnRef {
3973 setSourceEndpoint ( srcPoint : ConnEnd ) : void ;
4074 setDestEndpoint ( dstPoint : ConnEnd ) : void ;
4175 setRoutingType ( type : number ) : void ;
76+ setRoutingCheckpoints ( checkpoints : CheckpointVector ) : void ;
77+ routingCheckpoints ( ) : CheckpointVector ;
78+
4279 // connRefPtr is raw pointer to the object, to get ConnRef object use:
4380 // `const connRef = Avoid.wrapPointer(connRefPtr, Avoid.ConnRef)`
4481 // more details: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html#pointers-and-comparisons
@@ -62,6 +99,7 @@ declare interface ShapeConnectionPin {
6299 directions ( ) : ConnDirFlags ;
63100 position ( ) : Point ;
64101 updatePosition ( newPosition : Point ) : void ;
102+ delete ( ) : void ;
65103}
66104
67105
@@ -101,6 +139,8 @@ export interface Avoid {
101139
102140 ConnEnd : ConnEnd ;
103141 ConnRef : ConnRef ;
142+ Checkpoint : Checkpoint ;
143+ CheckpointVector : CheckpointVector ;
104144 Point : Point ;
105145 Rectangle : Rectangle ;
106146 Router : Router ;
@@ -109,6 +149,9 @@ export interface Avoid {
109149 JunctionRef : JunctionRef ;
110150 ShapeConnectionPin : ShapeConnectionPin ;
111151
152+ RoutingParameter : Record < keyof typeof RoutingParameter , RoutingParameter > ;
153+ RoutingOption : Record < keyof typeof RoutingOption , RoutingOption > ;
154+
112155 destroy ( obj : any ) : void ;
113156 getPointer ( obj : any ) : number ;
114157 wrapPointer < T > ( ptr : number , Class : T ) : T ;
0 commit comments