zulip-js
zulip-js copied to clipboard
Typescript bindings
I'm offering to write either typescript bindings for this project or convert it to use typescript. Both options would retain all the Javascript apis as-is. Would you consider either if provided as a PR?
Yes definitely appreciated as a PR!
-Tim Abbott (mobile)
On Fri, Sep 13, 2019, 4:31 PM Jonas Berlin [email protected] wrote:
I'm offering to write either typescript bindings for this project or convert it to use typescript. Both options would retain all the Javascript apis as-is. Would you consider either if provided as a PR?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zulip/zulip-js/issues/74?email_source=notifications&email_token=AAU6NWXCI7MQO472PITQYQ3QJQPEHA5CNFSM4IWVDQQKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLLAOCQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAU6NWVDYQF4WYR62MGROKDQJQPEHANCNFSM4IWVDQQA .
@timabbott which way, convert source to Typescript or keep typings as separate file?
We should convert the source to typescript and in the publishing process, create a index.d.ts
file to provide type declarations for our compiled js module.
I think a good way would be to simply add tsc in our build process without making changes and then convert our js files one by one to ts.
Ok, I will try! :smiley:
Thanks @xkr47! I'm not well versed in TS yet but I'm happy to review any PRs and test changes.
I've been taking a look at making the TypeScript definitions for the project and just noticed this issue was opened awhile back. Seems like it's still open to be worked on and thought I'd ask about interest again.
Would you be interested in just type definitions or would you want to convert the project over to TypeScript entirely? I can provide a PR of the current work done in this regard, which has been just the TypeScript definitions themselves, following the structure of the project pretty closely to allow a faster conversion to TypeScript completely if you were interested.
Most of the work has been done based on the documentation on the Zulip site, but it also covers all of the functions and variables exported from the package as well, at an individual file level. I'll open a PR marked as WIP that shows where it is at now with just the type definitions.