Skip to content

Fix TypeScript type definition syntax error in dijkstraAll#222

Merged
rustedgrail merged 1 commit intodagrejs:masterfrom
ophirg:fix-dijkstraAll-type-definition
Feb 9, 2026
Merged

Fix TypeScript type definition syntax error in dijkstraAll#222
rustedgrail merged 1 commit intodagrejs:masterfrom
ophirg:fix-dijkstraAll-type-definition

Conversation

@ophirg
Copy link
Contributor

@ophirg ophirg commented Feb 6, 2026

Issue

The dijkstraAll function had a malformed return type in index.d.ts (line 489) that caused TypeScript compilation errors.

Change

Fixed the return type signature from:
typescript): { : { [node: string]: Path } };
to:
typescript): { [source: string]: { [node: string]: Path } };

Impact

Resolves TypeScript errors when using the library with TypeScript projects
The return type now correctly represents that dijkstraAll returns an object mapping source nodes to their shortest path results
Aligns the type definition with the actual JavaScript implementation in lib/alg/dijkstra-all.js

Errors Fixed

TS1131: Property or signature expected
TS1005: ',' expected
TS1128: Declaration or statement expected

@ophirg
Copy link
Contributor Author

ophirg commented Feb 6, 2026

Should fix #221

@rustedgrail rustedgrail merged commit 41e9a79 into dagrejs:master Feb 9, 2026
1 check passed
@ophirg ophirg deleted the fix-dijkstraAll-type-definition branch February 10, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants