diff --git a/node/node.d.ts b/node/node.d.ts index 282120dc6..4140a8c4b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -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(destination: T, options?: { end?: boolean; }): T; + } + export interface ReadableOptions { highWaterMark?: number; encoding?: string; diff --git a/passport/passport.d.ts b/passport/passport.d.ts index 6d03093eb..977323140 100644 --- a/passport/passport.d.ts +++ b/passport/passport.d.ts @@ -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; diff --git a/request/request-tests.ts b/request/request-tests.ts index d422c3abc..986702c27 100644 --- a/request/request-tests.ts +++ b/request/request-tests.ts @@ -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(); diff --git a/request/request.d.ts b/request/request.d.ts index e6a1d100e..fc03a7e19 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -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;