import { Page } from 'puppeteer'; import { Chat, LiveLocationChangedEvent, ChatState } from './model/chat'; import { Contact } from './model/contact'; import { Message } from './model/message'; import { Id } from './model/id'; import { ParticipantChangedEventModel } from './model/group-metadata'; export declare const getBase64: (url: string) => Promise; export declare class Whatsapp { page: Page; constructor(page: Page); onMessage(fn: (message: Message) => void): void; onAnyMessage(fn: (message: Message) => void): Promise; onBattery(fn: (battery: number) => void): Promise; onStateChanged(fn: (state: string) => void): void; onIncomingCall(fn: (call: any) => void): void; setPresence(available: boolean): Promise; setMyStatus(newStatus: string): Promise; addLabel(label: string, id: string): Promise; removeLabel(label: string, id: string): Promise; sendVCard(chatId: string, vcard: string, contactName: string): Promise; setMyName(newName: string): Promise; setChatState(chatState: ChatState, chatId: String): Promise; getConnectionState(): Promise; onAck(fn: (message: Message) => void): void; kill(): Promise; forceRefocus(): Promise; onLiveLocation(chatId: string, fn: (liveLocationChangedEvent: LiveLocationChangedEvent) => void): Promise; onParticipantsChanged(groupId: string, fn: (participantChangedEvent: ParticipantChangedEventModel) => void): Promise; onAddedToGroup(fn: (chat: Chat) => any): Promise; sendText(to: string, content: string): Promise; sendTextWithMentions(to: string, content: string): Promise; sendMessageWithThumb(thumb: string, url: string, title: string, description: string, chatId: string): Promise; sendLocation(to: string, lat: any, lng: any, loc: string): Promise; getGeneratedUserAgent(userA?: string): Promise; sendImage(to: string, base64: string, filename: string, caption: string): Promise; reply(to: string, content: string, quotedMsg: any): Promise; sendFile(to: string, base64: string, filename: string, caption: string): Promise; sendVideoAsGif(to: string, base64: string, filename: string, caption: string): Promise; sendGiphy(to: string, giphyMediaUrl: string, caption: string): Promise; getMe(): Promise; getBusinessProfilesProducts(id: string): Promise; sendImageWithProduct(to: string, base64: string, caption: string, bizNumber: string, productId: string): Promise; sendContact(to: string, contactId: string | string[]): Promise; simulateTyping(to: string, on: boolean): Promise; forwardMessages(to: string, messages: any, skipMyMessages: boolean): Promise; getAllContacts(): Promise; getWAVersion(): Promise; isConnected(): Promise; getBatteryLevel(): Promise; getAllChats(withNewMessageOnly?: boolean): Promise; getAllChatsWithMessages(withNewMessageOnly?: boolean): Promise; getAllGroups(withNewMessagesOnly?: boolean): Promise; getGroupMembersId(groupId: string): Promise; contactBlock(id: string): Promise; contactUnblock(id: string): Promise; leaveGroup(groupId: string): Promise; getGroupMembers(groupId: string): Promise; getContact(contactId: string): Promise; getChatById(contactId: string): Promise; getChat(contactId: string): Promise; getProfilePicFromServer(chatId: string): Promise; sendSeen(chatId: string): Promise; isChatOnline(chatId: string): Promise; loadEarlierMessages(contactId: string): Promise; getStatus(contactId: string): Promise; asyncLoadAllEarlierMessages(contactId: string): Promise; loadAllEarlierMessages(contactId: string): Promise; deleteChat(chatId: string): Promise; clearChat(chatId: string): Promise; getGroupInviteLink(chatId: string): Promise; revokeGroupInviteLink(chatId: string): Promise; deleteMessage(contactId: string, messageId: string[] | string, onlyLocal?: boolean): Promise; checkNumberStatus(contactId: string): Promise; getUnreadMessages(includeMe: boolean, includeNotifications: boolean, use_unread_count: boolean): Promise; getAllNewMessages(): Promise; getAllUnreadMessages(): Promise; getAllMessagesInChat(chatId: string, includeMe: boolean, includeNotifications: boolean): Promise<[Message]>; loadAndGetAllMessagesInChat(chatId: string, includeMe: boolean, includeNotifications: boolean): Promise<[Message]>; createGroup(groupName: string, contacts: string | string[]): Promise; removeParticipant(idGroup: string, idParticipant: string): Promise; addParticipant(idGroup: string, idParticipant: string): Promise; promoteParticipant(idGroup: string, idParticipant: string): Promise; demoteParticipant(idGroup: string, idParticipant: string): Promise; getGroupAdmins(idGroup: string): Promise; sendImageAsSticker(b64: string, to: string): Promise; } export { useragent } from '../config/puppeteer.config';