import { OffsetRange } from "../ranges/offsetRange.js";
import { BaseEdit, BaseReplacement } from "./edit.js";
export declare class StringEdit extends BaseEdit<StringReplacement, StringEdit> {
    static readonly empty: StringEdit;
    static create(replacements: readonly StringReplacement[]): StringEdit;
    static single(replacement: StringReplacement): StringEdit;
    static replace(range: OffsetRange, replacement: string): StringEdit;
    static insert(offset: number, replacement: string): StringEdit;
    static delete(range: OffsetRange): StringEdit;
    static fromJson(data: ISerializedStringEdit): StringEdit;
    static compose(edits: readonly StringEdit[]): StringEdit;
    constructor(replacements: readonly StringReplacement[]);
    protected _createNew(replacements: readonly StringReplacement[]): StringEdit;
    apply(base: string): string;
    inverse(baseStr: string): StringEdit;
    tryRebase(base: StringEdit): StringEdit;
    tryRebase(base: StringEdit, noOverlap: true): StringEdit | undefined;
    toJson(): ISerializedStringEdit;
    isNeutralOn(text: string): boolean;
    removeCommonSuffixPrefix(originalText: string): StringEdit;
}
export type ISerializedStringEdit = ISerializedStringReplacement[];
export interface ISerializedStringReplacement {
    txt: string;
    pos: number;
    len: number;
}
export declare class StringReplacement extends BaseReplacement<StringReplacement> {
    readonly newText: string;
    static insert(offset: number, text: string): StringReplacement;
    static replace(range: OffsetRange, text: string): StringReplacement;
    static fromJson(data: ISerializedStringReplacement): StringReplacement;
    constructor(range: OffsetRange, newText: string);
    equals(other: StringReplacement): boolean;
    getNewLength(): number;
    tryJoinTouching(other: StringReplacement): StringReplacement | undefined;
    slice(range: OffsetRange, rangeInReplacement: OffsetRange): StringReplacement;
    toString(): string;
    replace(str: string): string;
    isNeutralOn(text: string): boolean;
    removeCommonSuffixPrefix(originalText: string): StringReplacement;
}
export declare function applyEditsToRanges(sortedRanges: OffsetRange[], edit: StringEdit): OffsetRange[];
