/** * Pure-function render pipeline for `botmux quoted`. Extracted so unit tests * can exercise the wire-up (numberer sharing, extraResources merging) without * spinning up the CLI dispatcher or hitting Lark APIs. */ import type { LarkMessage } from '../types.js'; import { createImgNumberer, type MessageResource } from '../im/lark/message-parser.js'; /** Subset of expandMergeForward used here — accepts the parsed message and a * numberer, mutates parsed.content to the rendered tree, returns extra * resources from sub-messages. Dependency-injected so tests can stub it. */ export type ExpandMergeForwardFn = (larkAppId: string, messageId: string, parsed: LarkMessage, numberer: ReturnType) => Promise<{ extraResources: MessageResource[]; }>; /** Subset of resolveMergedCardContent used here (dependency-injected so tests * can stub it): resolves an interactive card to its merged text + structured * JSON + resources, numbering [图片 N] via the given numberer. */ export type ResolveMergedCardFn = (larkAppId: string, messageId: string, numberer: ReturnType) => Promise<{ text: string; structuredContent: string; resources: MessageResource[]; } | null>; export interface RenderedQuotedMessage extends LarkMessage { resources: MessageResource[]; /** Structured card JSON from the merge pass — set only for interactive * messages that were successfully re-resolved (`quoted --raw` → cardJson). */ mergedStructuredContent?: string; } /** * Render a single quoted message into the JSON shape `botmux quoted` emits. * * Invariants this preserves: * - Image and file counters in `[图片 N]` / `[文件 N]` placeholders align * 1:1 with the indices of the matching-type entries in `resources` * (independent counters, mirrors `formatAttachmentsHint`). * - For merge_forward messages, sub-message images/files are appended to * `resources` and rendered inside the forwarded-XML tree using the same * numberer, so placeholders inside the XML keep aligning with the * overall list. */ export declare function renderQuotedMessage(larkAppId: string, rawMessage: any, expandMergeForward: ExpandMergeForwardFn, resolveMergedCard?: ResolveMergedCardFn): Promise; //# sourceMappingURL=quoted-render.d.ts.map