Skip to content

Commit eebe87d

Browse files
committed
Add stream typedefs
1 parent bb97c20 commit eebe87d

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

tools/docs/jsdoc/typedefs/index.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,67 @@
288288
*
289289
* @see [RegExp]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp}
290290
*/
291+
292+
/**
293+
* An object which emits events.
294+
*
295+
* @typedef {Object} EventEmitter
296+
*
297+
* @see Node.js EventEmitter [documentation]{@link https://nodejs.org/api/events.html}
298+
*/
299+
300+
/**
301+
* A stream interface for reading from a data source.
302+
*
303+
* @typedef {EventEmitter} ReadableStream
304+
*
305+
* @see Node.js stream [documentation]{@link https://nodejs.org/api/stream.html}
306+
*/
307+
308+
/**
309+
* A stream interface for writing to a destination.
310+
*
311+
* @typedef {EventEmitter} WritableStream
312+
*
313+
* @see Node.js stream [documentation]{@link https://nodejs.org/api/stream.html}
314+
*/
315+
316+
/**
317+
* A stream interface implementing both readable and writable stream interfaces.
318+
*
319+
* @typedef {EventEmitter} DuplexStream
320+
*
321+
* @see Node.js stream [documentation]{@link https://nodejs.org/api/stream.html}
322+
*/
323+
324+
/**
325+
* A duplex stream where the output is causally connected to the input.
326+
*
327+
* @typedef {DuplexStream} TransformStream
328+
*
329+
* @see Node.js stream [documentation]{@link https://nodejs.org/api/stream.html}
330+
*/
331+
332+
/**
333+
* A Node.js stream.
334+
*
335+
* @typedef {(ReadableStream|WritableStream|DuplexStream|TransformStream)} Stream
336+
*
337+
* @see Node.js stream [documentation]{@link https://nodejs.org/api/stream.html}
338+
*/
339+
340+
/**
341+
* An HTTP request object. This object provides access request status, headers, and data and implements the [Readable Stream]{@link https://nodejs.org/api/stream.html} interface.
342+
*
343+
* @typedef {EventEmitter} IncomingMessage
344+
*
345+
* @see Node.js HTTP [documentation]{@link https://nodejs.org/api/http.html}
346+
*/
347+
348+
/**
349+
* An HTTP response object. This object implements, but does not inherit from, the [Writable Stream]{@link https://nodejs.org/api/stream.html} interface.
350+
*
351+
* @typedef {EventEmitter} ServerResponse
352+
*
353+
* @see Node.js HTTP [documentation]{@link https://nodejs.org/api/http.html}
354+
*/

0 commit comments

Comments
 (0)