santigimeno / node-pcsclite

Bindings over pcsclite to access Smart Cards
ISC License
171 stars 127 forks source link

add type declaration file #82

Closed MaxFichtelmann closed 6 years ago

MaxFichtelmann commented 6 years ago

This adds a typescript declaration file for node-pcsc. This enables better autocompletion in IDEs, especially VS code, even in plain javascript projects.

I am not 100% sure if I have everything right since several properties are defined in c++ code which I am not familiar with.

MaxFichtelmann commented 6 years ago

good point - I will check how this can be corrected

MaxFichtelmann commented 6 years ago

it appears to be fine - TS users will have to include @types/node themselves, but they should have that anyway to write node code with typescript. For plain JS, the unknown Buffer type is translated into any, which is barely noticeable I think.

santigimeno commented 6 years ago

Landed in https://github.com/santigimeno/node-pcsclite/commit/888b5146e9d5b247ca14b7f4afa853aa1500216f. Thanks!