Hi,
Quick question;
When creating a TypeScript module to be exported to NPM, how would one properly also deliver the types if there's no main/index file?
My lib-directory looks like this:
lib
├── FileSystemInterface.d.ts
├── FileSystemInterface.js
├── FileSystemInterface.js.map
└── file
├── FileSystemFile.d.ts
├── FileSystemFile.js
├── FileSystemFile.js.map
└── content
├── BufferFileContent.d.ts
├── BufferFileContent.js
├── BufferFileContent.js.map
├── FileContentInterface.d.ts
├── FileContentInterface.js
├── FileContentInterface.js.map
├── StringFileContent.d.ts
├── StringFileContent.js
├── StringFileContent.js.map
├── Uint8ArrayFileContent.d.ts
├── Uint8ArrayFileContent.js
└── Uint8ArrayFileContent.js.map
How to configure my package.json and/or tsconfig.json to properly also publish the defined type-files?
Documentation says this about it: If your package has a main.js file, you will need to indicate the main declaration file in your package.json file as well. Set the types property to point to your bundled declaration file. For example:
In my case, I don't have a entrypoint like that. So I don't need to declare it and everything should work properly?
Thanks for help!
How to get your d.ts files to users