import { EditFileInput, EditFileConfig, EditFileResult, ApplyEditInput, ApplyEditConfig, ApplyEditResult } from './types.js'; import { MorphAPIClient } from '../../core/client.js'; import { APIResource } from '../../core/resource.js'; export { FastApplyAnchorIntegrityError, FastApplyContextLengthError, applyEdit, callMorphAPI, countChanges, generateUdiff } from './apply.js'; import '../utils/resilience.js'; /** * FastApply client for programmatic file editing * Note: This client requires Node.js for file operations * * @deprecated Prefer the unified `MorphClient` (`new MorphClient({ apiKey }).fastApply`). * Standalone clients remain only for backwards compatibility and may be removed in a future * major version — do not use them in new code. */ declare class FastApplyClient extends APIResource { private config; constructor(clientOrConfig?: MorphAPIClient | { 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): Promise; /** * 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): Promise; } /** * Execute a file edit using Morph Fast Apply * Note: This function requires Node.js for file I/O */ declare function executeEditFile(input: EditFileInput, config?: EditFileConfig): Promise; export { FastApplyClient, executeEditFile };