td_client library

Classes

TdNativePlugin
Placeholder used where dart:ffi isn't available (the web).
TdPlugin
Low-level access to TDLib's JSON interface on the current platform.

Functions

tdCreate() → int
Returns the identifier of a new TDLib client (0 means none). The client sends no updates until the first request is sent to it.
tdExecute(TdFunction<TdObject> event) → TdObject?
Executes event synchronously; only requests documented as "Can be called synchronously" (TdFunction.canBeCalledSynchronously).
tdJsonClientCreate() → int
Creates a new instance of TDLib and returns its handle.
tdJsonClientDestroy(int clientId) → void
Destroys the TDLib instance clientId. It must not be used afterwards.
tdJsonClientExecute(TdFunction<TdObject> event) → TdObject?
Executes event synchronously (only requests documented as such).
tdJsonClientReceive(int clientId, [double timeout = 8]) → TdObject?
Receives the next update or response of the TDLib instance clientId, waiting up to timeout seconds. Must not run on two threads at once.
tdJsonClientSend(int clientId, TdFunction<TdObject> event, [dynamic extra]) → void
Sends event to the TDLib instance clientId, tagged with extra if given. May be called from any thread.
tdReceive([double timeout = 8]) → TdObject?
Receives the next update or response, waiting up to timeout seconds. Blocks the calling isolate: don't call it on Flutter's UI isolate.
tdSend(int clientId, TdFunction<TdObject> event, [dynamic extra]) → void
Sends event to client clientId, tagged with extra if given.