Files
DefinitelyTyped/ncp/ncp.d.ts
Tobias Kahlert d6f0ad10bf added defs for a filter function to the options (#10975)
As described in https://github.com/AvianFlu/ncp the option.filter-property also takes a function,
that takes a filename and returns a Boolean signalling, if the given file should be copied or not.
2016-09-06 23:51:59 +09:00

20 lines
727 B
TypeScript

// Type definitions for ncp v0.5.1
// Project: https://github.com/AvianFlu/ncp
// Definitions by: Bart van der Schoor <https://github.com/bartvds/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'ncp' {
function ncp (source: string, destination: string, callback: (err: Error) => void): void;
function ncp (source: string, destination: string, options: Options, callback: (err: Error) => void): void;
interface Options {
filter? : RegExp | ((filename: string) => boolean);
transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void;
clobber? : boolean;
stopOnErr? : boolean;
errs? : NodeJS.WritableStream;
}
}