import { MessageUpdateStatus } from './messages.js'; declare enum ConnectionState { OPEN = "open", CONNECTING = "connecting", CLOSED = "close", REFUSED = "refused" } declare enum MessageType { CONVERSATION = "conversation", TEXT = "textMessage", EPHEMERAL = "ephemeralMessage", AUDIO = "audioMessage", IMAGE = "imageMessage", VIDEO = "videoMessage", DOCUMENT = "documentMessage", STICKER = "stickerMessage", CONTACT = "contactMessage", LOCATION = "locationMessage", REACTION = "reactionMessage", BUTTONS = "buttonsMessage" } interface DeviceListMetadata { senderKeyHash: string; senderTimestamp: string; recipientKeyHash: string; recipientTimestamp: string; } interface MessageContextInfo { deviceListMetadata?: DeviceListMetadata | Record; deviceListMetadataVersion: number; messageSecret: string; } interface DisappearingMode { initiator: string; trigger: string; initiatedByMe: boolean; } interface ContextInfo { expiration?: number; ephemeralSettingTimestamp?: string; disappearingMode?: DisappearingMode; stanzaId?: string; participant?: string; quotedMessage?: { conversation?: string; }; statusSourceType?: string; forwardingScore?: number; isForwarded?: boolean; pairedMediaType?: string; } interface ImageMessage { url: string; mimetype: string; fileSha256: string; fileLength: string; height: number; width: number; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: string; jpegThumbnail: string; contextInfo?: ContextInfo; firstScanSidecar: string; firstScanLength: number; scansSidecar: string; scanLengths: number[]; midQualityFileSha256: string; imageSourceType: string; } interface AudioMessage { url: string; mimetype: string; fileSha256: string; fileLength: string; seconds: number; ptt: boolean; mediaKey: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: string; waveform: string; } interface StickerMessage { url: string; width: number; height: number; isAvatar: boolean; isLottie: boolean; mediaKey: string; mimetype: string; directPath: string; fileLength: string; fileSha256: string; isAnimated: boolean; isAiSticker: boolean; fileEncSha256: string; stickerSentTs: string; mediaKeyTimestamp: string; } interface VideoMessage { url: string; mimetype: string; fileSha256: string; fileLength: string; seconds: number; mediaKey: string; height: number; width: number; fileEncSha256: string; directPath: string; mediaKeyTimestamp: string; jpegThumbnail: string; contextInfo?: ContextInfo; streamingSidecar: string; externalShareFullVideoDurationInSeconds: number; } interface ReactionMessage { key: { remoteJid: string; fromMe: boolean; id: string; }; text: string; senderTimestampMs: string; } interface DocumentMessage { url: string; mimetype: string; fileSha256: string; fileLength: string; pageCount: number; mediaKey: string; fileName: string; fileEncSha256: string; directPath: string; mediaKeyTimestamp: string; contextInfo: ContextInfo; caption: string; } interface ContactMessage { displayName: string; vcard: string; } interface ExtendedTextMessage { text: string; contextInfo?: ContextInfo; } type MessageContent = { messageContextInfo?: MessageContextInfo; conversation?: string; extendedTextMessage?: ExtendedTextMessage; imageMessage?: ImageMessage; audioMessage?: AudioMessage; stickerMessage?: StickerMessage; ephemeralMessage?: EphemeralMessage; videoMessage?: VideoMessage; documentMessage?: DocumentMessage; contactMessage?: ContactMessage; locationMessage?: any; reactionMessage?: ReactionMessage; buttonsMessage?: any; }; interface MessageUpdate { status: MessageUpdateStatus; } interface ConnectionUpdatePayload { instance: string; wuid?: string; profileName?: string; profilePictureUrl?: string | null; state: ConnectionState; statusReason: number; } interface ContactPayload { remoteJid: string; pushName: string; profilePicUrl: string | null; instanceId: string; } interface EphemeralMessage { message: MessageContent; } interface MessagePayload { key: { remoteJid: string; fromMe: boolean; id: string; senderLid?: string; }; pushName?: string; message?: MessageContent; messageType?: MessageType; messageTimestamp?: number; status?: string; participant?: string; contextInfo?: ContextInfo; instanceId?: string; source?: string; } interface WebhookData { event: string; instance: string; data: MessagePayload | ContactPayload | ContactPayload[] | ConnectionUpdatePayload; sender: string; date?: number; instanceName?: string; destination?: string; date_time?: string; server_url?: string; apikey?: string; } interface Instance { instanceName: string; status: string; qrcode?: string; } interface Message { key: { remoteJid: string; fromMe: boolean; id: string; }; message: Record; messageTimestamp: number; pushName?: string; } export { type AudioMessage, ConnectionState, type ConnectionUpdatePayload, type ContactMessage, type ContactPayload, type ContextInfo, type DeviceListMetadata, type DisappearingMode, type DocumentMessage, type EphemeralMessage, type ExtendedTextMessage, type ImageMessage, type Instance, type Message, type MessageContent, type MessageContextInfo, type MessagePayload, MessageType, type MessageUpdate, type ReactionMessage, type StickerMessage, type VideoMessage, type WebhookData };