import { Options } from "fast-glob"; import * as micromatch from "micromatch"; import { AbstractScriptedFlushable } from "../../internal/common/AbstractScriptedFlushable"; import { RepoRef } from "../../operations/common/RepoId"; import { File, FileNonBlocking } from "../File"; import { FileStream, Project } from "../Project"; /** * Support for implementations of Project interface */ export declare abstract class AbstractProject extends AbstractScriptedFlushable implements Project { id: RepoRef; shouldCache: boolean; /** * Cached paths */ private cachedFiles; readonly cache: Record; get name(): string; protected constructor(id: RepoRef, shouldCache?: boolean); /** * Return the file, or reject with error * @param {string} path * @return {Promise} */ abstract findFile(path: string): Promise; abstract getFile(path: string): Promise; hasFile(path: string): Promise; abstract hasDirectory(path: string): Promise; abstract findFileSync(path: string): File; streamFiles(...globPatterns: string[]): FileStream; abstract streamFilesRaw(globPatterns: string[], opts: Options): FileStream; /** * Get files matching these patterns * @param {string[]} globPatterns * @return {Promise} */ getFiles(globPatterns?: string | string[]): Promise; /** * Subclasses can override this to optimize if they wish * @return {Promise} */ protected getFilesInternal(globPatterns: string[]): Promise; totalFileCount(): Promise; trackFile(f: FileNonBlocking): this; moveFile(oldPath: string, newPath: string): Promise; abstract makeExecutable(path: string): Promise; recordAddFile(path: string, content: string): this; recordDeleteFile(path: string): this; abstract addFileSync(path: string, content: string): void; abstract deleteDirectorySync(path: string): void; abstract deleteDirectory(path: string): Promise; add(f: File): Promise; abstract addFile(path: string, content: string): Promise; abstract addDirectory(path: string): Promise; abstract deleteFile(path: string): Promise; abstract deleteFileSync(path: string): void; abstract makeExecutableSync(path: string): void; abstract directoryExistsSync(path: string): boolean; abstract fileExistsSync(path: string): boolean; protected invalidateCache(): void; } /** * Return the files that match these glob patterns, including negative globs */ export declare function globMatchesWithin(files: File[], globPatterns?: string[], opts?: micromatch.Options): File[]; //# sourceMappingURL=AbstractProject.d.ts.map