tdl
tdl copied to clipboard
IAsyncTDLibJSON is not used anywhere
Currently, IAsyncTDLibJSON
doesn't seem to be used at all. tdl.Client
wants non-async ITDLibJSON
and never waits for promises returned by e.g. execute(client: null | TDLibClient, query: Object): Promise<Object | null>
.
I am creating an async (RPC) implementation of tdlib and the typings are therefore all wrong.
What do you say if the two interfaces are merged, all functions are converted to be returning AsyncOrSync e.g. AsyncOrSync<Object | null>
and tdl.Client
will always await
the result?
Ah, that would mean that tdl.Client
's couldn't be anymore defined as e..g execute: Execute
...
Yes, the async interface is not used.
I am creating an async (RPC) implementation of tdlib
Initially I wanted to make the wrapper fully async for cases like you describe, but in the end it has never been implemented.
The solution is either always return promises (so that await
is always required) or complicate the typings so that there would be Client<'sync'>
(accepts the sync interface) and Client<'async'>
(accepts the async one) types.