UNPKG

1.62 kBTypeScriptView Raw
1import { CopyOptions, FingerprintOptions } from './options';
2export * from './ignore';
3export * from './options';
4/**
5 * File system utilities.
6 */
7export declare class FileSystem {
8 /**
9 * Copies an entire directory structure.
10 * @param srcDir Source directory
11 * @param destDir Destination directory
12 * @param options options
13 * @param rootDir Root directory to calculate exclusions from
14 */
15 static copyDirectory(srcDir: string, destDir: string, options?: CopyOptions, rootDir?: string): void;
16 /**
17 * Produces fingerprint based on the contents of a single file or an entire directory tree.
18 *
19 * The fingerprint will also include:
20 * 1. An extra string if defined in `options.extra`.
21 * 2. The set of exclude patterns, if defined in `options.exclude`
22 * 3. The symlink follow mode value.
23 *
24 * @param fileOrDirectory The directory or file to fingerprint
25 * @param options Fingerprinting options
26 */
27 static fingerprint(fileOrDirectory: string, options?: FingerprintOptions): string;
28 /**
29 * Checks whether a directory is empty
30 *
31 * @param dir The directory to check
32 */
33 static isEmpty(dir: string): boolean;
34 /**
35 * The real path of the system temp directory
36 */
37 static get tmpdir(): string;
38 /**
39 * Creates a unique temporary directory in the **system temp directory**.
40 *
41 * @param prefix A prefix for the directory name. Six random characters
42 * will be generated and appended behind this prefix.
43 */
44 static mkdtemp(prefix: string): string;
45 private static _tmpdir?;
46}