Skip to content

Commit

Permalink
Add explanation how to convert pointer to the object in ConnRef callb…
Browse files Browse the repository at this point in the history
…ack instead of exposing internal pointer of the object
  • Loading branch information
Aksem committed Oct 26, 2024
1 parent 60ae7c4 commit 418fa15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions typings/libavoid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ declare interface ConnRef {
new (router: Router): ConnRef;
new (router: Router, srcConnEnd: ConnEnd, dstConnEnd: ConnEnd): ConnRef;

g: number;

displayRoute(): PolyLine;
setSourceEndpoint(srcPoint: ConnEnd): void;
setDestEndpoint(dstPoint: ConnEnd): void;
setRoutingType(type: number): void;
// connRefPtr is raw pointer to the object, to get ConnRef object use:
// `const connRef = Avoid.wrapPointer(connRefPtr, Avoid.ConnRef)`
// more details: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html#pointers-and-comparisons
setCallback(callback: (connRefPtr: number) => void, connRef: ConnRef): void;

setHateCrossings(value: boolean): void;
Expand Down

0 comments on commit 418fa15

Please sign in to comment.