import { EditFileInput, EditFileConfig, EditFileResult, ApplyEditInput, ApplyEditConfig, ApplyEditResult, EditChanges } from './types.js';
import '../utils/resilience.js';

/**
 * Core implementation of Morph Fast Apply
 */

/**
 * FastApply client for programmatic file editing
 */
declare class FastApplyClient {
    private config;
    constructor(config?: {
        apiKey?: string;
        debug?: boolean;
        timeout?: number;
        retryConfig?: any;
    });
    /**
     * Execute a file edit operation
     *
     * @param input - Edit parameters including filepath, instructions, and code_edit
     * @param overrides - Optional config overrides for this operation
     * @returns Edit result with success status and changes
     */
    execute(input: EditFileInput, overrides?: Partial<EditFileConfig>): Promise<EditFileResult>;
    /**
     * Apply an edit to code directly without file I/O
     *
     * Useful for sandbox environments or when you manage your own file system.
     * Compatible with the earlier OpenAI client API contract.
     *
     * @param input - Code and edit parameters
     * @param overrides - Optional config overrides for this operation
     * @returns Result with merged code
     *
     * @example
     * ```typescript
     * const result = await client.applyEdit({
     *   originalCode: 'function hello() { return "world"; }',
     *   codeEdit: 'function hello() { return "universe"; }',
     *   instructions: 'Change return value'
     * });
     * console.log(result.mergedCode);
     * ```
     */
    applyEdit(input: ApplyEditInput, overrides?: Partial<ApplyEditConfig>): Promise<ApplyEditResult>;
}
/**
 * Generate a unified diff between two strings
 */
declare function generateUdiff(original: string, modified: string, filepath: string): string;
/**
 * Count changes from a unified diff
 */
declare function countChanges(original: string, modified: string): EditChanges;
/**
 * Execute a file edit using Morph Fast Apply
 */
declare function executeEditFile(input: EditFileInput, config?: EditFileConfig): Promise<EditFileResult>;
/**
 * Apply an edit to code directly without file I/O
 *
 * This is the code-in/code-out API that accepts code content directly
 * and returns the merged result without reading or writing any files.
 *
 * @param input - Code and edit parameters
 * @param config - Optional configuration
 * @returns Result with merged code
 *
 * @example
 * ```typescript
 * import { applyEdit } from '@morphllm/morphsdk';
 *
 * const result = await applyEdit({
 *   originalCode: fs.readFileSync('file.ts', 'utf-8'),
 *   codeEdit: '// ... existing code ...\nconst newVar = 42;\n// ... existing code ...',
 *   instructions: 'Add a new variable',
 *   filepath: 'file.ts' // optional, for udiff context
 * });
 *
 * if (result.success) {
 *   fs.writeFileSync('file.ts', result.mergedCode);
 * }
 * ```
 */
declare function applyEdit(input: ApplyEditInput, config?: ApplyEditConfig): Promise<ApplyEditResult>;

export { FastApplyClient, applyEdit, countChanges, executeEditFile, generateUdiff };
