If using npm v7 you need to add the -legacy-peer-deps flag to the command. Once you've tested your package, you can share it on Definitely Typed.įirst, fork this repository, clone it, install node, and run npm install. ![]() Then follow the instructions to edit an existing package orĬreate a new package. Once you've tested your definitions with real code, make a PR Then build and run the code to make sure your type definition actually corresponds to what happens at runtime. You should now be able to import from "foo" in your code and it will route to the new type definition. How can I contribute?ĭefinitely Typed only works because of contributions by users like you! Testingīefore you share your improvement with the world, use the types yourself by creating a typename.d.ts file in your project and filling out its exports:Ĭreate types/foo/index.d.ts containing declarations for the module "foo".
0 Comments
Leave a Reply. |