Type aliases
AnyMediaMessageContent
Any
MediaMessageContent: ({ caption?: string; image: WAMediaUpload; jpegThumbnail?: string } & Mentionable & Buttonable & Templatable & WithDimensions) | ({ caption?: string; gifPlayback?: boolean; jpegThumbnail?: string; video: WAMediaUpload } & Mentionable & Buttonable & Templatable & WithDimensions) | { audio: WAMediaUpload; ptt?: boolean; seconds?: number } | ({ sticker: WAMediaUpload } & WithDimensions) | ({ document: WAMediaUpload; fileName?: string; mimetype: string } & Buttonable & Templatable) & { mimetype?: string }
BaileysEventMap
Type declaration
-
blocklist.set: { blocklist: string[] }
-
blocklist.update: { blocklist: string[]; type: "add" | "remove" }
-
blocklist: string[]
-
type: "add" | "remove"
-
chats.delete: string[]
-
chats.set: { chats: Chat[]; messages: WAMessage[] }
-
chats.update: Partial<Chat>[]
-
chats.upsert: Chat[]
-
-
contacts.update: Partial<Contact>[]
-
contacts.upsert: Contact[]
-
-
group-participants.update: { action: ParticipantAction; id: string; participants: string[] }
-
-
id: string
-
participants: string[]
-
-
-
-
messages.delete: { keys: WAMessageKey[] } | { all: true; jid: string }
-
-
-
presence.update: { id: string; presences: {} }
BinaryNode
Binary
Node: { attrs: {}; content?: BinaryNode[] | string | Uint8Array; tag: string }
Type declaration
-
attrs: {}
-
Optional content?: BinaryNode[] | string | Uint8Array
-
tag: string
Chat
Chat
: Omit<IConversation, "messages"> & { archive
?: boolean; mute
?: number | null; pin
?: number | null }
ChatModification
ChatModification: { archive: boolean } | { pin: boolean } | { mute: number | null } | { clear: "all" | { message: { fromMe?: boolean; id: string } } } | { star: { messages: { fromMe?: boolean; id: string }[]; star: boolean } } | { markRead: boolean } | { delete: true }
ChatMutation
Chat
Mutation: { index: string[]; indexMac: Uint8Array; operation: number; syncAction: ISyncActionData; valueMac: Uint8Array }
Type declaration
-
index: string[]
-
indexMac: Uint8Array
-
operation: number
-
-
valueMac: Uint8Array
ConnectionState
Connection
State: { connection: WAConnectionState; isNewLogin?: boolean; lastDisconnect?: { date: Date; error: Error }; qr?: string; receivedPendingNotifications?: boolean }
Type declaration
-
-
Optional isNewLogin?: boolean
-
Optional lastDisconnect?: { date: Date; error: Error }
-
Optional qr?: string
-
Optional receivedPendingNotifications?: boolean
CurveKeyPair
CurveKeyPair: { private: Uint8Array; public: Uint8Array }
Type declaration
-
private: Uint8Array
-
public: Uint8Array
DownloadableMessage
DownloadableMessage: { directPath?: string; mediaKey?: Uint8Array; url?: string }
Type declaration
-
Optional directPath?: string
-
Optional mediaKey?: Uint8Array
-
Optional url?: string
GroupParticipant
Group
Participant: Contact & { admin?: "admin" | "superadmin" | null; isAdmin?: boolean; isSuperAdmin?: boolean }
JidServer
JidServer: "c.us" | "g.us" | "broadcast" | "s.whatsapp.net" | "call"
JidWithDevice
JidWithDevice: { device?: number; user: string }
Type declaration
-
Optional device?: number
-
user: string
KeyPair
KeyPair: { private: Uint8Array; public: Uint8Array }
Type declaration
-
private: Uint8Array
-
public: Uint8Array
LTHashState
LTHashState: { hash: Buffer; indexValueMap: {}; version: number }
Type declaration
-
hash: Buffer
-
indexValueMap: {}
-
[indexMacBase64: string]: { valueMac: Uint8Array | Buffer }
-
valueMac: Uint8Array | Buffer
-
version: number
MediaConnInfo
MediaConnInfo: { auth: string; fetchDate: Date; hosts: { hostname: string }[]; ttl: number }
Type declaration
-
auth: string
-
fetchDate: Date
-
hosts: { hostname: string }[]
-
ttl: number
MediaGenerationOptions
Media
GenerationOptions: { logger?: Logger; mediaCache?: NodeCache; mediaUploadTimeoutMs?: number; upload: WAMediaUploadFunction }
Type declaration
-
Optional logger?: Logger
-
Optional mediaCache?: NodeCache
-
Optional mediaUploadTimeoutMs?: number
-
MediaType
MediaType: "image" | "video" | "sticker" | "audio" | "document" | "history" | "md-app-state"
MessageContentGenerationOptions
MessageGenerationOptionsFromContent
MessageInfoEventMap
MessageInfoEventMap: {}
MessageRelayOptions
Message
RelayOptions: { additionalAttributes?: {}; cachedGroupMetadata?: (jid: string) => Promise<GroupMetadata | undefined>; messageId?: string; participant?: string }
Type declaration
-
Optional additionalAttributes?: {}
-
Optional cachedGroupMetadata?: (jid: string) => Promise<GroupMetadata | undefined>
-
Optional messageId?: string
-
Optional participant?: string
MessageUpdateType
MessageUpdateType: "append" | "notify" | "prepend"
MiscMessageGenerationOptions
Misc
MessageGenerationOptions: { ephemeralExpiration?: number | string; mediaUploadTimeoutMs?: number; messageId?: string; quoted?: WAMessage; timestamp?: Date }
Type declaration
-
Optional ephemeralExpiration?: number | string
-
Optional mediaUploadTimeoutMs?: number
-
Optional messageId?: string
-
-
Optional timestamp?: Date
ParticipantAction
ParticipantAction: "add" | "remove" | "promote" | "demote"
ProtocolAddress
ProtocolAddress: { deviceId: number; name: string }
Type declaration
-
deviceId: number
-
name: string
ReconnectMode
ReconnectMode: "no-reconnects" | "on-any-error" | "on-connection-error"
SignalCreds
Type declaration
-
Readonly registrationId: number
-
Readonly signedIdentityKey: KeyPair
-
SignalIdentity
Type declaration
-
-
identifierKey: Uint8Array
SignalKeyStore
Signal
KeyStore: { getAppStateSyncKey: (id: string) => Awaitable<IAppStateSyncKeyData>; getAppStateSyncVersion: (name: WAPatchName) => Awaitable<LTHashState>; getPreKey: (keyId: number) => Awaitable<KeyPair>; getSenderKey: (id: string) => Awaitable<any>; getSession: (sessionId: string) => Awaitable<any>; setAppStateSyncKey: (id: string, item: IAppStateSyncKeyData | null) => Awaitable<void>; setAppStateSyncVersion: (id: WAPatchName, item: LTHashState) => Awaitable<void>; setPreKey: (keyId: number, pair: KeyPair | null) => Awaitable<void>; setSenderKey: (id: string, item: any | null) => Awaitable<void>; setSession: (sessionId: string, item: any | null) => Awaitable<void> }
Type declaration
-
getAppStateSyncKey: (id: string) => Awaitable<IAppStateSyncKeyData>
-
getAppStateSyncVersion: (name: WAPatchName) => Awaitable<LTHashState>
-
getPreKey: (keyId: number) => Awaitable<KeyPair>
-
- (keyId: number): Awaitable<KeyPair>
-
Parameters
Returns Awaitable<KeyPair>
-
getSenderKey: (id: string) => Awaitable<any>
-
- (id: string): Awaitable<any>
-
Parameters
Returns Awaitable<any>
-
getSession: (sessionId: string) => Awaitable<any>
-
- (sessionId: string): Awaitable<any>
-
Parameters
Returns Awaitable<any>
-
setAppStateSyncKey: (id: string, item: IAppStateSyncKeyData | null) => Awaitable<void>
-
-
Parameters
Returns Awaitable<void>
-
setAppStateSyncVersion: (id: WAPatchName, item: LTHashState) => Awaitable<void>
-
-
Parameters
Returns Awaitable<void>
-
setPreKey: (keyId: number, pair: KeyPair | null) => Awaitable<void>
-
- (keyId: number, pair: KeyPair | null): Awaitable<void>
-
Parameters
Returns Awaitable<void>
-
setSenderKey: (id: string, item: any | null) => Awaitable<void>
-
- (id: string, item: any | null): Awaitable<void>
-
Parameters
-
id: string
-
item: any | null
Returns Awaitable<void>
-
setSession: (sessionId: string, item: any | null) => Awaitable<void>
-
- (sessionId: string, item: any | null): Awaitable<void>
-
Parameters
-
sessionId: string
-
item: any | null
Returns Awaitable<void>
SignedKeyPair
Signed
KeyPair: { keyId: number; keyPair: KeyPair; signature: Uint8Array }
Type declaration
-
keyId: number
-
-
signature: Uint8Array
SocketConfig
Socket
Config: { agent?: Agent; auth?: AuthenticationState; browser: WABrowserDescription; connectTimeoutMs: number; customUploadHosts: string[]; defaultQueryTimeoutMs: number | undefined; emitOwnEvents: boolean; fetchAgent?: Agent; getMessage: (key: IMessageKey) => Promise<IMessage | undefined>; keepAliveIntervalMs: number; logger: Logger; mediaCache?: NodeCache; msgRetryCounterMap?: {}; printQRInTerminal: boolean; userDevicesCache?: NodeCache; version: WAVersion; waWebSocketUrl: string | URL }
Type declaration
-
Optional agent?: Agent
-
-
-
connectTimeoutMs: number
-
customUploadHosts: string[]
-
defaultQueryTimeoutMs: number | undefined
-
emitOwnEvents: boolean
-
Optional fetchAgent?: Agent
-
getMessage: (key: IMessageKey) => Promise<IMessage | undefined>
-
-
Parameters
Returns Promise<IMessage | undefined>
-
keepAliveIntervalMs: number
-
logger: Logger
-
Optional mediaCache?: NodeCache
-
Optional msgRetryCounterMap?: {}
-
printQRInTerminal: boolean
-
Optional userDevicesCache?: NodeCache
-
-
waWebSocketUrl: string | URL
WABrowserDescription
WABrowserDescription: [string, string, string]
WABusinessProfile
WABusinessProfile: { business_hours: { business_config?: WABusinessHoursConfig[]; config?: WABusinessHoursConfig[]; timezone: string }; categories: { id: string; localized_display_name: string }[]; description: string; email: string; website: string[]; wid?: string }
Type declaration
-
business_hours: { business_config?: WABusinessHoursConfig[]; config?: WABusinessHoursConfig[]; timezone: string }
-
Optional business_config?: WABusinessHoursConfig[]
-
Optional config?: WABusinessHoursConfig[]
-
timezone: string
-
categories: { id: string; localized_display_name: string }[]
-
description: string
-
email: string
-
website: string[]
-
Optional wid?: string
WAConnectionState
WAConnectionState: "open" | "connecting" | "close"
WAInitResponse
WAInitResponse: { ref: string; status: 200; ttl: number }
Type declaration
-
ref: string
-
status: 200
-
ttl: number
WAMediaUpload
WAMediaUpload: Buffer | { url: URL | string } | { stream: Readable }
WAMediaUploadFunction
WAMedia
UploadFunction: (readStream: ReadStream, opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }) => Promise<{ mediaUrl: string }>
Type declaration
-
- (readStream: ReadStream, opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }): Promise<{ mediaUrl: string }>
-
Parameters
-
readStream: ReadStream
-
opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }
-
fileEncSha256B64: string
-
-
Optional timeoutMs?: number
Returns Promise<{ mediaUrl: string }>
WAPatchCreate
Type declaration
-
apiVersion: number
-
index: string[]
-
-
-
WAPatchName
WAPatchName: "critical_block" | "critical_unblock_low" | "regular_low" | "regular_high" | "regular"
WAPresence
WAPresence: "unavailable" | "available" | "composing" | "recording" | "paused"
WASocket
WASocket
: ReturnType<typeof default>
WAVersion
WAVersion: [number, number, number]
Variables
Const Browsers
Browsers: { appropriate: (browser: any) => [string, string, string]; baileys: (browser: any) => [string, string, string]; macOS: (browser: any) => [string, string, string]; ubuntu: (browser: any) => [string, string, string] } = ...
Type declaration
-
appropriate: (browser: any) => [string, string, string]
-
- (browser: any): [string, string, string]
-
Parameters
Returns [string, string, string]
-
baileys: (browser: any) => [string, string, string]
-
- (browser: any): [string, string, string]
-
Parameters
Returns [string, string, string]
-
macOS: (browser: any) => [string, string, string]
-
- (browser: any): [string, string, string]
-
Parameters
Returns [string, string, string]
-
ubuntu: (browser: any) => [string, string, string]
-
- (browser: any): [string, string, string]
-
Parameters
Returns [string, string, string]
Const BufferJSON
BufferJSON: { replacer: (k: any, value: any) => any; reviver: (_: any, value: any) => any } = ...
Type declaration
-
replacer: (k: any, value: any) => any
-
- (k: any, value: any): any
-
reviver: (_: any, value: any) => any
-
- (_: any, value: any): any
Const Curve
Curve
: { generateKeyPair
: () => KeyPair; sharedKey
: (privateKey
: Uint8Array, publicKey
: Uint8Array) => Buffer; sign
: (privateKey
: Uint8Array, buf
: Uint8Array) => Buffer; verify
: (pubKey
: Uint8Array, message
: Uint8Array, signature
: Uint8Array) => boolean } = ...
Type declaration
-
generateKeyPair: () => KeyPair
-
sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer
-
- (privateKey: Uint8Array, publicKey: Uint8Array): Buffer
-
Parameters
-
privateKey: Uint8Array
-
publicKey: Uint8Array
Returns Buffer
-
sign: (privateKey: Uint8Array, buf: Uint8Array) => Buffer
-
- (privateKey: Uint8Array, buf: Uint8Array): Buffer
-
Parameters
-
privateKey: Uint8Array
-
buf: Uint8Array
Returns Buffer
-
verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean
-
- (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean
-
Parameters
-
pubKey: Uint8Array
-
message: Uint8Array
-
signature: Uint8Array
Returns boolean
Const DEFAULT_CONNECTION_CONFIG
Const DEFAULT_ORIGIN
DEFAULT_ORIGIN: "https://web.whatsapp.com" = 'https://web.whatsapp.com'
Const DEF_CALLBACK_PREFIX
DEF_CALLBACK_PREFIX: "CB:" = 'CB:'
Const DEF_TAG_PREFIX
DEF_TAG_PREFIX: "TAG:" = 'TAG:'
Const KEY_BUNDLE_TYPE
KEY_BUNDLE_TYPE: "\u0005" = ''
Const LT_HASH_ANTI_TAMPERING
LT_HASH_ANTI_TAMPERING: d = ...
Const MEDIA_PATH_MAP
MEDIA_
PATH_MAP: {[ T in MediaType]: string } = ...
Const NOISE_MODE
NOISE_MODE: "Noise_XX_25519_AESGCM_SHA256\u0000\u0000\u0000\u0000" = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0'
Const NOISE_WA_HEADER
NOISE_WA_HEADER: Uint8Array = ...
Const OFFICIAL_BIZ_JID
OFFICIAL_BIZ_JID: "16505361212@c.us" = '16505361212@c.us'
Const PHONE_CONNECTION_CB
PHONE_CONNECTION_CB: "CB:Pong" = 'CB:Pong'
Const PSA_WID
PSA_WID: "0@c.us" = '0@c.us'
Const SERVER_JID
SERVER_JID: "server@c.us" = 'server@c.us'
Const STORIES_JID
STORIES_JID: "status@broadcast" = 'status@broadcast'
Const S_WHATSAPP_NET
S_WHATSAPP_NET: "@s.whatsapp.net" = '@s.whatsapp.net'
Const UNAUTHORIZED_CODES
UNAUTHORIZED_CODES: number[] = ...
Const URL_REGEX
URL_REGEX: RegExp = ...
Const WA_DEFAULT_EPHEMERAL
WA_DEFAULT_EPHEMERAL: number = ...
delete chats with given ID