/** * Pure utility functions for Matrix transport. * Extracted for testability — no SDK or network dependencies. */ /** Small note prepended to the first message delivered after a rate-limit backoff. */ export declare const RATE_LIMIT_NOTE = "\u23F3 *(delayed \u2014 rate limited)*"; /** * Extract the rate-limit backoff (in ms) from a thrown Matrix error. * * Returns the time to wait before retrying if the error is a rate-limit (429 / * M_LIMIT_EXCEEDED, or any error carrying a retry_after hint), otherwise null. * Reads defensively from both the typed `retryAfterMs` field and the raw * `body.retry_after_ms`, since either may be present depending on the call path. */ export declare function getRetryAfterMs(err: unknown): number | null; /** Escape HTML special characters */ export declare function escapeHtml(text: string): string; /** Convert markdown to Matrix HTML. Returns plain body + optional formatted HTML. */ export declare function formatForMatrix(text: string): { body: string; formattedBody?: string; }; /** * Determine whether to skip a Matrix room event before processing. * Returns a reason string if the event should be skipped, or null if it should be processed. */ export declare function shouldSkipEvent(event: { sender?: string; origin_server_ts?: number; content?: any; }, botUserId: string, connectedAt: number, joinedRooms: Set, roomId: string): string | null; /** Extract Matrix username (localpart) from a full MXID like @user:matrix.org */ export declare function extractUsername(userId: string): string; /** * Check if bot was mentioned, matching either: * - the full MXID `@user:server` * - `@localpart` as a leading-@ word (avoids false-positives on bare names) */ export declare function wasBotMentioned(messageText: string, botUserId: string): boolean; /** Strip bot mention from message text — symmetric with wasBotMentioned */ export declare function stripBotMention(text: string, botUserId: string): string; //# sourceMappingURL=matrix-utils.d.ts.map