import { Dict } from "./types.js"; /** * Common message utilities * Provides helper methods for message formatting and transformation */ export declare namespace MessageUtils { /** * Format event payload with common fields * Removes internal fields and normalizes data */ function formatEventPayload(payload: Dict): Dict; /** * Normalize sender information * Ensures user_id is extracted from sender object if needed */ function normalizeSender(data: Dict): Dict; /** * Create self info object */ function createSelfInfo(platform: string, userId: string | number): Dict; /** * Add reply element to message * Handles both V11 and V12 formats */ function addReplyToMessage(message: Dict[], messageId: string | number, version: V, detailType?: string): Dict[]; /** * Clean internal fields from payload * Removes fields like group, member, discuss, friend which are internal */ function cleanInternalFields(payload: Dict, fieldsToRemove?: string[]): Dict; /** * Extract message content as plain text * Recursively extracts text from message segments */ function extractPlainText(message: unknown): string; /** * Validate message format */ function isValidMessage(message: unknown): boolean; /** * Create message event payload */ function createMessageEvent(type: "message", detailType: string, data: Dict): Dict; /** * Create notice event payload */ function createNoticeEvent(noticeType: string, data: Dict): Dict; /** * Create request event payload */ function createRequestEvent(requestType: string, data: Dict): Dict; }