From 4f20894ed57f6cb18eb50ef53fbc38aa5ba9e231 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Thu, 30 Jan 2014 21:18:22 -0500 Subject: [PATCH] [Node] Fixing WritableStream.write and WritableStream.end. Documentation for WritableStream.write: http://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback There's no 'fd' argument; that might have been a typo. You can call `write` in the following ways: * write(data: Buffer) * write(data: Buffer, cb: Function) * write(data: String) * write(data: String, cb: Function) * write(data: String, encoding: String) * write(data: String, encoding: String, cb: Function) The same goes to `end`, except `end` can be called with no arguments, too. --- node/node.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 78c0b3082f..7c4d035d6a 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -91,11 +91,13 @@ interface EventEmitter { interface WritableStream extends EventEmitter { writable: boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; + write(buffer: NodeBuffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; end(): void; - end(str: string, enconding: string): void; - end(buffer: NodeBuffer): void; + end(buffer: NodeBuffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; destroy(): void; destroySoon(): void; }