1 |
|
2 | import { Stats } from "fs-extra-p";
|
3 | export declare const MAX_FILE_REQUESTS = 8;
|
4 | export declare const CONCURRENCY: {
|
5 | concurrency: number;
|
6 | };
|
7 | export declare type FileTransformer = (path: string) => Promise<null | string | Buffer> | null | string | Buffer;
|
8 | export declare type Filter = (file: string, stat: Stats) => boolean;
|
9 | export declare function unlinkIfExists(file: string): Promise<string | void>;
|
10 | export declare function statOrNull(file: string): Promise<Stats | null>;
|
11 | export declare function exists(file: string): Promise<boolean>;
|
12 | export interface FileConsumer {
|
13 | consume(file: string, fileStat: Stats, parent: string, siblingNames: Array<string>): any;
|
14 | |
15 |
|
16 |
|
17 | isIncludeDir?: boolean;
|
18 | }
|
19 | export declare function walk(initialDirPath: string, filter?: Filter | null, consumer?: FileConsumer): Promise<Array<string>>;
|
20 | export declare function copyFile(src: string, dest: string, isEnsureDir?: boolean): Promise<any>;
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export declare function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: boolean): Promise<any>;
|
28 | export declare class FileCopier {
|
29 | private readonly isUseHardLinkFunction;
|
30 | private readonly transformer;
|
31 | isUseHardLink: boolean;
|
32 | constructor(isUseHardLinkFunction?: ((file: string) => boolean) | undefined, transformer?: FileTransformer | null | undefined);
|
33 | copy(src: string, dest: string, stat: Stats | undefined): Promise<void>;
|
34 | }
|
35 | /**
|
36 | * Empty directories is never created.
|
37 | * Hard links is used if supported and allowed.
|
38 | */
|
39 | export declare function copyDir(src: string, destination: string, filter?: Filter | null, transformer?: FileTransformer | null, isUseHardLink?: (file: string) => boolean): Promise<any>;
|
40 | export declare const DO_NOT_USE_HARD_LINKS: (file: string) => boolean;
|
41 | export interface Link {
|
42 | readonly link: string;
|
43 | readonly file: string;
|
44 | }
|