parent
b0baeaa8da
commit
300b367fa0
2 changed files with 12 additions and 0 deletions
3
index.d.ts
vendored
3
index.d.ts
vendored
|
|
@ -28,6 +28,9 @@ declare namespace WAWebJS {
|
||||||
/** Closes the client */
|
/** Closes the client */
|
||||||
destroy(): Promise<void>
|
destroy(): Promise<void>
|
||||||
|
|
||||||
|
/** Logs out the client, closing the current session */
|
||||||
|
logout(): Promise<void>
|
||||||
|
|
||||||
/** Get chat instance by ID */
|
/** Get chat instance by ID */
|
||||||
getChatById(chatId: string): Promise<Chat>
|
getChatById(chatId: string): Promise<Chat>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,15 @@ class Client extends EventEmitter {
|
||||||
await this.pupBrowser.close();
|
await this.pupBrowser.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs out the client, closing the current session
|
||||||
|
*/
|
||||||
|
async logout() {
|
||||||
|
return await this.pupPage.evaluate(() => {
|
||||||
|
return window.Store.AppState.logout();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the version of WhatsApp Web currently being run
|
* Returns the version of WhatsApp Web currently being run
|
||||||
* @returns Promise<string>
|
* @returns Promise<string>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue