mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
3
index.d.ts
vendored
3
index.d.ts
vendored
@@ -28,6 +28,9 @@ declare namespace WAWebJS {
|
||||
/** Closes the client */
|
||||
destroy(): Promise<void>
|
||||
|
||||
/** Logs out the client, closing the current session */
|
||||
logout(): Promise<void>
|
||||
|
||||
/** Get chat instance by ID */
|
||||
getChatById(chatId: string): Promise<Chat>
|
||||
|
||||
|
||||
@@ -359,6 +359,15 @@ class Client extends EventEmitter {
|
||||
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 Promise<string>
|
||||
|
||||
Reference in New Issue
Block a user