UNPKG

2.17 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/cpx`
3
4# Summary
5This package contains type definitions for cpx (https://github.com/mysticatea/cpx).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cpx.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cpx/index.d.ts)
10````ts
11/// <reference types="node" />
12
13import { EventEmitter } from "events";
14import * as stream from "stream";
15
16export interface SyncOptions {
17 /** remove files that copied on past before copy. */
18 clean?: boolean | undefined;
19 /** Follow symbolic links when copying from them. */
20 dereference?: boolean | undefined;
21 /** Copy empty directories which is matched with the glob. */
22 includeEmptyDirs?: boolean | undefined;
23 /** Preserve UID, GID, ATIME, and MTIME of files. */
24 preserve?: boolean | undefined;
25 /** Do not overwrite files on destination if the source file is older. */
26 update?: boolean | undefined;
27}
28
29export interface AsyncOptions extends SyncOptions {
30 /** Function that creates a `stream.Transform` object to transform each copying file. */
31 transform?(filepath: string): stream.Transform[];
32}
33
34export interface WatchOptions extends AsyncOptions, SyncOptions {
35 /** Flag to not copy at the initial time of watch. */
36 initialCopy?: boolean | undefined;
37}
38
39export class Watcher extends EventEmitter {
40 constructor(options: WatchOptions);
41 open(): void;
42 close(): void;
43}
44
45export function copy(
46 source: string,
47 dest: string,
48 options?: AsyncOptions,
49 callback?: (error: Error | null) => void,
50): void;
51export function copy(source: string, dest: string, callback?: (error: Error | null) => void): void;
52
53export function copySync(source: string, dest: string, options?: SyncOptions): void;
54
55export function watch(source: string, dest: string, options?: WatchOptions): Watcher;
56
57````
58
59### Additional Details
60 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
61 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
62
63# Credits
64These definitions were written by [Alan Agius](https://github.com/alan-agius4).
65
\No newline at end of file