0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
707 stars 167 forks source link

Where is the love for typescript? #101

Open P0oOOOo0YA opened 5 years ago

P0oOOOo0YA commented 5 years ago

Loved the project but sadly there is no type definition file available.

bombela commented 5 years ago

Pull requests are welcomed :)

On Sat, Dec 22, 2018, 08:01 P0oOOOo0YA <notifications@github.com wrote:

Loved the project but sadly there is no type definition file available.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/0rpc/zerorpc-node/issues/101, or mute the thread https://github.com/notifications/unsubscribe-auth/AANMjKSXV_8_JjUTc_BBY-MAAFUA6jfgks5u7ldngaJpZM4ZfhYa .

harrismirza commented 5 years ago

I took a look at making a TS Definition file but can't understand the format of the invoke method, it looks highly irregular and therefore it might not be possible to create TS definitions.

bombela commented 5 years ago

It is my understanding that typescript is a superset of JavaScript. It should technically be possible to typecheck the existing invoke function.

And what about adding new functions that are more ergonomic for typescript? Would that resolve your issue?

On Mon, Oct 28, 2019, 16:21 Harris Mirza notifications@github.com wrote:

I took a look at making a TS Definition file but can't understand the format of the invoke method, it looks highly irregular and therefore it might not be possible to create TS definitions.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/0rpc/zerorpc-node/issues/101?email_source=notifications&email_token=AABUZDFFYKOBZAD7AJEXPJ3QQ5XW3A5CNFSM4GL6CYNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECOWZ2A#issuecomment-547187944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUZDE3MC2V4GKGSPD6YLDQQ5XW3ANCNFSM4GL6CYNA .

harrismirza commented 5 years ago

The main issue I could see without looking in too much detail was that the args parameter in Invoke isn't at the end which is a requirement for 'rest parameters'.

If changing the API isn't out of the question, I think it would make more sense to have that at the end anyway and move the callback to before the arguments.