From 2474e8f0ac57f67bcf80d22d1316e2b0012617d6 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Mon, 20 Jul 2015 16:16:29 -0400 Subject: [PATCH 1/4] Add `batch-stream` definitions --- batch-stream/batch-stream-tests.ts | 12 ++++++++++++ batch-stream/batch-stream.d.ts | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 batch-stream/batch-stream-tests.ts create mode 100644 batch-stream/batch-stream.d.ts diff --git a/batch-stream/batch-stream-tests.ts b/batch-stream/batch-stream-tests.ts new file mode 100644 index 000000000..2271e67e5 --- /dev/null +++ b/batch-stream/batch-stream-tests.ts @@ -0,0 +1,12 @@ +/// +/// + +import fs = require('fs'); +import BatchStream = require('batch-stream'); + +var batch = new BatchStream({ size : 5 }); +var stream = fs.createReadStream('/etc/passwd'); + +stream + .pipe(batch) + .pipe(fs.createWriteStream('./test.out')); // deals with array input from pipe. \ No newline at end of file diff --git a/batch-stream/batch-stream.d.ts b/batch-stream/batch-stream.d.ts new file mode 100644 index 000000000..5aa4889bc --- /dev/null +++ b/batch-stream/batch-stream.d.ts @@ -0,0 +1,24 @@ +// Type definitions for batch-stream 0.1.2 +// Project: https://github.com/segmentio/batch-stream +// Definitions by: Nicholas Penree +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "batch-stream" { + import stream = require('stream'); + + interface Options { + size?: number; + highWaterMark?: number; + } + + class BatchStream extends stream.Transform { + size: number; + batch: any[]; + + constructor(options: Options); + } + + export = BatchStream; +} \ No newline at end of file From e0453cb63965f3791a4fed41d64760b36e27aa95 Mon Sep 17 00:00:00 2001 From: aabluedragon Date: Tue, 21 Jul 2015 01:53:41 +0300 Subject: [PATCH 2/4] abort() call added Added abort function declaration. --- oboe/oboe.d.ts | 122 +++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/oboe/oboe.d.ts b/oboe/oboe.d.ts index 10544b4b8..c3a7a199a 100644 --- a/oboe/oboe.d.ts +++ b/oboe/oboe.d.ts @@ -1,63 +1,65 @@ // Type definitions for oboe v2.0.3 // Project: https://github.com/jimhigson/oboe.js // Definitions by: Jared Klopper -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module "oboe" { - import stream = require('stream'); - - function oboe(url: string): oboe.Oboe; - function oboe(options: oboe.Options): oboe.Oboe; - function oboe(stream: stream.Readable) : oboe.Oboe; - - module oboe { - - var drop: {}; - - interface Oboe { - done(callback: (result: any) => void): Oboe; - - fail(callback: (result: FailReason) => void): Oboe; - - node(pattern: string, callback: CallbackSignature): Oboe; - - on(event: string, pattern: string, callback: CallbackSignature): Oboe; - on(eventPattern: string, callback: CallbackSignature): Oboe; - - path(pattern: string, callback: CallbackSignature): Oboe; - path(listeners: any): Oboe; - - removeListener(eventPattern: string, callback: CallbackSignature): Oboe; - removeListener(event: string, pattern: string, callback: CallbackSignature): Oboe; - - start(callback: (status: number, headers: Object) => void): Oboe; - - source: string; - } - - interface CallbackSignature { - (node: any, pathOrHeaders: any, ancestors: Object[]): any; - } - - interface Options { - url: string; - method?: string; - headers?: Object; - body?: any; - cached?: boolean; - withCredentials?: boolean; - } - - interface FailReason { - thrown?: Error; - statusCode?: number; - body?: string; - jsonBody?: Object; - } - } - - export = oboe; -} - +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "oboe" { + import stream = require('stream'); + + function oboe(url: string): oboe.Oboe; + function oboe(options: oboe.Options): oboe.Oboe; + function oboe(stream: stream.Readable) : oboe.Oboe; + + module oboe { + + var drop: {}; + + interface Oboe { + done(callback: (result: any) => void): Oboe; + + fail(callback: (result: FailReason) => void): Oboe; + + node(pattern: string, callback: CallbackSignature): Oboe; + + on(event: string, pattern: string, callback: CallbackSignature): Oboe; + on(eventPattern: string, callback: CallbackSignature): Oboe; + + path(pattern: string, callback: CallbackSignature): Oboe; + path(listeners: any): Oboe; + + removeListener(eventPattern: string, callback: CallbackSignature): Oboe; + removeListener(event: string, pattern: string, callback: CallbackSignature): Oboe; + + start(callback: (status: number, headers: Object) => void): Oboe; + + abort(); + + source: string; + } + + interface CallbackSignature { + (node: any, pathOrHeaders: any, ancestors: Object[]): any; + } + + interface Options { + url: string; + method?: string; + headers?: Object; + body?: any; + cached?: boolean; + withCredentials?: boolean; + } + + interface FailReason { + thrown?: Error; + statusCode?: number; + body?: string; + jsonBody?: Object; + } + } + + export = oboe; +} + From ae10100972cbb6cbac610672c269c2d5c1e18e4b Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Tue, 21 Jul 2015 02:10:25 +0100 Subject: [PATCH 3/4] Type definitions and tests for constant-case --- constant-case/constant-case-tests.ts | 9 +++++++++ constant-case/constant-case.d.ts | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 constant-case/constant-case-tests.ts create mode 100644 constant-case/constant-case.d.ts diff --git a/constant-case/constant-case-tests.ts b/constant-case/constant-case-tests.ts new file mode 100644 index 000000000..b7ac3fe9e --- /dev/null +++ b/constant-case/constant-case-tests.ts @@ -0,0 +1,9 @@ +/// + +import constantCase = require('constant-case'); + +console.log(constantCase('string')); // => "STRING" +console.log(constantCase('PascalCase')); // => "PASCAL_CASE" + +console.log(constantCase('myString', 'tr')); // => "MY_STRİNG" + diff --git a/constant-case/constant-case.d.ts b/constant-case/constant-case.d.ts new file mode 100644 index 000000000..dfc14ed77 --- /dev/null +++ b/constant-case/constant-case.d.ts @@ -0,0 +1,9 @@ +// Type definitions for constant-case +// Project: https://github.com/blakeembrey/constant-case +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "constant-case" { + function constantCase(string: string, locale?: string): string; + export = constantCase; +} From fadbb80bccb4f4efca0011d0975d3ff36179dede Mon Sep 17 00:00:00 2001 From: aabluedragon Date: Tue, 21 Jul 2015 08:06:31 +0300 Subject: [PATCH 4/4] Update oboe.d.ts --- oboe/oboe.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oboe/oboe.d.ts b/oboe/oboe.d.ts index c3a7a199a..6e6ed650b 100644 --- a/oboe/oboe.d.ts +++ b/oboe/oboe.d.ts @@ -34,7 +34,7 @@ declare module "oboe" { start(callback: (status: number, headers: Object) => void): Oboe; - abort(); + abort():void; source: string; }