import type { ChunkRequiredSignal, DeleteResult, SectionWriteResult, WriteReceipt } from "./types.js"; /** * Create a new document with format-appropriate content scaffolding. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param title - Document title. * @param metadata - Optional metadata for frontmatter. * @param initialContent - Optional custom initial content (overrides scaffolding). * @returns Write receipt with verification data. */ export declare function createDocument(projectRoot: string, filePath: string, title: string, metadata?: Record, initialContent?: string): Promise; /** * Write (replace) the body of a section identified by heading. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param heading - Heading text to find. * @param body - New body content. * @param expectedHash - Optional stale-file detection hash. * @returns Section write result or chunk-required signal. */ export declare function writeSectionBody(projectRoot: string, filePath: string, heading: string, body: string, expectedHash?: string): Promise; /** * Upsert a section: replace if heading exists, create if absent. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param heading - Heading text. * @param body - Section body content. * @param level - Heading level for creation (default 2). * @param expectedHash - Optional stale-file detection hash. * @returns Section write result. */ export declare function upsertSection(projectRoot: string, filePath: string, heading: string, body: string, level?: number, expectedHash?: string): Promise; /** * Append content to the end of an existing section body. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param heading - Heading text. * @param content - Content to append. * @param expectedHash - Optional stale-file detection hash. * @returns Section write result. */ export declare function appendSection(projectRoot: string, filePath: string, heading: string, content: string, expectedHash?: string): Promise; /** * Insert a new section after a target heading. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param afterHeading - Target heading to insert after. * @param newHeading - New heading text. * @param level - Heading level for the new section. * @param body - New section body. * @param expectedHash - Optional stale-file detection hash. * @returns Section write result. */ export declare function insertSection(projectRoot: string, filePath: string, afterHeading: string, newHeading: string, level: number, body: string, expectedHash?: string): Promise; /** * Delete a section (heading + body) from a document. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param heading - Heading text to remove. * @returns Delete result. */ export declare function deleteSection(projectRoot: string, filePath: string, heading: string): Promise; /** * Delete an entire file. * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @returns Delete result. */ export declare function deleteFile(projectRoot: string, filePath: string): Promise; /** * Search and replace in document body (preserving headings and frontmatter). * * @param projectRoot - Trusted project root. * @param filePath - Project-root-relative file path. * @param searchPattern - Search string or regex pattern. * @param replacement - Replacement text. * @returns Section write result. */ export declare function searchAndReplace(projectRoot: string, filePath: string, searchPattern: string, replacement: string): Promise; /** * Find the line range of a section identified by heading. * Returns { startLine, endLine } (1-based) or null. */ export declare function findSectionRange(content: string, heading: string): { startLine: number; endLine: number; } | null; /** * Patch (replace) the body of a section identified by heading. * Returns new content string, or original content if heading not found. */ export declare function patchSectionBody(content: string, heading: string, body: string): string; //# sourceMappingURL=write-ops.d.ts.map