/** * Error class for base errors */ export declare class BaseError extends Error { context: string; constructor(message: string, context?: string); toJSON(): { name: string; message: string; context: string; }; } /** * Error class for file operation errors */ export declare class FileOperationError extends BaseError { filePath: string; constructor(filePath: string, message: string, context?: string); toJSON(): { filePath: string; name: 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; name: 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; } /** * Applies a patch/diff to files in the file system using Aider's implementation * @param patchString The patch/diff string to apply * @param options Configuration options including basePath and dryRun flag * @returns A result object with details about the application */ export declare function applyPatchToFiles(patchString: string, options: { basePath: string; dryRun?: boolean; }): ApplyDiffResult; export { findDiffs } from './aider_udiff'; export { applyHunks } from './apply_hunk';