import { OffsetRange } from "../ranges/offsetRange.js";
export declare abstract class BaseEdit<T extends BaseReplacement<T>, TEdit extends BaseEdit<T, TEdit>> {
    readonly replacements: readonly T[];
    constructor(replacements: readonly T[]);
    protected abstract _createNew(replacements: readonly T[]): TEdit;
    equals(other: TEdit): boolean;
    toString(): string;
    normalize(): TEdit;
    compose(other: TEdit): TEdit;
    getNewRanges(): OffsetRange[];
    getJoinedReplaceRange(): OffsetRange | undefined;
    isEmpty(): boolean;
    getLengthDelta(): number;
    getNewDataLength(dataLength: number): number;
    applyToOffset(originalOffset: number): number;
    applyToOffsetRange(originalRange: OffsetRange): OffsetRange;
    applyInverseToOffset(postEditsOffset: number): number;
}
export declare abstract class BaseReplacement<TSelf extends BaseReplacement<TSelf>> {
    readonly replaceRange: OffsetRange;
    constructor(replaceRange: OffsetRange);
    abstract getNewLength(): number;
    abstract tryJoinTouching(other: TSelf): TSelf | undefined;
    abstract slice(newReplaceRange: OffsetRange, rangeInReplacement: OffsetRange): TSelf;
    delta(offset: number): TSelf;
    getLengthDelta(): number;
    abstract equals(other: TSelf): boolean;
    toString(): string;
    get isEmpty(): boolean;
    getRangeAfterReplace(): OffsetRange;
}
export type AnyEdit = BaseEdit<AnyReplacement, AnyEdit>;
export type AnyReplacement = BaseReplacement<AnyReplacement>;
export declare class Edit<T extends BaseReplacement<T>> extends BaseEdit<T, Edit<T>> {
    static readonly empty: Edit<never>;
    static create<T extends BaseReplacement<T>>(replacements: readonly T[]): Edit<T>;
    static single<T extends BaseReplacement<T>>(replacement: T): Edit<T>;
    protected _createNew(replacements: readonly T[]): Edit<T>;
}
export declare class AnnotationReplacement<TAnnotation> extends BaseReplacement<AnnotationReplacement<TAnnotation>> {
    readonly newLength: number;
    readonly annotation: TAnnotation;
    constructor(range: OffsetRange, newLength: number, annotation: TAnnotation);
    equals(other: AnnotationReplacement<TAnnotation>): boolean;
    getNewLength(): number;
    tryJoinTouching(other: AnnotationReplacement<TAnnotation>): AnnotationReplacement<TAnnotation> | undefined;
    slice(range: OffsetRange, rangeInReplacement: OffsetRange): AnnotationReplacement<TAnnotation>;
}
