export declare type $DiffKey = T extends U ? never : T; export declare type $Diff = Pick>; export declare type $Optional = { [P in keyof T]?: T[P]; }; export declare type $PartialOptional = $Diff & $Optional; export declare type FileId = string; export interface FileRef { readonly id: FileId; readonly path: string; } export interface SourceReader { read(file: FileRef): Promise; } export interface SourceWriter { write(file: FileRef, source: string): Promise; } export interface SourceRemover { delete(file: FileRef): Promise; } export interface DocumentRef { getFile(): FileRef; getDoc(): DocumentEntity; detach(): void; move(newFile: FileRef): Promise; commit(): Promise; } export interface TransformOptions { from: string; to: string; } export interface Formatter { format(filePath: string, code: string): Promise; } export interface DocumentEntityCreateOptions { projectRoot: string; fileRef: FileRef; fileMappingOptions?: FileMappingOptions; formatter?: Formatter; } export interface DocumentEntity { readonly fileRef: FileRef; readonly isDirty: boolean; reader: SourceReader; writer: SourceWriter; parse(): Promise; transformPreceding(to: string): this; transformFollowing(opt: TransformOptions): this; flush(force?: boolean): Promise; move(newFile: FileRef): Promise; } export declare type RootImportConfig = { rootPathSuffix?: string; rootPathPrefix?: string; }; export declare type FileMappingOptions = { rootImport?: RootImportConfig[]; normalizeRootImport?: boolean; }; export declare type FindQuery = { start: string; }; export interface Project { getProjectDir(): string; getFileMappingOptions(): FileMappingOptions; getDocumentsList(): Promise; findOne(fileId: FileId): Promise<{ found: DocumentRef | undefined; rest: DocumentRef[]; }>; find(query: FindQuery): Promise<{ found: DocumentRef[]; rest: DocumentRef[]; }>; commit(): Promise; } export declare type LogLevel = "verbose" | "info" | "silent"; export interface Logger { info(msg: string): this; warn(msg: string): this; error(msg: string | Error): this; verbose(msg: string, ...objects: any[]): this; }