digitalbazaar / vc

W3C Verifiable Credentials implementation in JavaScript
BSD 3-Clause "New" or "Revised" License
182 stars 52 forks source link

Typescript declarations #188

Open spetrac opened 3 months ago

spetrac commented 3 months ago

Because of issue #139 I created a simple solution to generate typescript declarations for the package.

These declarations will help developers to use the module more effectively, because they will get better code intellisence and typescript support if needed.

Declarations will only be generated automatically on packing/publishing and are excluded from git for now. On generation, the previous types folder will be cleared automatically and typescript will generate the new declarations. They can be generated manually of course.

There are minor changes to the package.json as well

Additionally to the declarations, typescript will also generate type-maps to make it easier for IDEs to match the related source code on code navigation.

spetrac commented 1 month ago

If you do not want extra dependencies, then just include manual types. From what I can expect from the maintainers I did not believe that they were willing to manually type their code or switch to typescript all along. Even then, @types/node would still be advised during development of declaration files.

If you need further information about typescript declarations, then read the documentation: