diff --git a/findup-sync/findup-sync-tests.ts b/findup-sync/findup-sync-tests.ts new file mode 100644 index 000000000..f4aab395a --- /dev/null +++ b/findup-sync/findup-sync-tests.ts @@ -0,0 +1,13 @@ +/// +/// + +import findup = require('findup-sync'); + +var str: string; + +str = findup('foo'); +str = findup(['foo', 'bar']); + +str = findup('foo', { + debug: true +}); diff --git a/findup-sync/findup-sync.d.ts b/findup-sync/findup-sync.d.ts new file mode 100644 index 000000000..a5bb5b49d --- /dev/null +++ b/findup-sync/findup-sync.d.ts @@ -0,0 +1,15 @@ +// Type definitions for findup-sync v0.1.3 +// Project: https://github.com/cowboy/node-findup-sync +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'findup-sync' { + import minimatch = require('minimatch'); + + function mod(pattern: string, opts?: minimatch.IOptions): string; + function mod(pattern: string[], opts?: minimatch.IOptions): string; + + export = mod; +} diff --git a/from/from-tests.ts b/from/from-tests.ts new file mode 100644 index 000000000..ce3a11d86 --- /dev/null +++ b/from/from-tests.ts @@ -0,0 +1,12 @@ +/// +/// + +import from = require('from'); + +var rs: NodeJS.ReadableStream; + +rs = from([]); +rs = from(function (count: number, next: () => any) { + this.emit('end'); +}); + diff --git a/from/from.d.ts b/from/from.d.ts new file mode 100644 index 000000000..dadf1fb65 --- /dev/null +++ b/from/from.d.ts @@ -0,0 +1,21 @@ +// Type definitions for from v0.1.3 +// Project: https://github.com/dominictarr/from +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'from' { + + var mod: mod.From; + + module mod { + interface From { + (getChunk: (count: number, next: () => any) => any): NodeJS.ReadableStream; + (chunks: any[]): NodeJS.ReadableStream; + emit(type: string, data: any): void; + } + } + + export = mod; +} diff --git a/readdir-stream/readdir-stream-tests.ts b/readdir-stream/readdir-stream-tests.ts new file mode 100644 index 000000000..a731e86ba --- /dev/null +++ b/readdir-stream/readdir-stream-tests.ts @@ -0,0 +1,8 @@ +/// +/// + +import readdir = require('readdir-stream'); + +var rs: NodeJS.ReadableStream; + +rs = readdir('foo'); diff --git a/readdir-stream/readdir-stream.d.ts b/readdir-stream/readdir-stream.d.ts new file mode 100644 index 000000000..5c4818507 --- /dev/null +++ b/readdir-stream/readdir-stream.d.ts @@ -0,0 +1,11 @@ +// Type definitions for readdir-stream v0.1.0 +// Project: https://github.com/logicalparadox/readdir-stream +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'readdir-stream' { + function readdir(dir: string): NodeJS.ReadableStream; + export = readdir; +} diff --git a/stream-to-array/stream-to-array-tests.ts b/stream-to-array/stream-to-array-tests.ts new file mode 100644 index 000000000..a4803d051 --- /dev/null +++ b/stream-to-array/stream-to-array-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +import toArray = require('stream-to-array'); + +var rs: NodeJS.ReadableStream; + +toArray(rs, (err, arr) => { + +}); diff --git a/stream-to-array/stream-to-array.d.ts b/stream-to-array/stream-to-array.d.ts new file mode 100644 index 000000000..4fd48acdf --- /dev/null +++ b/stream-to-array/stream-to-array.d.ts @@ -0,0 +1,6 @@ +/// + +declare module 'stream-to-array' { + function toArray(stream: NodeJS.ReadableStream, callback: (err: any, arr: any[]) => void): NodeJS.ReadWriteStream; + export = toArray; +} diff --git a/through2/through2-tests.ts b/through2/through2-tests.ts new file mode 100644 index 000000000..6ea9a52d5 --- /dev/null +++ b/through2/through2-tests.ts @@ -0,0 +1,44 @@ +/// +/// + +import through2 = require('through2'); + +var rws: NodeJS.ReadWriteStream; + +rws = through2({ + objectMode: true, + allowHalfOpen: true +}, function (entry: any, enc: string, callback: () => void) { + this.push('foo'); + callback(); +}, () => { + +}); + +rws = through2(function (entry: any, enc: string, callback: () => void) { + this.push('foo'); + callback(); +}, () => { + +}); + +rws = through2(function (entry: any, enc: string, callback: () => void) { + this.push('foo'); + callback(); +}); + +rws = through2(); + +// obj +rws = through2.obj(function (entry: any, enc: string, callback: () => void) { + this.push('foo'); + callback(); +}, () => { + +}); + +rws = through2.obj(function (entry: any, enc: string, callback: () => void) { + this.push('foo'); + callback(); +}); + diff --git a/through2/through2.d.ts b/through2/through2.d.ts new file mode 100644 index 000000000..3eb16f2e6 --- /dev/null +++ b/through2/through2.d.ts @@ -0,0 +1,23 @@ +// Type definitions for through2 v 0.4.2 +// Project: https://github.com/rvagg/through2 +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'through2' { + import stream = require('stream'); + + var mod: mod.Through2; + + module mod { + interface Through2 { + (transform?: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + (opts: stream.DuplexOptions, transform?: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + obj(transform: (entry: any, enc: string, callback: () => void) => void, flush?: () => void): NodeJS.ReadWriteStream; + push(data: any): void; + } + } + export = mod; +} +