import type { FeishuAdapter } from './feishu.js'; import type { OutputStream, MutableRegion, OpenOutputStreamOpts } from '../output-stream.js'; import type { MessageRef, RichBlock, ActionElement, Destination } from '../types.js'; /** Test-only: override retry delays to skip real wall-clock waits. */ export declare function _testSetRetryDelays(delays: readonly number[]): void; /** Test-only: restore production retry delays. */ export declare function _testResetRetryDelays(): void; export declare class FeishuOutputStream implements OutputStream { private adapter; private destination; private threadId; private onMessagePosted; private maxChunk; private durable; private get _logChannel(); private parentRef; private currentRef; private currentContent; private mutableTail; private allRefs; private queue; private lastError; /** Generation counter for MutableRegion staleness tracking. */ private _regionGeneration; constructor(adapter: FeishuAdapter, destination: Destination, opts?: OpenOutputStreamOpts); emitText(text: string): void; openMutable(text: string): MutableRegion; postInteractive(text: string, opts?: { richBlocks?: RichBlock[]; actions?: ActionElement[]; }): Promise; flush(): Promise; getRefs(): MessageRef[]; getParentRef(): MessageRef | null; /** Called by FeishuMutableRegion.update(). No-op if the generation is stale. */ _regionUpdate(generation: number, text: string): void; private _noopRegion; private _processAppend; private _processOpenMutable; private _processEditMutableTail; /** Combined display = currentContent [+ SEP + mutableTail]. */ private _renderWithTail; /** Synchronously move mutableTail into currentContent. */ private _sealMutableTailNow; private _postNew; private _postOne; /** Patch the current card with the combined content. Returns delivered. */ private _updateCurrent; }