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 | // Type definitions for ncp 2.0
|
12 | // Project: https://github.com/AvianFlu/ncp
|
13 | // Definitions by: Bart van der Schoor <https://github.com/bartvds>
|
14 | // Benoit Lemaire <https://github.com/belemaire>
|
15 | // ExE Boss <https://github.com/ExE-Boss>
|
16 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
17 |
|
18 | /// <reference types="node" />
|
19 | import * as fs from 'fs';
|
20 |
|
21 | declare namespace ncp {
|
22 | interface File {
|
23 | name: string;
|
24 | mode: number;
|
25 |
|
26 | /** Accessed time */
|
27 | atime: Date;
|
28 |
|
29 | /** Modified time */
|
30 | mtime: Date;
|
31 | }
|
32 |
|
33 | interface Options {
|
34 | filter?: RegExp | ((filename: string) => boolean) | undefined;
|
35 | transform?: ((read: NodeJS.ReadableStream, write: NodeJS.WritableStream, file: File) => void) | undefined;
|
36 | clobber?: boolean | undefined;
|
37 | dereference?: boolean | undefined;
|
38 | stopOnErr?: boolean | undefined;
|
39 | errs?: fs.PathLike | undefined;
|
40 | limit?: number | undefined;
|
41 | }
|
42 | }
|
43 |
|
44 | declare const ncp: {
|
45 | (source: string, destination: string, callback: (err: Error[] | null) => void): void;
|
46 | (
|
47 | source: string,
|
48 | destination: string,
|
49 | options: ncp.Options & { stopOnErr: true },
|
50 | callback: (err: Error | null) => void,
|
51 | ): void;
|
52 | (
|
53 | source: string,
|
54 | destination: string,
|
55 | options: ncp.Options & { errs?: undefined },
|
56 | callback: (err: Error[] | null) => void,
|
57 | ): void;
|
58 | (
|
59 | source: string,
|
60 | destination: string,
|
61 | options: ncp.Options & { errs: fs.PathLike },
|
62 | callback: (err: fs.WriteStream | null) => void,
|
63 | ): void;
|
64 | (
|
65 | source: string,
|
66 | destination: string,
|
67 | options: ncp.Options,
|
68 | callback: (err: Error | Error[] | fs.WriteStream | null) => void,
|
69 | ): void;
|
70 |
|
71 | ncp: typeof ncp;
|
72 |
|
73 | /**
|
74 | * **NOTE:** This function provides design-time support for util.promisify.
|
75 | *
|
76 | * It does not exist at runtime.
|
77 | */
|
78 | __promisify__(source: string, destination: string, options?: ncp.Options): Promise<void>;
|
79 | };
|
80 |
|
81 | export = ncp;
|
82 |
|
83 | ````
|
84 |
|
85 | ### Additional Details
|
86 | * Last updated: Wed, 07 Jul 2021 00:01:46 GMT
|
87 | * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
88 | * Global values: none
|
89 |
|
90 | # Credits
|
91 | 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).
|
92 |
|
\ | No newline at end of file |