import type { ChallengeAuth } from "../auth/challenge-auth.js"; import type { ExternalMessage } from "../types.js"; import type { ITransportProvider } from "./interface.js"; /** * Matrix transport provider using matrix-bot-sdk * Works with any Matrix homeserver — Element X, Element Web, FluffyChat, etc. */ export declare class MatrixProvider implements ITransportProvider { private config; private auth; readonly type = "matrix"; private client?; private _isConnected; private messageHandler?; private errorHandler?; private botUserId?; private joinedRooms; private roomMemberCount; private connectedAt; private sendQueue; private processing; private rateLimitedUntil; private rateLimitNotePending; constructor(config: { homeserverUrl: string; accessToken: string; encryption?: boolean; }, auth: ChallengeAuth); get isConnected(): boolean; connect(): Promise; disconnect(): Promise; sendMessage(chatId: string, text: string): Promise; editMessage(chatId: string, messageId: string, text: string): Promise; /** * Append a job to the outbound queue and start the processor. Consecutive * pending edits to the same message are coalesced (the queued text is replaced) * so a backoff doesn't flush a run of stale intermediate edits. */ private enqueue; /** Find a not-yet-dispatched edit for the same message that can be coalesced. */ private findCoalescableEdit; /** * Drain the outbound queue one job at a time, honoring the rate-limit backoff. * On a 429 the head job stays in place and is retried after the server's * retry_after delay; other errors reject the job and move on. */ private processQueue; /** Perform the actual SDK call for a single queued job. */ private dispatch; sendTyping(chatId: string): Promise; stopTyping(chatId: string): Promise; onMessage(handler: (message: ExternalMessage) => void): void; onError(handler: (error: Error) => void): void; private handleMessage; } //# sourceMappingURL=matrix.d.ts.map