Merge pull request #2698 from horiuchi/bugfix

small bugfix
This commit is contained in:
Basarat Ali Syed
2014-08-22 17:26:02 +10:00
4 changed files with 20 additions and 7 deletions
+5 -1
View File
@@ -1110,7 +1110,7 @@ declare module "crypto" {
setPrivateKey(public_key: string, encoding?: string): void;
}
export function getDiffieHellman(group_name: string): DiffieHellman;
export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void;
export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void;
export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer;
export function randomBytes(size: number): Buffer;
export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
@@ -1121,6 +1121,10 @@ declare module "crypto" {
declare module "stream" {
import events = require("events");
export interface Stream extends events.EventEmitter {
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
}
export interface ReadableOptions {
highWaterMark?: number;
encoding?: string;
+1
View File
@@ -8,6 +8,7 @@
declare module Express {
export interface Request {
session?: any;
authInfo?: any;
// These declarations are merged into express's Request type
login(user: any, done: (err: any) => void): void;
+2 -1
View File
@@ -114,7 +114,8 @@ req = req.oauth(oauth);
req = req.jar(jar);
write = req.pipe(write);
write = req.pipe(write, value);
req.write();
req.pipe(req);
req.write(value);
req.end(str);
req.end(buffer);
req.pause();
+12 -5
View File
@@ -91,7 +91,10 @@ declare module 'request' {
body: any;
}
export interface Request {
export interface Request extends stream.Stream {
readable: boolean;
writable: boolean;
getAgent(): http.Agent;
//start(): void;
//abort(): void;
@@ -107,10 +110,14 @@ declare module 'request' {
oauth(oauth: OAuthOptions): Request;
jar(jar: CookieJar): Request;
pipe(dest: stream.Writable, opts?: any): stream.Writable;
write(): void;
end(chunk: string): void;
end(chunk: NodeBuffer): void;
write(buffer: Buffer, cb?: Function): boolean;
write(str: string, cb?: Function): boolean;
write(str: string, encoding: string, cb?: Function): boolean;
write(str: string, encoding?: string, fd?: string): boolean;
end(): void;
end(chunk: Buffer, cb?: Function): void;
end(chunk: string, cb?: Function): void;
end(chunk: string, encoding: string, cb?: Function): void;
pause(): void;
resume(): void;
abort(): void;