import { EventEmitter } from 'events' import { RequestInit } from 'node-fetch' import * as puppeteer from 'puppeteer' import InterfaceController from './src/util/InterfaceController' declare namespace WAWebJS { export class Client extends EventEmitter { constructor(options: ClientOptions) /** Current connection information */ public info: ClientInfo /** Puppeteer page running WhatsApp Web */ pupPage?: puppeteer.Page /** Puppeteer browser running WhatsApp Web */ pupBrowser?: puppeteer.Browser /** Client interactivity interface */ interface?: InterfaceController /**Accepts an invitation to join a group */ acceptInvite(inviteCode: string): Promise /** Accepts a channel admin invitation and promotes the current user to a channel admin */ acceptChannelAdminInvite(channelId: string): Promise /** Revokes a channel admin invitation sent to a user by a channel owner */ revokeChannelAdminInvite(channelId: string, userId: string): Promise /** Demotes a channel admin to a regular subscriber (can be used also for self-demotion) */ demoteChannelAdmin(channelId: string, userId: string): Promise /** Accepts a private invitation to join a group (v4 invite) */ acceptGroupV4Invite: (inviteV4: InviteV4Data) => Promise<{status: number}> /**Returns an object with information about the invite code's group */ getInviteInfo(inviteCode: string): Promise /** Enables and returns the archive state of the Chat */ archiveChat(chatId: string): Promise /** Pins the Chat and returns its new Pin state */ pinChat(chatId: string): Promise /** Unpins the Chat and returns its new Pin state */ unpinChat(chatId: string): Promise /** Creates a new group */ createGroup(title: string, participants?: string | Contact | Contact[] | string[], options?: CreateGroupOptions): Promise /** Creates a new channel */ createChannel(title: string, options?: CreateChannelOptions): Promise /** Deletes the channel you created */ deleteChannel(channelId: string): Promise; /** Subscribe to channel */ subscribeToChannel(channelId: string): Promise /** Unsubscribe from channel */ unsubscribeFromChannel(channelId: string, options?: UnsubscribeOptions): Promise /** * Searches for channels based on search criteria, there are some notes: * 1. The method finds only channels you are not subscribed to currently * 2. If you have never been subscribed to a found channel * or you have unsubscribed from it with {@link UnsubscribeOptions.deleteLocalModels} set to 'true', * the lastMessage property of a found channel will be 'null' */ searchChannels(searchOptions: SearchChannelsOptions): Promise | []> /** Closes the client */ destroy(): Promise /** Logs out the client, closing the current session */ logout(): Promise /** Get all blocked contacts by host account */ getBlockedContacts(): Promise /** Gets chat or channel instance by ID */ getChatById(chatId: string): Promise /** Gets a {@link Channel} instance by invite code */ getChannelByInviteCode(inviteCode: string): Promise /** Get all current chat instances */ getChats(): Promise /** Gets all cached {@link Channel} instances */ getChannels(): Promise /** Get contact instance by ID */ getContactById(contactId: string): Promise /** Get message by ID */ getMessageById(messageId: string): Promise /** Gets instances of all pinned messages in a chat */ getPinnedMessages(chatId: string): Promise<[Message]|[]> /** Get all current contact instances */ getContacts(): Promise /** Get the country code of a WhatsApp ID. (154185968@c.us) => (1) */ getCountryCode(number: string): Promise /** Get the formatted number of a WhatsApp ID. (12345678901@c.us) => (+1 (234) 5678-901) */ getFormattedNumber(number: string): Promise /** Get all current Labels */ getLabels(): Promise /** Get all current Broadcasts */ getBroadcasts(): Promise /** Get broadcast instance by current user ID */ getBroadcastById(contactId: string): Promise /** Revoke current own status messages */ revokeStatusMessage(messageId: string): Promise /** Change labels in chats */ addOrRemoveLabels(labelIds: Array, chatIds: Array): Promise /** Get Label instance by ID */ getLabelById(labelId: string): Promise