export interface FrontmatterDocument { /** The lines between the opening and closing `---`, without their line terminators. */ lines: string[]; /** Everything after the closing `---` line, verbatim (its leading newline included). */ body: string; /** The terminator the file uses, so the rewrite keeps it. */ newline: "\n" | "\r\n"; } /** Splits a markdown file into frontmatter lines and body; `undefined` when it has no frontmatter. */ export declare function splitFrontmatter(text: string): FrontmatterDocument | undefined; export declare function joinFrontmatter(doc: FrontmatterDocument): string; /** The index range `[start, end)` a top-level key occupies, including its indented continuation. */ export declare function keyRange(lines: readonly string[], key: string): [number, number] | undefined; /** The scalar on a key's own line, unquoted; `undefined` when absent or when the value is a block. */ export declare function scalarOf(lines: readonly string[], key: string): string | undefined; export declare function unquote(raw: string): string; /** Removes a top-level key and its continuation lines. */ export declare function removeKey(lines: string[], key: string): boolean; /** Replaces a top-level key (and its continuation) with the given lines. */ export declare function replaceKey(lines: string[], key: string, replacement: readonly string[]): boolean; /** * A key's value as a list of strings: an inline `[a, "b"]` flow sequence, a block sequence of `- item` * lines, or a single scalar (claude accepts a bare string for `paths`). `undefined` when absent. */ export declare function listOf(lines: readonly string[], key: string): string[] | undefined;