import { FileRef, SourceWriter, Formatter } from "../types"; import { SourceReplacement } from "../functions"; export declare type OriginalSourceLocation = { isOrigin: true; node: T; }; export declare type SourceLocation = { isOrigin: false; node: SourceLocation | OriginalSourceLocation; }; export interface Mutation { location: OriginalSourceLocation | SourceLocation; replacement: T; replacementText: string; } export declare abstract class AstDocumentEntity { protected _fref: FileRef; protected _uncommitedMutations: Mutation[]; protected _formatter: Formatter; abstract writer: SourceWriter; abstract readonly sourceText: string | undefined; abstract clear(): this; abstract getReplacements(): SourceReplacement[]; constructor({ fileRef, formatter }: { fileRef: FileRef; formatter: Formatter; }); flush(force?: boolean): Promise; move(newFile: FileRef): Promise; protected _updateMutations(before: T, after: T, replacementText: string, isOrigin: (node: T) => boolean): void; }