TypeScript and dagrejs npm organization
I'm currently having issues with using the existing typescript bindings (https://www.npmjs.com/package/@types/graphlib) with the latest graphlib release (https://www.npmjs.com/package/@dagrejs/graphlib). Due to the organization switch I have to import it as
import {Graph} from '@dagrejs/graphlib';
However, the Typescript bindings are defined for just the graphlib module namespace, thus not applying. In the best case the typings are directly integrated and provided as part of this library.
Here is a workaround for this issue. One can add local typings for "@dagrejs/graphlib" module and reexport everything from "graphlib"
Add these lines to your tsconfig.json
"compilerOptions": {
....
"baseUrl": ".",
"paths": { "*": ["types/*"] },
....
}
Then create types folder inside your project, then make @dagrejs directory inside types folder and put graphlib.d.ts file with a single export statement:
export * from "graphlib"
You can ask VS Code to help with these steps

index.d.ts has been added to the repo and the v2.1.11 npm package. Let me know if that's not enough or the types are incorrect.