-
Notifications
You must be signed in to change notification settings - Fork 34
Description
For consuming the library from a Typescript project authors must either turn of some type checking, right a hacky module declaration in a default d.ts file, or write and place definitions files in project themselves.
By creating this issue I am hoping to start a conversation on what may be the best approach, or level of interest, to making the es-components and enclosed packages typescript friendly.
Many javascript packages are now including definition files with the npm package as this prevents any typescript consumers of the lib from having to do anything. Also, the declaration files provide many benefits to javascript developers within a modern editor like VS Code; such as the benefits gained from writing in-depth JSDoc comments. However, if we include d.ts files in the project then the files would need to be maintained and will create some additional work. Perhaps the work could be done via an additional tool and script.
Another option may be to create and host a separate definitions package that can place the typescript definitions in the traditional node_modules/@types/library-name/ directory. This strategy has it's own drawbacks and seams like it may be more difficult to maintain versioning. Also, hosting may require some thought as installing may be different then just executing npm i -D @types/es-components as when hosted in http://definitelytyped.org/ .
Currently, we are placing created typescript definition files in our project for the theme packages and are writing declaration for the es-components package now. This ensure the Typescript experience is even throughout the code base.