1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import * as fs from 'fs';
|
10 |
|
11 | declare namespace ncp {
|
12 | interface File {
|
13 | name: string;
|
14 | mode: number;
|
15 |
|
16 |
|
17 | atime: Date;
|
18 |
|
19 |
|
20 | mtime: Date;
|
21 | }
|
22 |
|
23 | interface Options {
|
24 | filter?: RegExp | ((filename: string) => boolean) | undefined;
|
25 | transform?: ((read: NodeJS.ReadableStream, write: NodeJS.WritableStream, file: File) => void) | undefined;
|
26 | clobber?: boolean | undefined;
|
27 | dereference?: boolean | undefined;
|
28 | stopOnErr?: boolean | undefined;
|
29 | errs?: fs.PathLike | undefined;
|
30 | limit?: number | undefined;
|
31 | }
|
32 | }
|
33 |
|
34 | declare const ncp: {
|
35 | (source: string, destination: string, callback: (err: Error[] | null) => void): void;
|
36 | (
|
37 | source: string,
|
38 | destination: string,
|
39 | options: ncp.Options & { stopOnErr: true },
|
40 | callback: (err: Error | null) => void,
|
41 | ): void;
|
42 | (
|
43 | source: string,
|
44 | destination: string,
|
45 | options: ncp.Options & { errs?: undefined },
|
46 | callback: (err: Error[] | null) => void,
|
47 | ): void;
|
48 | (
|
49 | source: string,
|
50 | destination: string,
|
51 | options: ncp.Options & { errs: fs.PathLike },
|
52 | callback: (err: fs.WriteStream | null) => void,
|
53 | ): void;
|
54 | (
|
55 | source: string,
|
56 | destination: string,
|
57 | options: ncp.Options,
|
58 | callback: (err: Error | Error[] | fs.WriteStream | null) => void,
|
59 | ): void;
|
60 |
|
61 | ncp: typeof ncp;
|
62 |
|
63 | /**
|
64 | * **NOTE:** This function provides design-time support for util.promisify.
|
65 | *
|
66 | * It does not exist at runtime.
|
67 | */
|
68 | __promisify__(source: string, destination: string, options?: ncp.Options): Promise<void>;
|
69 | };
|
70 |
|
71 | export = ncp;
|
72 |
|
\ | No newline at end of file |