export interface ViewCommand {
    command: 'view';
    path: string;
    view_range?: [number, number];
}
export interface CreateCommand {
    command: 'create';
    path: string;
    file_text: string;
}
export interface StrReplaceCommand {
    command: 'str_replace';
    path: string;
    old_str: string;
    new_str: string;
}
export interface InsertCommand {
    command: 'insert';
    path: string;
    insert_line: number;
    insert_text: string;
}
export interface BatchStrReplaceCommand {
    command: 'batch_str_replace';
    path: string;
    replacements: StrReplacement[];
}
export type TextEditorCommand = ViewCommand | CreateCommand | StrReplaceCommand | InsertCommand;
export type TextEditorCommandWithBatch = TextEditorCommand | BatchStrReplaceCommand;
export interface TextEditorToolCall {
    name: 'str_replace_based_edit_tool';
    args: TextEditorCommand;
    id: string;
}
export interface TextEditorResult {
    content: string;
}
export declare class NoMatchFoundError extends Error {
    constructor(_searchStr: string, nearMatchContext?: string);
}
export declare class MultipleMatchesError extends Error {
    constructor(count: number);
}
export declare class InvalidLineNumberError extends Error {
    constructor(line: number, maxLine: number);
}
export declare class InvalidViewRangeError extends Error {
    constructor(start: number, end: number, maxLine: number);
}
export declare class InvalidPathError extends Error {
    constructor(path: string, supportedPath?: string, message?: string);
}
export declare class FileExistsError extends Error {
    constructor();
}
export declare class FileNotFoundError extends Error {
    constructor(message?: string);
}
export interface StrReplacement {
    old_str: string;
    new_str: string;
}
export interface BatchReplaceResult {
    index: number;
    old_str: string;
    status: 'success' | 'failed' | 'not_attempted';
    error?: string;
}
export declare class BatchReplacementError extends Error {
    readonly failedIndex: number;
    readonly totalCount: number;
    readonly cause: NoMatchFoundError | MultipleMatchesError;
    constructor(failedIndex: number, totalCount: number, cause: NoMatchFoundError | MultipleMatchesError);
}
export interface TextEditorDocumentOptions {
    initialText?: string | null;
    supportedPath?: string;
    createInvalidPathMessage?: (path: string, supportedPath: string) => string;
    invalidPathMessage?: (path: string, supportedPath: string) => string;
    fileNotFoundMessage?: string;
}
export declare function formatTextWithLineNumbers(text: string): string;
export declare function findDivergenceContext(code: string, searchStr: string): string | undefined;
export declare function parseStrReplacements(raw: unknown): StrReplacement[];
export declare class TextEditorDocument {
    private text;
    private readonly options;
    constructor(options?: TextEditorDocumentOptions);
    execute(command: TextEditorCommand): string;
    executeBatch(replacements: StrReplacement[]): string | BatchReplaceResult[];
    getText(): string | null;
    setText(text: string): void;
    hasText(): boolean;
    clearText(): void;
    private validateCreatePath;
    private validatePath;
    private handleView;
    private handleCreate;
    private handleStrReplace;
    private handleInsert;
    private countOccurrences;
    private appendNotAttemptedResults;
    private createFileNotFoundError;
    private escapeReplacement;
}
