pictoprime
pictoprime copied to clipboard
`.d.ts` declaration files for better type safety and readability
The majority of packages on npm use TypeScript in some form or another, and the ones which don't have 3rd party .d.ts
declaration files written over at Definitely Typed.
I would like to do one of two things;
- Convert the project over to TypeScript
- Write
.d.ts
definition files for the project
In the case of converting to TypeScript, I will pick the most forgiving compilerOptions so that someone with zero knowledge could still come to this project and contribute, esentially the only types necessary will be function parameters and placeholder variables, though type safety could still be improved with further typings such as interfaces and function generics.
The project's build step will compile from a new source directory src
to an output directory dist
, and all pointers in package.json will be modified accordingly.
In the case of writing .d.ts
declaration files, I will be doing the TypeScript compiler's job of extracting type definitions an putting them in .d.ts
files. All functions and file-level variables, exported or not, will be typed, and we'll get a few useful interfaces out of it as well, which could solve some of the JSDoc spaghetti this project is beginning to run into.
Please let me know if you would like this feature implemented and I will begin working on it.