import type { AnyMessageContent, MessageGenerationOptions, MessageReceiptType, MessageRelayOptions, WAMessage, WAMessageContent, WAMessageKey } from '../Types/index.js'; import { WAProto } from '../Types/index.js'; import type { SocketContext } from './types.js'; /** * Drop `messageContextInfo` before handing the proto to the Rust bridge so the * bridge can fill in its own `messageSecret` / `reportingTokenVersion`. * * Exception: pin messages need `messageAddOnDurationInSecs` (86400 / 604800 / * 2592000 to pin, 0 to unpin). The bridge does not set this field, so we save * it across the delete and restore it on a fresh contextInfo. * * Mutates `msg` in place. */ export declare function stripContextInfoForBridge(msg: WAMessageContent): void; export declare const makeMessageMethods: (ctx: SocketContext) => { sendMessage: (jid: string, content: AnyMessageContent, options?: Omit) => Promise; updateMediaMessage: (message: WAMessage) => Promise; /** * Low-level message relay — sends a raw proto.IMessage with full control * over the message ID. Use `sendMessage` for the high-level API that handles * media upload, message generation, link previews, etc. * * Returns a {@link WAMessage} envelope (matching upstream Baileys' shape) so * callers can do `const msg = await relayMessage(...)` and forward `msg.key` * to subsequent operations. The returned `key.id` is the server-assigned id. * * @param jid Recipient JID * @param message Raw protobuf Message (snake_case keys) * @param options Relay options (messageId, statusJidList) */ relayMessage: (jid: string, message: WAProto.IMessage, { messageId, statusJidList }?: MessageRelayOptions) => Promise; readMessages: (keys: { remoteJid: string; id: string; participant?: string; }[]) => Promise; /** * Send a receipt for messages. The bridge handles most receipt types automatically * (delivered, sender). Use `readMessages` for the common case of sending read receipts. * * Supported types via bridge: 'read', 'read-self', 'played' * Auto-handled by bridge: 'sender', 'inactive', undefined (delivered) * Not supported: 'hist_sync', 'peer_msg' (logged as warning) */ sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise; /** * Send receipts for multiple message keys, grouped by JID and participant. */ sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise; /** * Request resend of a placeholder message via PeerDataOperationRequest. * Wraps the request in a protocolMessage and relays it to the chat. */ requestPlaceholderResend: (messageKey: WAMessageKey, _msgData?: Partial) => Promise; }; //# sourceMappingURL=messages.d.ts.map