mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
We duplicated the EventEmitter and Stream interfaces in the "event" module, so I removed the redundant interface definitions. I have updated the ReadableStream/WritableStream interfaces in accordance with the current documentation: http://nodejs.org/api/stream.html I added class definitions for Writable/Transform/Duplex/PassThrough in 'event'. These classes are described in the following Node documentation: http://nodejs.org/api/stream.html#stream_api_for_stream_implementors As a result of these changes, I needed to slightly alter other typings to refer to the new interface name. This was unavoidable; I had to rename the `EventEmitter` interface to `NodeEventEmitter` to avoid clashing with the `events.EventEmitter` class that implements `NodeEventEmitter`.
24 lines
604 B
TypeScript
24 lines
604 B
TypeScript
// Type definitions for through
|
|
// Project: https://github.com/dominictarr/through
|
|
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
/// <reference path="../node/node.d.ts" />
|
|
|
|
declare module "through" {
|
|
import Stream = require("stream");
|
|
|
|
function through(write?: (data) => void,
|
|
end?: () => void,
|
|
opts?: {
|
|
autoDestroy: boolean;
|
|
}): through.ThroughStream;
|
|
|
|
module through {
|
|
export interface ThroughStream extends ReadWriteStream {
|
|
autoDestroy: boolean;
|
|
}
|
|
}
|
|
|
|
export = through;
|
|
} |