diff --git a/src/api/layers/ui.layer.ts b/src/api/layers/ui.layer.ts index a205a84d0..48110ef63 100644 --- a/src/api/layers/ui.layer.ts +++ b/src/api/layers/ui.layer.ts @@ -18,6 +18,7 @@ import { Page } from 'puppeteer'; import { CreateConfig } from '../../config/create-config'; import { evaluateAndReturn } from '../helpers'; +import { Wid, Chat } from '../model'; import { GroupLayer } from './group.layer'; export class UILayer extends GroupLayer { @@ -31,7 +32,7 @@ export class UILayer extends GroupLayer { * @category UI * @param chatId */ - public async openChat(chatId: string) { + public async openChat(chatId: string | Wid) { return evaluateAndReturn( this.page, (chatId: string) => WPP.chat.openChatBottom(chatId), @@ -45,7 +46,7 @@ export class UILayer extends GroupLayer { * @param chatId Chat id * @param messageId Message id (For example: '06D3AB3D0EEB9D077A3F9A3EFF4DD030') */ - public async openChatAt(chatId: string, messageId: string) { + public async openChatAt(chatId: string | Wid, messageId: string) { return evaluateAndReturn( this.page, (chatId: string, messageId) => WPP.chat.openChatAt(chatId, messageId), @@ -67,7 +68,7 @@ export class UILayer extends GroupLayer { * Return the currently active chat (visually open) * @category UI */ - public getActiveChat() { + public getActiveChat(): Chat { return evaluateAndReturn(this.page, () => WPP.chat.getActiveChat()); } }