diff --git a/ncp/ncp-tests.ts b/ncp/ncp-tests.ts new file mode 100644 index 0000000000..f1ce04c21e --- /dev/null +++ b/ncp/ncp-tests.ts @@ -0,0 +1,32 @@ +/// + +import ncp = require('ncp'); +import stream = require('stream'); + +var opts: ncp.Options; +opts = {}; +opts = { + filter: /abc/ +}; +opts = { + transform: (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => { + + } +}; +opts = { + clobber: false +}; +opts = { + stopOnErr: false +}; +opts = { + errs: new stream.Writable() +}; + +ncp.ncp('foo', 'bar', (err: Error) => { + +}); + +ncp.ncp('foo', 'bar', opts, (err: Error) => { + +}); diff --git a/ncp/ncp.d.ts b/ncp/ncp.d.ts new file mode 100644 index 0000000000..206d3a18e8 --- /dev/null +++ b/ncp/ncp.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ncp v0.5.1 +// Project: https://github.com/AvianFlu/ncp +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +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; + transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void; + clobber? : boolean; + stopOnErr? : boolean; + errs? : NodeJS.WritableStream; + } +}