/** * Lark CLI wrapper — thin subprocess interface to `lark-cli`. * * Auth is handled entirely by the CLI (`lark-cli auth login`). * This module only calls the CLI binary and parses JSON output. */ export declare function findLarkCli(): string; /** * Check lark-cli version meets minimum requirement. * Returns the version string, or throws if too old. */ export declare function checkLarkCliVersion(cliPath: string): string; export interface AuthStatus { appId: string; brand: string; identity: string; tokenStatus: "valid" | "needs_refresh" | "expired"; userOpenId: string; userName: string; expiresAt: string; refreshExpiresAt: string; scope: string; } export interface ApiResult { code: number; msg: string; data?: Record; [key: string]: unknown; } export interface CliOptions { cliPath?: string; timeout?: number; retries?: number; } export declare class LarkCli { private cli; private timeout; private retries; constructor(opts?: CliOptions); /** Run lark-cli and return parsed JSON. */ private run; /** Get current auth status. Throws if not logged in. */ status(): AuthStatus; /** Generic GET request. */ get(path: string, params?: Record): ApiResult | null; /** Generic PATCH request. */ patch(path: string, data: Record): ApiResult | null; /** Update a section by title using replace_range mode. */ updateSection(docId: string, sectionTitle: string, markdown: string): boolean; appendDoc(docId: string, markdown: string, imageDir?: string): boolean; /** Generic POST request. */ post(path: string, data?: Record): ApiResult | null; /** Create a doc via the CLI's built-in shortcut. */ createDoc(title: string, markdown: string, wikiSpace?: string, wikiNode?: string, imageDir?: string): { doc_id: string; url: string; boardTokens: string[]; } | null; /** Get all blocks in a document. Paginates with small page_size to avoid ENOBUFS. */ getBlocks(docId: string): Record[]; /** Delete a range of children from a block (batch_delete). Used for cleanup. */ deleteBlockChildrenTail(docId: string, parentBlockId: string, startIndex: number, endIndex: number): boolean; /** Insert block children at a given index. */ createBlockChildren(docId: string, parentBlockId: string, children: Record[], index: number): boolean; /** Insert block children and return the created blocks with their new IDs. */ createBlockChildrenEx(docId: string, parentBlockId: string, children: Record[], index: number): Record[] | null; /** Update text elements of a block. */ updateBlockElements(docId: string, blockId: string, elements: Record[]): boolean; /** Fetch a single block by ID. */ getBlock(docId: string, blockId: string): Record | null; /** PATCH a block with arbitrary payload. */ patchBlock(docId: string, blockId: string, payload: Record, timeout?: number): boolean; /** Replace doc content with new markdown. */ updateDoc(docId: string, markdown: string, imageDir?: string): { ok: boolean; boardTokens: string[]; }; /** * Overwrite a whiteboard with content. * @param format - "raw" for DSL JSON, "mermaid" for mermaid source */ updateWhiteboard(boardToken: string, content: string, format?: "raw" | "mermaid"): boolean; /** Query whiteboard content as raw DSL JSON. */ queryWhiteboard(boardToken: string): object | null; /** Fetch doc content as markdown. Parses JSON stdout from lark-cli. */ fetchDoc(docId: string): string | null; } //# sourceMappingURL=cli.d.ts.map