/** * Compute all patches needed for a document's blocks. * * Rainbow is based on relative heading depth in the body, not block_type: * - Highest level heading → LightRedBackground * - Next level → LightOrangeBackground * - And so on... */ import type { LarkCli } from "../cli.js"; export type BgMode = "light" | "dark"; export interface Patch { blockId: string; bg: string; label: string; } /** * Compute all patches needed for a document's blocks. * * Block types (Lark docx): * 3=H1, 4=H2, 5=H3, 6=H4, 7=H5, 8=H6, 9=H7, 10=H8, 11=H9 * * Rainbow shifts to match actual heading levels in the body: * - If body starts at H2, then H2=red, H3=orange, H4=yellow, ... */ export declare function computePatches(blocks: Record[], bgMode?: BgMode): Patch[]; /** * Strip Feishu's auto-added trailing newline from code block elements. * * When lark-cli creates a document, the markdown parser appends \n to the * last element of every code block (block_type 14). Feishu renders this as * a visible blank line at the bottom of the code block in the UI. * * The Feishu PATCH API does not support updating code block element content * (returns 1770001 invalid param). Instead, delete the block and recreate it * without the trailing \n — same approach as feishu_tool.py's _make_code(). * * Returns number of code blocks fixed. */ export declare function cleanupEmptyTails(cli: LarkCli, docId: string, blocks: Record[]): number; /** * Execute patches sequentially with rate limiting. * Returns [successCount, totalCount]. */ export declare function executePatches(cli: LarkCli, docId: string, patches: Patch[], delayMs?: number): [number, number]; //# sourceMappingURL=patch.d.ts.map