1 | # Installation
|
2 | > `npm install --save @types/ncp`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for ncp (https://github.com/AvianFlu/ncp).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ncp.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ncp/index.d.ts)
|
10 | ````ts
|
11 | /// <reference types="node" />
|
12 | import * as fs from "fs";
|
13 |
|
14 | declare namespace ncp {
|
15 | interface File {
|
16 | name: string;
|
17 | mode: number;
|
18 |
|
19 | /** Accessed time */
|
20 | atime: Date;
|
21 |
|
22 | /** Modified time */
|
23 | mtime: Date;
|
24 | }
|
25 |
|
26 | interface Options {
|
27 | filter?: RegExp | ((filename: string) => boolean) | undefined;
|
28 | transform?: ((read: NodeJS.ReadableStream, write: NodeJS.WritableStream, file: File) => void) | undefined;
|
29 | clobber?: boolean | undefined;
|
30 | dereference?: boolean | undefined;
|
31 | stopOnErr?: boolean | undefined;
|
32 | errs?: fs.PathLike | undefined;
|
33 | limit?: number | undefined;
|
34 | }
|
35 | }
|
36 |
|
37 | declare const ncp: {
|
38 | (source: string, destination: string, callback: (err: Error[] | null) => void): void;
|
39 | (
|
40 | source: string,
|
41 | destination: string,
|
42 | options: ncp.Options & { stopOnErr: true },
|
43 | callback: (err: Error | null) => void,
|
44 | ): void;
|
45 | (
|
46 | source: string,
|
47 | destination: string,
|
48 | options: ncp.Options & { errs?: undefined },
|
49 | callback: (err: Error[] | null) => void,
|
50 | ): void;
|
51 | (
|
52 | source: string,
|
53 | destination: string,
|
54 | options: ncp.Options & { errs: fs.PathLike },
|
55 | callback: (err: fs.WriteStream | null) => void,
|
56 | ): void;
|
57 | (
|
58 | source: string,
|
59 | destination: string,
|
60 | options: ncp.Options,
|
61 | callback: (err: Error | Error[] | fs.WriteStream | null) => void,
|
62 | ): void;
|
63 |
|
64 | ncp: typeof ncp;
|
65 |
|
66 | /**
|
67 | * **NOTE:** This function provides design-time support for util.promisify.
|
68 | *
|
69 | * It does not exist at runtime.
|
70 | */
|
71 | __promisify__(source: string, destination: string, options?: ncp.Options): Promise<void>;
|
72 | };
|
73 |
|
74 | export = ncp;
|
75 |
|
76 | ````
|
77 |
|
78 | ### Additional Details
|
79 | * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
|
80 | * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
81 |
|
82 | # Credits
|
83 | These definitions were written by [Bart van der Schoor](https://github.com/bartvds), [Benoit Lemaire](https://github.com/belemaire), and [ExE Boss](https://github.com/ExE-Boss).
|
84 |
|
\ | No newline at end of file |