/** * Image handling — download remote images, upload to Feishu drive, embed in doc blocks. * * Uses lark-cli for: * - drive +upload (single-shot, ≤20MB) * - docx API for inserting image blocks */ import type { LarkCli } from "../cli.js"; export interface ImageRef { /** Full match text (for replacement) */ fullMatch: string; /** Original URL */ url: string; /** Alt text / caption */ alt: string; /** Line number (0-based) */ line: number; /** Is HTML tag (vs markdown ![alt](url)) */ isHtml: boolean; } export interface ImageProcessResult { markdown: string; downloaded: number; uploaded: number; failed: number; errors: string[]; } /** * Download an image from URL to a temp file. * Returns local file path. Throws on failure. */ export declare function downloadImage(url: string, filename?: string): string; /** * Upload a local image file to Feishu drive via lark-cli. * Returns the file_token on success. */ export declare function uploadImage(localPath: string): string; /** * Insert an image block into a document via lark-cli API. */ export declare function insertImageBlock(cli: LarkCli, docId: string, fileToken: string, width?: number, height?: number): boolean; /** * Extract all image references from markdown. */ export declare function extractImageRefs(mdText: string): ImageRef[]; /** * Process all images in markdown: download → upload → insert blocks. * * Images are downloaded, uploaded to Feishu, and inserted as blocks * into the document. The markdown is updated to remove the image * references (since they're now embedded as blocks). */ export declare function processImages(cli: LarkCli, mdText: string, docId: string): ImageProcessResult; /** * Process images from a local directory. * Scans for ![alt](relative/path.png) references and resolves them. */ export declare function processLocalImages(cli: LarkCli, mdText: string, docId: string, imageDir: string): ImageProcessResult; //# sourceMappingURL=images.d.ts.map