diff --git a/deltachat-jsonrpc/typescript/src/client.ts b/deltachat-jsonrpc/typescript/src/client.ts index 9d7083deb..dd0c6e32b 100644 --- a/deltachat-jsonrpc/typescript/src/client.ts +++ b/deltachat-jsonrpc/typescript/src/client.ts @@ -35,6 +35,10 @@ export class BaseDeltaChat< constructor( public transport: Transport, + /** + * Whether to start calling {@linkcode RawClient.getNextEvent} + * and emitting the respective events on this class. + */ startEventLoop: boolean, ) { super(); @@ -44,6 +48,9 @@ export class BaseDeltaChat< } } + /** + * @see the constructor's `startEventLoop` + */ async eventLoop(): Promise { while (true) { const event = await this.rpc.getNextEvent(); @@ -62,10 +69,17 @@ export class BaseDeltaChat< } } + /** + * @deprecated use {@linkcode BaseDeltaChat.rpc.getAllAccounts} instead. + */ async listAccounts(): Promise { return await this.rpc.getAllAccounts(); } + /** + * A convenience function to listen on events binned by `account_id` + * (see {@linkcode RawClient.getAllAccounts}). + */ getContextEvents(account_id: number) { if (this.contextEmitters[account_id]) { return this.contextEmitters[account_id];