mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
72 lines
2.0 KiB
TypeScript
72 lines
2.0 KiB
TypeScript
// Type definitions for ncp 2.0
|
|
// Project: https://github.com/AvianFlu/ncp
|
|
// Definitions by: Bart van der Schoor <https://github.com/bartvds>
|
|
// Benoit Lemaire <https://github.com/belemaire>
|
|
// ExE Boss <https://github.com/ExE-Boss>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
import * as fs from 'fs';
|
|
|
|
declare namespace ncp {
|
|
interface File {
|
|
name: string;
|
|
mode: number;
|
|
|
|
/** Accessed time */
|
|
atime: Date;
|
|
|
|
/** Modified time */
|
|
mtime: Date;
|
|
}
|
|
|
|
interface Options {
|
|
filter?: RegExp | ((filename: string) => boolean);
|
|
transform?: (read: NodeJS.ReadableStream, write: NodeJS.WritableStream, file: File) => void;
|
|
clobber?: boolean;
|
|
dereference?: boolean;
|
|
stopOnErr?: boolean;
|
|
errs?: fs.PathLike;
|
|
limit?: number;
|
|
}
|
|
}
|
|
|
|
declare const ncp: {
|
|
(source: string, destination: string, callback: (err: Error[] | null) => void): void;
|
|
(
|
|
source: string,
|
|
destination: string,
|
|
options: ncp.Options & { stopOnErr: true },
|
|
callback: (err: Error | null) => void,
|
|
): void;
|
|
(
|
|
source: string,
|
|
destination: string,
|
|
options: ncp.Options & { errs?: undefined },
|
|
callback: (err: Error[] | null) => void,
|
|
): void;
|
|
(
|
|
source: string,
|
|
destination: string,
|
|
options: ncp.Options & { errs: fs.PathLike },
|
|
callback: (err: fs.WriteStream | null) => void,
|
|
): void;
|
|
(
|
|
source: string,
|
|
destination: string,
|
|
options: ncp.Options,
|
|
callback: (err: Error | Error[] | fs.WriteStream | null) => void,
|
|
): void;
|
|
|
|
ncp: typeof ncp;
|
|
|
|
/**
|
|
* **NOTE:** This function provides design-time support for util.promisify.
|
|
*
|
|
* It does not exist at runtime.
|
|
*/
|
|
__promisify__(source: string, destination: string, options?: ncp.Options): Promise<void>;
|
|
};
|
|
|
|
export = ncp;
|