import { OneBotTransport } from '../qq/transport.js'; import type { OneBotConnection } from '../qq/connection.js'; import type { PartnerOutboundAttachment } from '../../channel-message.js'; import { type ProgressTransport } from './progress-transport.js'; import { type DirectMedia } from './media.js'; export type DirectPlatform = 'matrix' | 'mattermost' | 'qq'; export interface DirectConfig { qq?: import('../qq/settings.js').QqSettings; platform: DirectPlatform; baseUrl: string; targetId: string; } export interface DirectMessage { qqReplyId?: string; qqQuote?: import('../qq/quote.js').QqQuote; senderName?: string; qqGroup?: { groupId: string; userId: string; senderName: string; mentioned: boolean; autonomous: boolean; otherMention?: boolean; otherMentionOffsets?: number[]; hasReply?: boolean; replyToId?: string; replyTo?: 'self' | 'other'; }; id: string; sender: string; text: string; targetId?: string; media?: DirectMedia[]; timestamp?: number; receivedAt?: number; } export interface DirectBatch { cursor: string; messages: DirectMessage[]; warning?: string; } export interface ChannelSender { sendText(userId: string, text: string, context: string | undefined, signal?: AbortSignal): Promise; sendAttachment(userId: string, file: PartnerOutboundAttachment, context: string | undefined, signal?: AbortSignal, allowed?: () => boolean): Promise; } export declare class ChannelHttpError extends Error { readonly status: number; readonly retryAfterMs: number; constructor(status: number, retryAfterMs?: number); } export declare function directConfig(value: Record): DirectConfig; /** Explicit, two-member conversations only. No group inference from display names. */ export declare class DirectTransport implements ChannelSender { readonly config: DirectConfig; private readonly token; private readonly expected?; private readonly authorize?; private botId; private peerId; private readonly qq; constructor(config: DirectConfig, token: string, expected?: { accountId: string; peerId: string; } | undefined, authorize?: (() => void) | undefined, connection?: OneBotConnection); get onebot(): OneBotTransport | undefined; forTarget(targetId: string, expected: { accountId: string; peerId: string; }, authorize?: () => void): DirectTransport; withRecipientValidation(userId: string, signal: AbortSignal, send: () => Promise): Promise; close(): void; private request; validate(signal?: AbortSignal): Promise<{ accountId: string; peerId: string; }>; poll(cursor: string | undefined, signal: AbortSignal, waitMs?: number): Promise; sendText(userId: string, text: string, _context: string | undefined, signal?: AbortSignal): Promise; progress(userId: string): ProgressTransport | undefined; receiveAttachments(message: DirectMessage, signal: AbortSignal, allowed: () => boolean, maxBytes?: number): Promise; sendAttachment(userId: string, file: PartnerOutboundAttachment, _context: string | undefined, signal?: AbortSignal, allowed?: () => boolean): Promise; } //# sourceMappingURL=transport.d.ts.map