0
votes

I have created my Library and published it to npm and works fine. The problem is I can't get the intellisence on my editor(vs code). Putting the declarations files manually on node_modules/@types works perfectly. I want my types to be available for download on npm using npm i @types/mylibrary.

On my search I came accross this https://github.com/DefinitelyTyped/DefinitelyTyped which requires pulling all the available types and sending a PR for the new Type.

Is there any simple way of archiving the same?

1

1 Answers

0
votes

I don't think that's necessary.

Does your current ts.config already produce types?

Just add types to your package.config, for instance like so:

{
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    ...
}

(assuming outDir is /dist/)