Options
All
  • Public
  • Public/Protected
  • All
Menu

@adiwajshing/baileys-md

Index

References

Namespaces

Enumerations

Interfaces

Type aliases

Variables

Functions

References

WAMessageStatus

Renames and exports WebMessageInfoStatus

WAMessageStubType

Renames and exports WebMessageInfoStubType

WAProto

Renames and exports proto

Type aliases

AnyMediaMessageContent

AnyMediaMessageContent: ({ 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 }

AnyMessageContent

AnyMessageContent: AnyRegularMessageContent | { force?: boolean; forward: WAMessage } | { delete: WAMessageKey } | { disappearingMessagesInChat: boolean | number }

AnyRegularMessageContent

AnyRegularMessageContent: ({ text: string } & Mentionable & Buttonable & Templatable) | AnyMediaMessageContent | { contacts: { contacts: IContactMessage[]; displayName?: string } } | { location: WALocationMessage } & ViewOnce

AuthenticationCreds

AuthenticationCreds: SignalCreds & { account?: IADVSignedDeviceIdentity; advSecretKey: string; firstUnuploadedPreKeyId: number; lastAccountSyncTimestamp?: number; me?: Contact; myAppStateKeyId?: string; nextPreKeyId: number; noiseKey: KeyPair; serverHasPreKeys: boolean; signalIdentities?: SignalIdentity[] }

AuthenticationState

AuthenticationState: { creds: AuthenticationCreds; keys: SignalKeyStore }

Type declaration

BaileysEventMap

BaileysEventMap: { blocklist.set: { blocklist: string[] }; blocklist.update: { blocklist: string[]; type: "add" | "remove" }; chats.delete: string[]; chats.set: { chats: Chat[]; messages: WAMessage[] }; chats.update: Partial<Chat>[]; chats.upsert: Chat[]; connection.update: Partial<ConnectionState>; contacts.update: Partial<Contact>[]; contacts.upsert: Contact[]; creds.update: Partial<AuthenticationCreds>; group-participants.update: { action: ParticipantAction; id: string; participants: string[] }; groups.update: Partial<GroupMetadata>[]; groups.upsert: GroupMetadata[]; message-info.update: MessageInfoUpdate[]; messages.delete: { keys: WAMessageKey[] } | { all: true; jid: string }; messages.update: WAMessageUpdate[]; messages.upsert: { messages: WAMessage[]; type: MessageUpdateType }; presence.update: { id: string; presences: {} } }

Type declaration

  • blocklist.set: { blocklist: string[] }
    • blocklist: string[]
  • blocklist.update: { blocklist: string[]; type: "add" | "remove" }
    • blocklist: string[]
    • type: "add" | "remove"
  • chats.delete: string[]

    delete chats with given ID

  • chats.set: { chats: Chat[]; messages: WAMessage[] }

    set chats (history sync), messages are reverse chronologically sorted

  • chats.update: Partial<Chat>[]

    update the given chats

  • chats.upsert: Chat[]

    upsert chats

  • connection.update: Partial<ConnectionState>

    connection state has been updated -- WS closed, opened, connecting etc.

  • contacts.update: Partial<Contact>[]
  • contacts.upsert: Contact[]
  • creds.update: Partial<AuthenticationCreds>

    credentials updated -- some metadata, keys or something

  • group-participants.update: { action: ParticipantAction; id: string; participants: string[] }

    apply an action to participants in a group

  • groups.update: Partial<GroupMetadata>[]
  • groups.upsert: GroupMetadata[]
  • message-info.update: MessageInfoUpdate[]
  • messages.delete: { keys: WAMessageKey[] } | { all: true; jid: string }
  • messages.update: WAMessageUpdate[]
  • messages.upsert: { messages: WAMessage[]; type: MessageUpdateType }

    add/update the given messages. If they were received while the connection was online, the update will have type: "notify"

  • presence.update: { id: string; presences: {} }

    presence of contact in a chat updated

    • id: string
    • presences: {}

BinaryNode

BinaryNode: { attrs: {}; content?: BinaryNode[] | string | Uint8Array; tag: string }

the binary node WA uses internally for communication

this is manipulated soley as an object and it does not have any functions. This is done for easy serialization, to prevent running into issues with prototypes & to maintain functional code structure

Type declaration

  • attrs: {}
    • [key: string]: string
  • Optional content?: BinaryNode[] | string | Uint8Array
  • tag: string

BinaryNodeAttributes

BinaryNodeAttributes: BinaryNode["attrs"]

BinaryNodeData

BinaryNodeData: BinaryNode["content"]

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

ChatMutation: { index: string[]; indexMac: Uint8Array; operation: number; syncAction: ISyncActionData; valueMac: Uint8Array }

Type declaration

  • index: string[]
  • indexMac: Uint8Array
  • operation: number
  • syncAction: ISyncActionData
  • valueMac: Uint8Array

ConnectionState

ConnectionState: { connection: WAConnectionState; isNewLogin?: boolean; lastDisconnect?: { date: Date; error: Error }; qr?: string; receivedPendingNotifications?: boolean }

Type declaration

  • connection: WAConnectionState

    connection is now open, connecting or closed

  • Optional isNewLogin?: boolean

    is this a new login

  • Optional lastDisconnect?: { date: Date; error: Error }

    the error that caused the connection to close

    • date: Date
    • error: Error
  • Optional qr?: string

    the current QR code

  • Optional receivedPendingNotifications?: boolean

    has the device received all pending notifications while it was offline

CurveKeyPair

CurveKeyPair: { private: Uint8Array; public: Uint8Array }

Type declaration

  • private: Uint8Array
  • public: Uint8Array

DebouncedTimeout

DebouncedTimeout: ReturnType<typeof debouncedTimeout>

DownloadableMessage

DownloadableMessage: { directPath?: string; mediaKey?: Uint8Array; url?: string }

Type declaration

  • Optional directPath?: string
  • Optional mediaKey?: Uint8Array
  • Optional url?: string

GroupParticipant

GroupParticipant: 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

MediaGenerationOptions: { logger?: Logger; mediaCache?: NodeCache; mediaUploadTimeoutMs?: number; upload: WAMediaUploadFunction }

Type declaration

  • Optional logger?: Logger
  • Optional mediaCache?: NodeCache

    cache media so it does not have to be uploaded again

  • Optional mediaUploadTimeoutMs?: number
  • upload: WAMediaUploadFunction

MediaType

MediaType: "image" | "video" | "sticker" | "audio" | "document" | "history" | "md-app-state"

MessageContentGenerationOptions

MessageContentGenerationOptions: MediaGenerationOptions & { getUrlInfo?: (text: string) => Promise<WAUrlInfo> }

MessageGenerationOptions

MessageGenerationOptionsFromContent

MessageGenerationOptionsFromContent: MiscMessageGenerationOptions & { userJid: string }

MessageInfoEventMap

MessageInfoEventMap: {}

Type declaration

  • [jid: string]: Date

MessageInfoUpdate

MessageInfoUpdate: { key: IMessageKey; update: Partial<MessageInfo> }

Type declaration

MessageRelayOptions

MessageRelayOptions: { additionalAttributes?: {}; cachedGroupMetadata?: (jid: string) => Promise<GroupMetadata | undefined>; messageId?: string; participant?: string }

Type declaration

  • Optional additionalAttributes?: {}
    • [_: string]: string
  • Optional cachedGroupMetadata?: (jid: string) => Promise<GroupMetadata | undefined>
  • Optional messageId?: string
  • Optional participant?: string

    only send to a specific participant

MessageType

MessageType: keyof Message

Set of message types that are supported by the library

MessageUpdateType

MessageUpdateType: "append" | "notify" | "prepend"

MiscMessageGenerationOptions

MiscMessageGenerationOptions: { ephemeralExpiration?: number | string; mediaUploadTimeoutMs?: number; messageId?: string; quoted?: WAMessage; timestamp?: Date }

Type declaration

  • Optional ephemeralExpiration?: number | string

    disappearing messages settings

  • Optional mediaUploadTimeoutMs?: number
  • Optional messageId?: string

    Force message id

  • Optional quoted?: WAMessage

    the message you want to quote

  • Optional timestamp?: Date

    optional, if you want to manually set the timestamp of the message

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"

SignalAuthState

SignalAuthState: { creds: SignalCreds; keys: SignalKeyStore }

Type declaration

SignalCreds

SignalCreds: { registrationId: number; signedIdentityKey: KeyPair; signedPreKey: SignedKeyPair }

Type declaration

  • Readonly registrationId: number
  • Readonly signedIdentityKey: KeyPair
  • Readonly signedPreKey: SignedKeyPair

SignalIdentity

SignalIdentity: { identifier: ProtocolAddress; identifierKey: Uint8Array }

Type declaration

SignalKeyStore

SignalKeyStore: { 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

        • keyId: number

        Returns Awaitable<KeyPair>

  • getSenderKey: (id: string) => Awaitable<any>
      • (id: string): Awaitable<any>
      • Parameters

        • id: string

        Returns Awaitable<any>

  • getSession: (sessionId: string) => Awaitable<any>
      • (sessionId: string): Awaitable<any>
      • Parameters

        • sessionId: string

        Returns 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>
      • (keyId: number, pair: KeyPair | null): Awaitable<void>
      • Parameters

        • keyId: number
        • pair: KeyPair | null

        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

SignedKeyPair: { keyId: number; keyPair: KeyPair; signature: Uint8Array }

Type declaration

  • keyId: number
  • keyPair: KeyPair
  • signature: Uint8Array

SocketConfig

SocketConfig: { 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

    proxy agent

  • Optional auth?: AuthenticationState

    provide an auth state object to maintain the auth state

  • browser: WABrowserDescription

    override browser config

  • connectTimeoutMs: number

    Fails the connection if the socket times out in this interval

  • customUploadHosts: string[]

    custom domains to push media via

  • defaultQueryTimeoutMs: number | undefined

    Default timeout for queries, undefined for no timeout

  • emitOwnEvents: boolean

    should events be emitted for actions done by this socket connection

  • Optional fetchAgent?: Agent

    agent used for fetch requests -- uploading/downloading media

  • getMessage: (key: IMessageKey) => Promise<IMessage | undefined>

    fetch a message from your store implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried

  • keepAliveIntervalMs: number

    ping-pong interval for WS connection

  • logger: Logger

    pino logger

  • Optional mediaCache?: NodeCache

    provide a cache to store media, so does not have to be re-uploaded

  • Optional msgRetryCounterMap?: {}

    map to store the retry counts for failed messages

    • [msgId: string]: number
  • printQRInTerminal: boolean

    should the QR be printed in the terminal

  • Optional userDevicesCache?: NodeCache

    provide a cache to store a user's device list

  • version: WAVersion

    version to connect with

  • waWebSocketUrl: string | URL

    the WS url to connect to WA

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"

WAContactMessage

WAContactMessage: IContactMessage

WAContactsArrayMessage

WAContactsArrayMessage: IContactsArrayMessage

WAContextInfo

WAContextInfo: IContextInfo

WAGenericMediaMessage

WAInitResponse

WAInitResponse: { ref: string; status: 200; ttl: number }

Type declaration

  • ref: string
  • status: 200
  • ttl: number

WALocationMessage

WALocationMessage: ILocationMessage

WAMediaUpload

WAMediaUpload: Buffer | { url: URL | string } | { stream: Readable }

WAMediaUploadFunction

WAMediaUploadFunction: (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
        • mediaType: MediaType
        • Optional timeoutMs?: number

      Returns Promise<{ mediaUrl: string }>

WAMessage

WAMessage: IWebMessageInfo

WAMessageContent

WAMessageContent: IMessage

WAMessageCursor

WAMessageCursor: { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined }

WAMessageKey

WAMessageKey: IMessageKey

WAMessageUpdate

WAMessageUpdate: { key: IMessageKey; update: Partial<WAMessage> }

Type declaration

WAPatchCreate

WAPatchCreate: { apiVersion: number; index: string[]; operation: SyncdMutationSyncdOperation; syncAction: ISyncActionValue; type: WAPatchName }

Type declaration

WAPatchName

WAPatchName: "critical_block" | "critical_unblock_low" | "regular_low" | "regular_high" | "regular"

WAPresence

WAPresence: "unavailable" | "available" | "composing" | "recording" | "paused"

set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send

WASocket

WASocket: ReturnType<typeof default>

WATextMessage

WATextMessage: IExtendedTextMessage

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]
      • The appropriate browser based on your OS & release

        Parameters

        • browser: any

        Returns [string, string, string]

  • baileys: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        Returns [string, string, string]

  • macOS: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        Returns [string, string, string]

  • ubuntu: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        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
      • Parameters

        • k: any
        • value: any

        Returns any

  • reviver: (_: any, value: any) => any
      • (_: any, value: any): any
      • Parameters

        • _: any
        • value: any

        Returns 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

DEFAULT_CONNECTION_CONFIG: SocketConfig = ...

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_KEYS

MEDIA_KEYS: MediaType[] = ...

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 = ...

Functions

Binary

Binary:

aesDecrypt

  • aesDecrypt(buffer: Buffer, key: Buffer): Buffer
  • decrypt AES 256 CBC; where the IV is prefixed to the buffer

    Parameters

    • buffer: Buffer
    • key: Buffer

    Returns Buffer

aesDecryptWithIV

  • aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer
  • decrypt AES 256 CBC

    Parameters

    • buffer: Buffer
    • key: Buffer
    • IV: Buffer

    Returns Buffer

aesEncrypWithIV

  • aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer

aesEncrypt

  • aesEncrypt(buffer: Buffer | Uint8Array, key: Buffer): Buffer

Const areJidsSameUser

  • areJidsSameUser(jid1: string, jid2: string): boolean

Const assertNodeErrorFree

Const chatModificationToAppPatch

Const compressImage

  • compressImage(bufferOrFilePath: string | Buffer | Readable): Promise<Buffer>

Const configureSuccessfulPairing

Const createSignalIdentity

  • createSignalIdentity(wid: string, accountSignatureKey: Uint8Array): SignalIdentity

Const debouncedTimeout

  • debouncedTimeout(intervalMs?: number, task?: () => void): { cancel: () => void; setInterval: (newInterval: number) => number; setTask: (newTask: () => void) => () => void; start: (newIntervalMs?: number, newTask?: () => void) => void }
  • Parameters

    • intervalMs: number = 1000
    • task: () => void = ...
        • (): void
        • Returns void

    Returns { cancel: () => void; setInterval: (newInterval: number) => number; setTask: (newTask: () => void) => () => void; start: (newIntervalMs?: number, newTask?: () => void) => void }

    • cancel: () => void
        • (): void
        • Returns void

    • setInterval: (newInterval: number) => number
        • (newInterval: number): number
        • Parameters

          • newInterval: number

          Returns number

    • setTask: (newTask: () => void) => () => void
        • (newTask: () => void): () => void
        • Parameters

          • newTask: () => void
              • (): void
              • Returns void

          Returns () => void

            • (): void
            • Returns void

    • start: (newIntervalMs?: number, newTask?: () => void) => void
        • (newIntervalMs?: number, newTask?: () => void): void
        • Parameters

          • Optional newIntervalMs: number
          • Optional newTask: () => void
              • (): void
              • Returns void

          Returns void

Const decodeBinaryNode

Const decodeMessageStanza

  • decodeMessageStanza(stanza: BinaryNode, auth: AuthenticationState): Promise<{ author: string; chatId: string; failures: { error: Boom<any> }[]; from: string; msgId: string; participant: string; pushname: string; recipient: string; successes: Message[]; timestamp: number }>

Const decodePatches

Const decodeSyncdMutations

Const decodeSyncdPatch

Const decodeSyncdSnapshot

Const decryptGroupSignalProto

  • decryptGroupSignalProto(group: string, user: string, msg: Buffer | Uint8Array, auth: SignalAuthState): any

decryptMediaMessageBuffer

Const decryptSignalProto

  • decryptSignalProto(user: string, type: "pkmsg" | "msg", msg: Buffer | Uint8Array, auth: SignalAuthState): Promise<Buffer>

Const default

  • default(config: Partial<SocketConfig>): { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSession: (jid: string, force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: AuthenticationState; chatModify: (mod: ChatModification, jid: string, lastMessages: Pick<IWebMessageInfo, "key" | "messageTimestamp">[]) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<void>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; profilePictureUrl: (jid: string, type?: "preview" | "image") => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[], returnSnapshot?: boolean) => Promise<ChatMutation[]>; resyncMainAppState: () => Promise<void>; sendDeliveryReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }
  • Parameters

    Returns { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSession: (jid: string, force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: AuthenticationState; chatModify: (mod: ChatModification, jid: string, lastMessages: Pick<IWebMessageInfo, "key" | "messageTimestamp">[]) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<void>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; profilePictureUrl: (jid: string, type?: "preview" | "image") => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[], returnSnapshot?: boolean) => Promise<ChatMutation[]>; resyncMainAppState: () => Promise<void>; sendDeliveryReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }

    • appPatch: (patchCreate: WAPatchCreate) => Promise<void>
    • assertSession: (jid: string, force: boolean) => Promise<boolean>
        • (jid: string, force: boolean): Promise<boolean>
        • Parameters

          • jid: string
          • force: boolean

          Returns Promise<boolean>

    • assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>
        • (range: number, execute: (keys: {}) => Promise<void>): Promise<void>
        • get some pre-keys and do something with them

          Parameters

          • range: number
          • execute: (keys: {}) => Promise<void>
              • (keys: {}): Promise<void>
              • Parameters

                • keys: {}
                  • [_: number]: any

                Returns Promise<void>

          Returns Promise<void>

    • authState: AuthenticationState
    • chatModify: (mod: ChatModification, jid: string, lastMessages: Pick<IWebMessageInfo, "key" | "messageTimestamp">[]) => Promise<void>
        • modify a chat -- mark unread, read etc. lastMessages must be sorted in reverse chronologically requires the last messages till the last message received; required for archive & unread

          Parameters

          Returns Promise<void>

    • end: (error: Error) => void
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    • ev: BaileysEventEmitter
    • fetchBlocklist: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • fetchPrivacySettings: (force?: boolean) => Promise<{}>
        • (force?: boolean): Promise<{}>
        • Parameters

          • force: boolean = false

          Returns Promise<{}>

    • fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>
        • (jid: string): Promise<{ setAt: Date; status: string }>
        • Parameters

          • jid: string

          Returns Promise<{ setAt: Date; status: string }>

    • generateMessageTag: () => string
        • (): string
        • Returns string

    • groupAcceptInvite: (code: string) => Promise<string>
        • (code: string): Promise<string>
        • Parameters

          • code: string

          Returns Promise<string>

    • groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
        • (subject: string, participants: string[]): Promise<GroupMetadata>
        • Parameters

          • subject: string
          • participants: string[]

          Returns Promise<GroupMetadata>

    • groupFetchAllParticipating: () => Promise<{}>
        • (): Promise<{}>
        • Returns Promise<{}>

    • groupInviteCode: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Parameters

          • jid: string

          Returns Promise<string>

    • groupLeave: (id: string) => Promise<void>
        • (id: string): Promise<void>
        • Parameters

          • id: string

          Returns Promise<void>

    • groupMetadata: (jid: string) => Promise<GroupMetadata>
    • groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>
        • (jid: string, participants: string[], action: ParticipantAction): Promise<string[]>
        • Parameters

          Returns Promise<string[]>

    • groupRevokeInvite: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Parameters

          • jid: string

          Returns Promise<string>

    • groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>
        • (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked"): Promise<void>
        • Parameters

          • jid: string
          • setting: "announcement" | "not_announcement" | "locked" | "unlocked"

          Returns Promise<void>

    • groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
        • (jid: string, ephemeralExpiration: number): Promise<void>
        • Parameters

          • jid: string
          • ephemeralExpiration: number

          Returns Promise<void>

    • groupUpdateDescription: (jid: string, description?: string) => Promise<void>
        • (jid: string, description?: string): Promise<void>
        • Parameters

          • jid: string
          • Optional description: string

          Returns Promise<void>

    • groupUpdateSubject: (jid: string, subject: string) => Promise<void>
        • (jid: string, subject: string): Promise<void>
        • Parameters

          • jid: string
          • subject: string

          Returns Promise<void>

    • logout: () => Promise<void>
        • (): Promise<void>
        • logout & invalidate connection

          Returns Promise<void>

    • onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>
        • (...jids: string[]): Promise<{ exists: boolean; jid: string }[]>
        • Parameters

          • Rest ...jids: string[]

          Returns Promise<{ exists: boolean; jid: string }[]>

    • presenceSubscribe: (toJid: string) => Promise<void>
        • (toJid: string): Promise<void>
        • Parameters

          • toJid: string

          Returns Promise<void>

    • processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>
    • profilePictureUrl: (jid: string, type?: "preview" | "image") => Promise<string>
        • (jid: string, type?: "preview" | "image"): Promise<string>
        • fetch the profile picture of a user/group type = "preview" for a low res picture type = "image for the high res picture"

          Parameters

          • jid: string
          • type: "preview" | "image" = 'preview'

          Returns Promise<string>

    • query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>
        • send a query, and wait for its response. auto-generates message ID if not provided

          Parameters

          Returns Promise<BinaryNode>

    • refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>
    • relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>
    • resyncAppState: (collections: WAPatchName[], returnSnapshot?: boolean) => Promise<ChatMutation[]>
    • resyncMainAppState: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • sendDeliveryReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>
        • (jid: string, participant: string, messageIds: string[]): Promise<void>
        • Parameters

          • jid: string
          • participant: string
          • messageIds: string[]

          Returns Promise<void>

    • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>
    • sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>
        • (__namedParameters: BinaryNode, extraAttrs: {}): Promise<void>
        • Parameters

          • __namedParameters: BinaryNode
          • extraAttrs: {}
            • [key: string]: string

          Returns Promise<void>

    • sendNode: (node: BinaryNode) => Promise<void>
        • send a binary node

          Parameters

          Returns Promise<void>

    • sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
        • (type: WAPresence, toJid?: string): Promise<void>
        • Parameters

          Returns Promise<void>

    • sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>
        • (data: Buffer | Uint8Array): Promise<void>
        • send a raw buffer

          Parameters

          • data: Buffer | Uint8Array

          Returns Promise<void>

    • sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>
        • (jid: string, participant: string, messageIds: string[]): Promise<void>
        • Parameters

          • jid: string
          • participant: string
          • messageIds: string[]

          Returns Promise<void>

    • updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
        • (jid: string, action: "block" | "unblock"): Promise<void>
        • Parameters

          • jid: string
          • action: "block" | "unblock"

          Returns Promise<void>

    • updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
    • user: Contact
    • waUploadToServer: WAMediaUploadFunction
    • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
        • (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number): Promise<void>
        • Waits for the connection to WA to reach a state

          Parameters

          Returns Promise<void>

    • waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>
        • (msgId: string, timeoutMs?: number): Promise<any>
        • Wait for a message with a certain tag to be received

          Parameters

          • msgId: string
          • timeoutMs: number = ...

            timeout after which the promise will reject

          Returns Promise<any>

    • waitForSocketOpen: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • ws: WebSocket

Const delay

  • delay(ms: number): Promise<void>

Const delayCancellable

  • delayCancellable(ms: number): { cancel: () => void; delay: Promise<void> }
  • Parameters

    • ms: number

    Returns { cancel: () => void; delay: Promise<void> }

    • cancel: () => void
        • (): void
        • Returns void

    • delay: Promise<void>

Const downloadContentFromMessage

  • downloadContentFromMessage(__namedParameters: DownloadableMessage, type: MediaType, __namedParameters?: MediaDownloadOptions): Promise<Transform>

Const downloadExternalBlob

Const downloadExternalPatch

Const downloadHistory

Const encodeBigEndian

  • encodeBigEndian(e: number, t?: number): Uint8Array

Const encodeBinaryNode

Const encodeInt

  • encodeInt(e: number, t: number): Uint8Array

Const encodeSyncdPatch

Const encodeWAMessage

  • encodeWAMessage(message: IMessage): Buffer

Const encryptSenderKeyMsgSignalProto

  • encryptSenderKeyMsgSignalProto(group: string, data: Buffer | Uint8Array, meId: string, auth: SignalAuthState): Promise<{ ciphertext: Uint8Array; senderKeyDistributionMessageKey: Buffer }>
  • Parameters

    • group: string
    • data: Buffer | Uint8Array
    • meId: string
    • auth: SignalAuthState

    Returns Promise<{ ciphertext: Uint8Array; senderKeyDistributionMessageKey: Buffer }>

Const encryptSignalProto

  • encryptSignalProto(user: string, buffer: Buffer, auth: SignalAuthState): Promise<{ ciphertext: Buffer; type: string }>

Const encryptedStream

  • encryptedStream(media: WAMediaUpload, mediaType: MediaType, saveOriginalFileIfRequired?: boolean): Promise<{ bodyPath: string; didSaveToTmpPath: boolean; encBodyPath: string; fileEncSha256: Buffer; fileLength: number; fileSha256: Buffer; mac: Buffer; mediaKey: Buffer }>
  • Parameters

    Returns Promise<{ bodyPath: string; didSaveToTmpPath: boolean; encBodyPath: string; fileEncSha256: Buffer; fileLength: number; fileSha256: Buffer; mac: Buffer; mediaKey: Buffer }>

extensionForMediaMessage

Const extractDeviceJids

Const extractMessageContent

  • Extract the true message content from a message Eg. extracts the inner message from a disappearing message/view once message

    Parameters

    Returns IMessage

Const extractSyncdPatches

  • extractSyncdPatches(result: BinaryNode): Promise<{ critical_block: any; critical_unblock_low: any; regular: any; regular_high: any; regular_low: any }>
  • Parameters

    Returns Promise<{ critical_block: any; critical_unblock_low: any; regular: any; regular_high: any; regular_low: any }>

Const generateForwardMessageContent

Const generateLoginNode

  • generateLoginNode(userJid: string, config: Pick<SocketConfig, "version" | "browser">): Uint8Array

Const generateMessageID

  • generateMessageID(): string

Const generateOrGetPreKeys

  • generateOrGetPreKeys(creds: AuthenticationCreds, range: number): { lastPreKeyId: number; newPreKeys: {}; preKeysRange: readonly [number, number] }
  • Parameters

    Returns { lastPreKeyId: number; newPreKeys: {}; preKeysRange: readonly [number, number] }

    • lastPreKeyId: number
    • newPreKeys: {}
    • preKeysRange: readonly [number, number]

Const generateProfilePicture

  • generateProfilePicture(mediaUpload: WAMediaUpload): Promise<{ img: Buffer }>

Const generateRegistrationId

  • generateRegistrationId(): number

Const generateRegistrationNode

  • generateRegistrationNode(__namedParameters: SignalCreds, config: Pick<SocketConfig, "version" | "browser">): Uint8Array

Const generateSignalPubKey

  • generateSignalPubKey(pubKey: Buffer | Uint8Array): Buffer

generateThumbnail

  • generateThumbnail(file: string, mediaType: "video" | "image", options: { logger?: Logger }): Promise<string>
  • generates a thumbnail for a given media, if required

    Parameters

    • file: string
    • mediaType: "video" | "image"
    • options: { logger?: Logger }
      • Optional logger?: Logger

    Returns Promise<string>

Const generateWAMessage

Const generateWAMessageContent

Const generateWAMessageFromContent

Const getAllBinaryNodeChildren

getAudioDuration

  • getAudioDuration(buffer: Buffer | string): Promise<number>

Const getBinaryNodeChild

Const getBinaryNodeChildBuffer

  • getBinaryNodeChildBuffer(node: BinaryNode, childTag: string): Buffer | Uint8Array

Const getBinaryNodeChildUInt

  • getBinaryNodeChildUInt(node: BinaryNode, childTag: string, length: number): number

Const getBinaryNodeChildren

Const getDevice

  • getDevice(id: string): "android" | "ios" | "web"
  • Returns the device predicted by message ID

    Parameters

    • id: string

    Returns "android" | "ios" | "web"

Const getGotStream

  • getGotStream(url: string | URL, options?: Options & { isStream?: true }): Promise<default>

getMediaKeys

  • getMediaKeys(buffer: any, mediaType: MediaType): { cipherKey: Buffer; iv: Buffer; macKey: Buffer }
  • generates all the keys required to encrypt/decrypt & sign a media message

    Parameters

    Returns { cipherKey: Buffer; iv: Buffer; macKey: Buffer }

    • cipherKey: Buffer
    • iv: Buffer
    • macKey: Buffer

Const getPreKeys

  • getPreKeys(__namedParameters: SignalKeyStore, min: number, limit: number): Promise<{}>

Const getStream

  • getStream(item: WAMediaUpload): Promise<{ stream: Readable; type: string }>

hkdf

  • hkdf(buffer: Uint8Array, expandedLength: number, __namedParameters: { info?: string; salt?: Buffer }): Buffer
  • Parameters

    • buffer: Uint8Array
    • expandedLength: number
    • __namedParameters: { info?: string; salt?: Buffer }
      • Optional info?: string
      • Optional salt?: Buffer

    Returns Buffer

Const hkdfInfoKey

hmacSign

  • hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: "sha256" | "sha512"): Buffer
  • Parameters

    • buffer: Buffer | Uint8Array
    • key: Buffer | Uint8Array
    • variant: "sha256" | "sha512" = 'sha256'

    Returns Buffer

Const initAuthCreds

Const initInMemoryKeyStore

  • initInMemoryKeyStore(__namedParameters?: { appStateSyncKeys?: {}; appStateVersions?: {}; preKeys?: {}; senderKeys?: {}; sessions?: {} }, save: (data: any) => void): SignalKeyStore
  • Parameters

    • __namedParameters: { appStateSyncKeys?: {}; appStateVersions?: {}; preKeys?: {}; senderKeys?: {}; sessions?: {} } = {}
      • Optional appStateSyncKeys?: {}
      • Optional appStateVersions?: {}
      • Optional preKeys?: {}
      • Optional senderKeys?: {}
        • [k: string]: any
      • Optional sessions?: {}
        • [k: string]: any
    • save: (data: any) => void
        • (data: any): void
        • Parameters

          • data: any

          Returns void

    Returns SignalKeyStore

Const isJidBroadcast

  • isJidBroadcast(jid: string): boolean

Const isJidGroup

  • isJidGroup(jid: string): boolean

Const isJidStatusBroadcast

  • isJidStatusBroadcast(jid: string): boolean

Const isJidUser

  • isJidUser(jid: string): boolean

Const jidDecode

  • jidDecode(jid: string): { agent: number; device: number; server: string; user: string }
  • Parameters

    • jid: string

    Returns { agent: number; device: number; server: string; user: string }

    • agent: number
    • device: number
    • server: string
    • user: string

Const jidEncode

  • jidEncode(user: string | number, server: JidServer, device?: number, agent?: number): string

Const jidNormalizedUser

  • jidNormalizedUser(jid: string): string

Const jidToSignalProtocolAddress

  • jidToSignalProtocolAddress(jid: string): any

Const jidToSignalSenderKeyName

  • jidToSignalSenderKeyName(group: string, user: string): string

Const makeNoiseHandler

  • makeNoiseHandler(__namedParameters: KeyPair): { authenticate: (data: Uint8Array) => void; decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void; decrypt: (ciphertext: Uint8Array) => Buffer; encodeFrame: (data: Buffer | Uint8Array) => Uint8Array; encrypt: (plaintext: Uint8Array) => Buffer; finishInit: () => void; mixIntoKey: (data: Uint8Array) => void; processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer }
  • Parameters

    Returns { authenticate: (data: Uint8Array) => void; decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void; decrypt: (ciphertext: Uint8Array) => Buffer; encodeFrame: (data: Buffer | Uint8Array) => Uint8Array; encrypt: (plaintext: Uint8Array) => Buffer; finishInit: () => void; mixIntoKey: (data: Uint8Array) => void; processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer }

    • authenticate: (data: Uint8Array) => void
        • (data: Uint8Array): void
        • Parameters

          • data: Uint8Array

          Returns void

    • decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void
        • (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void): void
        • Parameters

          • newData: Buffer | Uint8Array
          • onFrame: (buff: BinaryNode | Uint8Array) => void

          Returns void

    • decrypt: (ciphertext: Uint8Array) => Buffer
        • (ciphertext: Uint8Array): Buffer
        • Parameters

          • ciphertext: Uint8Array

          Returns Buffer

    • encodeFrame: (data: Buffer | Uint8Array) => Uint8Array
        • (data: Buffer | Uint8Array): Uint8Array
        • Parameters

          • data: Buffer | Uint8Array

          Returns Uint8Array

    • encrypt: (plaintext: Uint8Array) => Buffer
        • (plaintext: Uint8Array): Buffer
        • Parameters

          • plaintext: Uint8Array

          Returns Buffer

    • finishInit: () => void
        • (): void
        • Returns void

    • mixIntoKey: (data: Uint8Array) => void
        • (data: Uint8Array): void
        • Parameters

          • data: Uint8Array

          Returns void

    • processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer

Const mediaMessageSHA256B64

  • mediaMessageSHA256B64(message: IMessage): string

Const newLTHashState

Const parseAndInjectE2ESession

Const prepareDisappearingMessageSettingContent

  • prepareDisappearingMessageSettingContent(ephemeralExpiration?: number): Message

Const prepareWAMessageMedia

Const processSenderKeyMessage

promiseTimeout

  • promiseTimeout<T>(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise<T>
  • Type parameters

    • T

    Parameters

    • ms: number
    • promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void
        • (resolve: (v?: T) => void, reject: (error: any) => void): void
        • Parameters

          • resolve: (v?: T) => void
              • (v?: T): void
              • Parameters

                • Optional v: T

                Returns void

          • reject: (error: any) => void
              • (error: any): void
              • Parameters

                • error: any

                Returns void

          Returns void

    Returns Promise<T>

Const reduceBinaryNodeToDictionary

  • reduceBinaryNodeToDictionary(node: BinaryNode, tag: string): {}

sha256

  • sha256(buffer: Buffer): Buffer

shallowChanges

  • shallowChanges<T>(old: T, current: T, __namedParameters: { lookForDeletedKeys: boolean }): Partial<T>
  • Type parameters

    • T

    Parameters

    • old: T
    • current: T
    • __namedParameters: { lookForDeletedKeys: boolean }
      • lookForDeletedKeys: boolean

    Returns Partial<T>

Const signalStorage

  • signalStorage(__namedParameters: SignalAuthState): { getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }; getOurRegistrationId: () => number; isTrustedIdentity: () => boolean; loadPreKey: (id: number) => Promise<{ privKey: Buffer; pubKey: Buffer }>; loadSenderKey: (keyId: any) => Promise<any>; loadSession: (id: any) => Promise<any>; loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }; removePreKey: (id: number) => Awaitable<void>; storeSenderKey: (keyId: any, key: any) => Promise<void>; storeSession: (id: any, session: any) => Promise<void> }
  • Parameters

    Returns { getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }; getOurRegistrationId: () => number; isTrustedIdentity: () => boolean; loadPreKey: (id: number) => Promise<{ privKey: Buffer; pubKey: Buffer }>; loadSenderKey: (keyId: any) => Promise<any>; loadSession: (id: any) => Promise<any>; loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }; removePreKey: (id: number) => Awaitable<void>; storeSenderKey: (keyId: any, key: any) => Promise<void>; storeSession: (id: any, session: any) => Promise<void> }

    • getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }
        • (): { privKey: Buffer; pubKey: Buffer }
        • Returns { privKey: Buffer; pubKey: Buffer }

          • privKey: Buffer
          • pubKey: Buffer
    • getOurRegistrationId: () => number
        • (): number
        • Returns number

    • isTrustedIdentity: () => boolean
        • (): boolean
        • Returns boolean

    • loadPreKey: (id: number) => Promise<{ privKey: Buffer; pubKey: Buffer }>
        • (id: number): Promise<{ privKey: Buffer; pubKey: Buffer }>
        • Parameters

          • id: number

          Returns Promise<{ privKey: Buffer; pubKey: Buffer }>

    • loadSenderKey: (keyId: any) => Promise<any>
        • (keyId: any): Promise<any>
        • Parameters

          • keyId: any

          Returns Promise<any>

    • loadSession: (id: any) => Promise<any>
        • (id: any): Promise<any>
        • Parameters

          • id: any

          Returns Promise<any>

    • loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }
        • (keyId: number): { privKey: Buffer; pubKey: Buffer }
        • Parameters

          • keyId: number

          Returns { privKey: Buffer; pubKey: Buffer }

          • privKey: Buffer
          • pubKey: Buffer
    • removePreKey: (id: number) => Awaitable<void>
        • (id: number): Awaitable<void>
        • Parameters

          • id: number

          Returns Awaitable<void>

    • storeSenderKey: (keyId: any, key: any) => Promise<void>
        • (keyId: any, key: any): Promise<void>
        • Parameters

          • keyId: any
          • key: any

          Returns Promise<void>

    • storeSession: (id: any, session: any) => Promise<void>
        • (id: any, session: any): Promise<void>
        • Parameters

          • id: any
          • session: any

          Returns Promise<void>

Const signedKeyPair

  • signedKeyPair(keyPair: KeyPair, keyId: number): { keyId: number; keyPair: KeyPair; signature: Buffer }

Const toBuffer

  • toBuffer(stream: Readable): Promise<Buffer>

Const toNumber

  • toNumber(t: number | Long): number

Const toReadable

  • toReadable(buffer: Buffer): Readable

Const unixTimestampSeconds

  • unixTimestampSeconds(date?: Date): number

Const unpadRandomMax16

  • unpadRandomMax16(e: Buffer | Uint8Array): Uint8Array

Const useSingleFileAuthState

  • useSingleFileAuthState(filename: string): { saveState: () => void; state: AuthenticationState }

Const writeRandomPadMax16

  • writeRandomPadMax16(e: any): any

Const xmppPreKey

Const xmppSignedPreKey

Generated using TypeDoc