UNPKG

2.4 kBTypeScriptView Raw
1import { RepoRef } from "../../operations/common/RepoId";
2import { File } from "../File";
3import { FileStream, Project } from "../Project";
4import { AbstractProject } from "../support/AbstractProject";
5import { LocalProject, ReleaseFunction } from "./LocalProject";
6export declare class NodeFsLocalProject extends AbstractProject implements LocalProject {
7 private cleanup;
8 /**
9 * Create a project from an existing directory. The directory must exist
10 * @param {RepoRef} id
11 * @param {string} baseDir
12 * @param cleanup
13 * @return {Promise<LocalProject>}
14 */
15 static fromExistingDirectory(id: RepoRef, baseDir: string, cleanup?: ReleaseFunction): Promise<LocalProject>;
16 /**
17 * Copy the contents of the other project to this project
18 * @param {Project} other
19 * @param {string} baseDir
20 * @param newName new name of the project. Defaults to name of old project
21 * @param cleanup
22 * @returns {LocalProject}
23 */
24 static copy(other: Project, baseDir: string, cleanup?: ReleaseFunction): Promise<LocalProject>;
25 /**
26 * Base directory of the project on the local file system
27 */
28 readonly baseDir: string;
29 /**
30 * Note: this does not validate existence of the target
31 * directory, so using it except in tests should be avoided
32 * @param {RepoRef} ident identification of the repo
33 * @param {string} baseDir
34 * @param cleanup function that will release locks, delete temp directories etc
35 */
36 constructor(ident: RepoRef | string, baseDir: string, cleanup?: ReleaseFunction);
37 release(): Promise<void>;
38 addFileSync(path: string, content: string): void;
39 addFile(path: string, content: string): Promise<this>;
40 addDirectory(path: string): Promise<this>;
41 deleteDirectory(path: string): Promise<this>;
42 deleteDirectorySync(path: string): void;
43 deleteFileSync(path: string): void;
44 deleteFile(path: string): Promise<this>;
45 makeExecutable(path: string): Promise<this>;
46 makeExecutableSync(path: string): void;
47 directoryExistsSync(path: string): boolean;
48 fileExistsSync(path: string): boolean;
49 findFile(path: string): Promise<File>;
50 getFile(path: string): Promise<File>;
51 findFileSync(path: string): File;
52 streamFilesRaw(globPatterns: string[], opts: {}): FileStream;
53 private toRealPath;
54}
55//# sourceMappingURL=NodeFsLocalProject.d.ts.map
\No newline at end of file