capnproto / node-capnp

Cap'n Proto bindings for Node.js
BSD 2-Clause "Simplified" License
258 stars 35 forks source link

Add a very minimal typescript declaration file. #61

Closed zenhack closed 4 years ago

zenhack commented 4 years ago

Background: I'm working on a compiler plugin to generate tyepscript declaration files to work with node-capnp:

https://github.com/zenhack/capnpc-node-typescript

This PR adds the beginnings of declaration file for the library itself. It is enough that the compiler plugin itself type checks, but obviously is missing most of the API.

From looking at capnp.js, I see that parse takes an extra optional options argument, but this isn't mentioned in the docs anywhere so I left it out of the interface for now.

zenhack commented 4 years ago

I'm going to close this for now; the Schema type is likely going to need to change to support other library functionality. I may re-open this once it's a bit more mature.