///
import { UserFacingSocketConfig } from '../Models';
declare const makeWASocket: (config: UserFacingSocketConfig) => {
register: (code: string) => Promise;
requestRegistrationCode: (registrationOptions?: import("./client/registration").RegistrationOptions | undefined) => Promise;
getOrderDetails: (orderId: string, tokenBase64: string) => Promise;
getCatalog: ({ jid, limit, cursor }: import("../Models").GetCatalogOptions) => Promise<{
products: import("../Models").Product[];
nextPageCursor: string | undefined;
}>;
getCollections: (jid?: string | undefined, limit?: number) => Promise<{
collections: import("../Models").CatalogCollection[];
}>;
productCreate: (create: import("../Models").ProductCreate) => Promise;
productDelete: (productIds: string[]) => Promise<{
deleted: number;
}>;
productUpdate: (productId: string, update: import("../Models").ProductUpdate) => Promise;
onAck: (listener: (...args: any[]) => void) => void;
onAnyMessage: (listener: (...args: any[]) => void) => void;
onMessageFull: (listener: (...args: any[]) => void) => void;
onReaction: (listener: (...args: any[]) => void) => Promise;
onCall: (listener: (...args: any[]) => void) => Promise;
syncHistory: (listener: (...args: any[]) => void) => Promise;
onPresence: (listener: (...args: any[]) => void) => Promise;
onDelete: (listener: (...args: any[]) => void) => Promise;
onGroups: (listener: (...args: any[]) => void) => Promise;
modifyMessages: (response: any) => Promise<{
type: string;
id: any;
to: any;
fromMe: any;
isgroup: boolean;
content: {};
} | undefined>;
onParticipants: (listener: (...args: any[]) => void) => Promise;
getAllContacts: (opt?: any) => Promise<{
session: any;
device: string | undefined;
status: number;
type: string;
qt: number;
contacts: never[];
}>;
getBlockList: (opt?: any) => Promise<{}>;
getGroups: (opt?: any) => Promise<{}>;
getChats: (opt?: any) => Promise<{
session: any;
device: string | undefined;
status: number;
type: string;
qt: number;
chats: never[];
}>;
setPresence: (id: string, type: string) => Promise<{}>;
setPicture: (id: string, file: string) => Promise<{}>;
editMessage: (id: string, text: string, options: {
content?: string | undefined;
msgId?: string | undefined;
}) => Promise<{}>;
sendCall: (id: string) => Promise<{}>;
setName: (name: string) => Promise<{}>;
setStatus: (status: string) => Promise<{}>;
forwardMessage: (id: string, options: {
content?: string | undefined;
msgId?: string | undefined;
}) => Promise<{}>;
blockContact: (id: string) => Promise<{}>;
unblockContact: (id: string) => Promise<{}>;
archiveChat: (id: string, boolean: boolean) => Promise<{}>;
getPicture: (id: string) => Promise<{}>;
deleteChat: (id: string) => Promise<{}>;
deleteMessageAll: (id: string, options: {
content?: string | undefined;
msgId?: string | undefined;
}) => Promise<{}>;
deleteMessageMe: (id: string, msgId: string) => Promise<{}>;
markReadAll: (id: string) => Promise<{}>;
markRead: (msgId: string) => Promise<{}>;
muteChat: (id: string, timer: "hour" | "week" | "ever") => Promise<{}>;
unmuteChat: (id: string) => Promise<{}>;
pinChat: (id: string, boolean: boolean) => Promise<{}>;
getNumberProfile: (id: string) => Promise<{}>;
getProfileStatus: (id: string) => Promise<{}>;
getHostDevice: (opt?: any) => Promise<{}>;
infoGroup: (id: string) => Promise<{}>;
getConnectionState: (opt?: any) => Promise<{
session: any;
device: string | undefined;
status: number;
type: string;
state: string;
}>;
getName: (id: string) => Promise<{
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
}>;
getLabels: (opt?: any) => Promise<{}>;
getLabelsChats: (opt?: any) => Promise<{}>;
getLabelsMessages: (opt?: any) => Promise<{}>;
addLabelChat: (id: string, labelId: string) => Promise<{}>;
addLabelMessage: (id: string, msgId: string, labelId: string) => Promise<{}>;
removeLabelChat: (id: string, labelId: string) => Promise<{}>;
removeLabelMessage: (id: string, msgId: string, labelId: string) => Promise<{}>;
getPresence: (id: string) => Promise<{}>;
getChatMessages: (id: string, number: number) => Promise<{}>;
getChatAllMessages: (id: string) => Promise<{}>;
getAllUnreadMessages: () => Promise<{
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
}>;
getMessageById: (id: string, idMsg: string) => Promise<{}>;
requestPayment: (id: string) => Promise<{}>;
sendText: (id: string, text: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendButtons: (id: string, title: string, buttons: any, description?: string | undefined, type?: string | undefined, url?: string | undefined, footer?: string | undefined) => Promise<{}>;
sendReaction: (id: string, text: string, options: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
}) => Promise<{}>;
sendImage: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendVideo: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendDocument: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendAudio: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendVoice: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendLocation: (id: string, latitude: number, logitude: number, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendContact: (id: string, name: string, contact: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendSticker: (id: string, file: string, options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendList: (id: string, btnName: string, sections: {
title: string;
rows: {
title: string;
description: string;
rowId: string;
}[];
}[], options?: {
content?: string | undefined;
caption?: string | undefined;
mimetype?: string | undefined;
viewOnce?: boolean | undefined;
reply?: string | undefined;
ptv?: boolean | undefined;
filename?: string | undefined;
address?: string | undefined;
titleBtn?: string | undefined;
description?: string | undefined;
footerBtn?: string | undefined;
msgId?: string | undefined;
} | undefined) => Promise<{}>;
sendPoll: (id: string, title: string, options: any) => Promise<{}>;
sendTextStatus: (text: string, font: number, color: string) => Promise<{
session: any;
id: any;
device: string | undefined;
status: number;
type: string;
message?: undefined;
} | {
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
id?: undefined;
}>;
sendImageStatus: (file: string, text?: string | undefined) => Promise<{
session: any;
id: any;
device: string | undefined;
status: number;
type: string;
message?: undefined;
} | {
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
id?: undefined;
}>;
sendVideoStatus: (file: string, text?: string | undefined) => Promise<{
session: any;
id: any;
device: string | undefined;
status: number;
type: string;
message?: undefined;
} | {
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
id?: undefined;
}>;
deleteStatus: (msgId: string) => Promise<{
session: any;
id: any;
device: string | undefined;
status: number;
type: string;
message?: undefined;
} | {
session: any;
device: string | undefined;
status: number;
type: string;
message: string;
id?: undefined;
}>;
messageTemporary: (id: string, time: "0" | "7" | "90") => Promise<{}>;
sendCarouselMessage: (id: string, outerText: string | undefined, cards: {
headerImage?: string | undefined;
title?: string | undefined;
body: string;
footer?: string | undefined;
buttons: {
name: string;
buttonParamsJson: string | object;
}[];
}[]) => Promise<{}>;
sendMessageAck: ({ tag, attrs, content }: import("../Internal").BinaryNode) => Promise;
sendRetryRequest: (node: import("../Internal").BinaryNode, forceIncludeKeys?: boolean) => Promise;
rejectCall: (callId: string, callFrom: string) => Promise;
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
id: string;
to: string;
}>;
terminateCall: (callId: string, toJid: string) => Promise;
getPrivacyTokens: (jids: string[]) => Promise;
assertSessions: (jids: string[], force: boolean) => Promise;
relayMessage: (jid: string, message: import("./enc").proto.IMessage, { messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Models").MessageRelayOptions) => Promise;
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Models").MessageReceiptType) => Promise;
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise;
createParticipantNodes: (jids: string[], message: import("./enc").proto.IMessage, extraAttrs?: {
[key: string]: string;
} | undefined) => Promise<{
nodes: import("../Internal").BinaryNode[];
shouldIncludeDeviceIdentity: boolean;
}>;
sendReceipts: (keys: import("../Models").WAMessageKey[], type: import("../Models").MessageReceiptType) => Promise;
readMessages: (keys: import("../Models").WAMessageKey[]) => Promise;
refreshMediaConn: (forceGet?: boolean) => Promise;
waUploadToServer: import("../Models").WAMediaUploadFunction;
fetchPrivacySettings: (force?: boolean) => Promise<{
[_: string]: string;
}>;
updateMediaMessage: (message: import("./enc").proto.IWebMessageInfo) => Promise;
sendMessage: (jid: string, content: import("../Models").AnyMessageContent, options?: import("../Models").MiscMessageGenerationOptions) => Promise;
subscribeNewsletterUpdates: (jid: string) => Promise<{
duration: string;
}>;
newsletterReactionMode: (jid: string, mode: import("../Models").NewsletterReactionMode) => Promise;
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise;
newsletterUpdateName: (jid: string, name: string) => Promise;
newsletterUpdatePicture: (jid: string, content: import("../Models").WAMediaUpload) => Promise;
newsletterRemovePicture: (jid: string) => Promise;
newsletterUnfollow: (jid: string) => Promise;
newsletterFollow: (jid: string) => Promise;
newsletterUnmute: (jid: string) => Promise;
newsletterMute: (jid: string) => Promise;
newsletterCreate: (name: string, description: string) => Promise;
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Models").NewsletterViewRole | undefined) => Promise;
newsletterAdminCount: (jid: string) => Promise;
newsletterChangeOwner: (jid: string, user: string) => Promise;
newsletterDemote: (jid: string, user: string) => Promise;
newsletterDelete: (jid: string) => Promise;
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise;
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise;
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise;
groupMetadata: (jid: string) => Promise;
groupCreate: (subject: string, participants: string[]) => Promise;
communityCreate: (subject: string) => Promise;
groupLeave: (id: string) => Promise;
groupUpdateSubject: (jid: string, subject: string) => Promise;
groupRequestParticipantsList: (jid: string) => Promise<{
[key: string]: string;
}[]>;
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
status: string;
jid: string;
}[]>;
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Models").ParticipantAction) => Promise<{
status: string;
jid: string;
content: import("../Internal").BinaryNode;
}[]>;
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise;
groupInviteCode: (jid: string) => Promise;
groupRevokeInvite: (jid: string) => Promise;
groupAcceptInvite: (code: string) => Promise;
groupAcceptInviteV4: (key: string | import("../Models").WAMessageKey, inviteMessage: import("./enc").proto.Message.IGroupInviteMessage) => Promise;
groupGetInviteInfo: (code: string) => Promise;
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise;
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise;
groupFetchAllParticipating: () => Promise<{
[_: string]: import("../Models").GroupMetadata;
}>;
processingMutex: {
mutex(code: () => T | Promise): Promise;
};
upsertMessage: (msg: import("./enc").proto.IWebMessageInfo, type: import("../Models").MessageUpsertType) => Promise;
appPatch: (patchCreate: import("../Models").WAPatchCreate) => Promise;
sendPresenceUpdate: (type: import("../Models").WAPresence, toJid?: string | undefined) => Promise;
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise;
profilePictureUrl: (jid: any, type?: string, timeoutMs?: number | undefined) => Promise;
onWhatsApp: (...jids: string[]) => Promise<{
exists: boolean;
jid: string;
}[]>;
fetchBlocklist: () => Promise;
fetchStatus: (jid: string) => Promise<{
status: string | undefined;
setAt: Date;
} | undefined>;
updateProfilePicture: (jid: string, content: import("../Models").WAMediaUpload) => Promise;
removeProfilePicture: (jid: string) => Promise;
updateProfileStatus: (status: string) => Promise;
updateProfileName: (name: string) => Promise;
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise;
updateLastSeenPrivacy: (value: import("../Models").WAPrivacyValue) => Promise;
updateOnlinePrivacy: (value: import("../Models").WAPrivacyOnlineValue) => Promise;
updateProfilePicturePrivacy: (value: import("../Models").WAPrivacyValue) => Promise;
updateStatusPrivacy: (value: import("../Models").WAPrivacyValue) => Promise;
updateReadReceiptsPrivacy: (value: import("../Models").WAReadReceiptsValue) => Promise;
updateGroupsAddPrivacy: (value: import("../Models").WAPrivacyValue) => Promise;
updateDefaultDisappearingMode: (duration: number) => Promise;
getBusinessProfile: (jid: string) => Promise;
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise;
chatModify: (mod: import("../Models").ChatModification, jid: string) => Promise;
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise;
addChatLabel: (jid: string, labelId: string) => Promise;
removeChatLabel: (jid: string, labelId: string) => Promise;
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise;
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise;
logout: (msg?: string | undefined) => Promise;
end: (error: Error | undefined, qr?: boolean) => void;
onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
uploadPreKeys: (count?: number) => Promise;
uploadPreKeysToServerIfRequired: () => Promise;
requestPairingCode: (phoneNumber: string) => Promise;
waitForConnectionUpdate: (check: (u: Partial) => boolean | undefined, timeoutMs?: number | undefined) => Promise;
addInfoObjects: (name: any, extend: any) => boolean;
getUser: (name: any) => any;
checkAddUser: (name: any) => boolean;
checkUser: (name: any) => boolean;
sessionsDir: (sessionId?: string | undefined, dir?: string) => string;
checkSession: (name: any) => boolean;
getSessionKey: (name: any) => string | false;
searchObjects: (phone: any) => any;
getAll: () => any;
checkClient: (name: any) => boolean;
deleteToken: (name: any) => boolean;
deleteSession: (name: any) => boolean;
removeInfoObjects: (name: any, key: any) => boolean;
type: "md";
ws: any;
ev: import("../Models").OrkestralEventEmitter & {
process(handler: (events: Partial) => void | Promise): () => void;
buffer(): void;
createBufferedFunction(work: (...args: A) => Promise): (...args: A) => Promise;
flush(force?: boolean | undefined): boolean;
isBuffering(): boolean;
};
authState: {
creds: import("../Models").AuthenticationCreds;
keys: import("../Models").SignalKeyStoreWithTransaction;
};
signalRepository: import("../Models").SignalRepository;
user: import("../Models").Contact | undefined;
generateMessageTag: () => string;
query: (node: import("../Internal").BinaryNode, timeoutMs?: number | undefined) => Promise;
waitForMessage: (msgId: string, timeoutMs?: number | undefined) => Promise;
waitForSocketOpen: () => Promise;
sendRawMessage: (data: Uint8Array | Buffer) => Promise;
sendNode: (frame: import("../Internal").BinaryNode) => Promise;
close: () => void;
createGroup: (name: string, participants: any) => Promise<{}>;
addParticipantsGroup: (id: string, participants: any) => Promise<{}>;
createCommunity: (name: string) => Promise<{}>;
approveParticipantsGroup: (id: string, participants: any, action: "reject" | "approve") => Promise<{}>;
removeParticipantsGroup: (id: string, participants: any) => Promise<{}>;
getParticipantsPending: (id: string) => Promise<{}>;
addGroupAdmins: (id: string, participants: any) => Promise<{}>;
removeGroupAdmins: (id: string, participants: any) => Promise<{}>;
groupTitle: (id: string, title: string) => Promise<{}>;
groupDescription: (id: string, description: string) => Promise<{}>;
leaveGroup: (id: string) => Promise<{}>;
getGroupLink: (id: string) => Promise<{}>;
joinGroup: (code: string) => Promise<{}>;
setGroupSettings: (id: string, option: "message" | "settings", boolean: boolean) => Promise<{}>;
revokeGroupLink: (id: string) => Promise<{}>;
removeNewsPicture: (id: string) => Promise<{}>;
createNews: (name: string, description: string) => Promise<{}>;
newsTitle: (id: string, title: string) => Promise<{}>;
newsDescription: (id: string, description: string) => Promise<{}>;
setNewsPicture: (id: string, file: string) => Promise<{}>;
};
export default makeWASocket;