🐣 indefinitely-typedFor TypeScript declarations that are still ...hatching.
What this doesCopies your folders into the dependee's
node_modules/@types/folder. Because that's where the TypeScript compiler might look for it - see TypeScript Module Resolution.
Why you may need itDefinitelyTyped is the repository for high quality TypeScript type definitions. Use this tool if:
- your definitions are "pre-release", lacking tests or incomplete, but you still need to use them in a project.
- you need to maintain versioning not possible with the @types publisher.
- you need to publish on demand, and not wait for the @types publisher.
UsageLet's say that you want to create TypeScript declarations for
- Create an NPM package for your typings, perhaps name it
npm install indefinitely-typed.
- Create a folder named
- Add declaration files in this folder, like
- In the
scripts, add a
postinstallscript like this:
cool-package-typings, they will have a
node_modules/@types/cool-packagefolder, readily usable by their TypeScript project.