Closed G-Rath closed 5 years ago
Add this file as well on the lib and types properties on package.json
@PlayMa256 This shouldn't be set for the types property on package.json
, as that should point to the same thing as main
i.e index.d.ts
.
That's used for the importing of the package, i.e import x from 'webpack-nano'
.
Otherwises, cheers for reminding me about the lib
!
@PlayMa256 This shouldn't be set for the type property on
package.json
, as that should point to the same thing asmain
i.eindex.d.ts
.That's used for the importing of the package, i.e
import x from 'webpack-nano'
.Otherwises, cheers for reminding me about the
lib
!
Oh really? So tscompiler will also find that file as well? I thought it would need to be added into types as well! Thank you for explaining me this!!! \o/
So tscompiler will also find that file as well?
Yeah, it looks based on the file name. Technically you don't need it if it's called index.d.ts
either:
Also note that if your main declaration file is named index.d.ts and lives at the root of the package (next to index.js) you do not need to mark the "types" property, though it is advisable to do so.
But it's good practice :)
I've tested these typings by literally dropping them into the package in node_modules
😄
This PR contains:
Breaking Changes?
If yes, please describe the breakage.
Please Describe Your Changes
Adds typings for
argv.js
so that it can be imported in TypeScript.Closes #14