mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
added definition for ncp
This commit is contained in:
parent
6745ac3279
commit
76b240a5d3
32
ncp/ncp-tests.ts
Normal file
32
ncp/ncp-tests.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/// <reference path="ncp.d.ts" />
|
||||
|
||||
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) => {
|
||||
|
||||
});
|
||||
19
ncp/ncp.d.ts
vendored
Normal file
19
ncp/ncp.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// 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/borisyankov/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;
|
||||
transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void;
|
||||
clobber? : boolean;
|
||||
stopOnErr? : boolean;
|
||||
errs? : NodeJS.WritableStream;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user