AsyncClient
An asynchronous wrapper that represents a promise of a client.
The AsyncClient type is returned when an async plugin is applied to a client.
It behaves like a Promise<Client<TSelf>> but with an additional use method
that allows chaining more plugins before the promise resolves.
This enables fluent chaining of both synchronous and asynchronous plugins without having to await intermediate promises.
Type Declaration
| Name | Type | Description |
|---|---|---|
use() | <TOutput>(plugin) => AsyncClient<TOutput extends Promise<infer U> ? U extends object ? U : never : TOutput> | Applies a plugin to the client once it resolves. |
Type Parameters
| Type Parameter | Description |
|---|---|
TSelf extends object | The shape of the client object that this async client will resolve to. |