Merge remote-tracking branch 'borisyankov/master'

This commit is contained in:
zenorbi
2015-07-21 20:00:23 +02:00
5 changed files with 116 additions and 60 deletions
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="../node/node.d.ts" />
/// <reference path="batch-stream.d.ts" />
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.
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for batch-stream 0.1.2
// Project: https://github.com/segmentio/batch-stream
// Definitions by: Nicholas Penree <http://github.com/drudge>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
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;
}
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="constant-case.d.ts" />
import constantCase = require('constant-case');
console.log(constantCase('string')); // => "STRING"
console.log(constantCase('PascalCase')); // => "PASCAL_CASE"
console.log(constantCase('myString', 'tr')); // => "MY_STRİNG"
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for constant-case
// Project: https://github.com/blakeembrey/constant-case
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "constant-case" {
function constantCase(string: string, locale?: string): string;
export = constantCase;
}
+62 -60
View File
@@ -1,63 +1,65 @@
// Type definitions for oboe v2.0.3
// Project: https://github.com/jimhigson/oboe.js
// Definitions by: Jared Klopper <https://github.com/optical>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
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
/// <reference path="../node/node.d.ts" />
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():void;
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;
}