import * as Diff from 'diff'; import { BaseError } from '../vanilla_diff_patch/errors'; /** * Error class for file operation errors */ export declare class FileOperationError extends BaseError { filePath: string; constructor(filePath: string, message: string, context?: string); toJSON(): { filePath: string; error: string; message: string; context: string; }; } /** * Error class for when a patch cannot be applied */ export declare class PatchApplicationError extends BaseError { filePath: string; hunkIndex: number; constructor(filePath: string, hunkIndex: number, message: string, context?: string); toJSON(): { filePath: string; hunkIndex: number; error: string; message: string; context: string; }; } /** * Result object for a single file diff application */ export interface FileDiffResult { oldFileName: string; newFileName: string; totalHunks: number; appliedHunks: number; failedHunks: number; errors: BaseError[]; success: boolean; } /** * Final result object for the entire diff application */ export interface ApplyDiffResult { totalFiles: number; successfulFiles: number; failedFiles: number; totalHunks: number; appliedHunks: number; failedHunks: number; fileResults: FileDiffResult[]; errors: BaseError[]; success: boolean; } /** * Options for applying a diff */ export interface ApplyDiffOptions { basePath?: string; dryRun?: boolean; jsDiffApplyPatchOptions?: Diff.ApplyPatchOptions; minContextLines?: number; } /** * Applies a patch/diff to files in the file system * @param patchString The patch/diff string to apply * @param options Configuration options including basePath, dryRun flag, and jsDiffApplyPatchOptions * @returns A result object with details about the application */ export declare function applyPatchToFiles(patchString: string, options: { basePath: string; dryRun?: boolean; jsDiffApplyPatchOptions?: Diff.ApplyPatchOptions; minContextLines?: number; }): ApplyDiffResult;