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