mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-27 06:22:55 +08:00
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.
20 lines
727 B
TypeScript
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;
|
|
}
|
|
}
|