Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please update typescript definition #341

Closed
silentmissile opened this issue May 16, 2023 · 4 comments
Closed

please update typescript definition #341

silentmissile opened this issue May 16, 2023 · 4 comments

Comments

@silentmissile
Copy link

in npm site, "dagre" was renamed to "@dagrejs/dagre"

but "@types/dagre" was not renamed, so when I use @types/dagre, I have to rename node_modules/@types/dagre to node_modules/@types/dagrejs__dagre as a temporary solution.

also, some APIs are missed in @types/dagre

@lorekadam
Copy link

lorekadam commented May 23, 2023

Hi,
My solution for this, without folder renaming, is update your tsconfig like this

"compilerOptions": {
    ...,
    "paths": {
        "@dagrejs/dagre": ["./node_modules/@types/dagre"]
    }
}

@rustedgrail
Copy link
Collaborator

I've added the types file directly to Dagre as an index.d.ts and released the change to NPM. Does that work?

Also, let me know which APIs are missing and I'll update the types.

@ZhengYuTay
Copy link

I've added the types file directly to Dagre as an index.d.ts and released the change to NPM. Does that work?

Also, let me know which APIs are missing and I'll update the types.

you would need to define them in the package.json with "files": ["index.d.ts"] and also have a "typings":"index.d.ts",

@rustedgrail
Copy link
Collaborator

Added the files & types to the package.json

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

No branches or pull requests

4 participants