Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript definition - Use WritableStream instead of stream.Writable #38

Merged
merged 1 commit into from
Mar 31, 2019

Conversation

imhoffd
Copy link
Contributor

@imhoffd imhoffd commented Mar 20, 2019

Thanks for adding TypeScript types to your modules!

In Node typings, it is generally preferred to use the WritableStream interface when asking for a writable stream (not stream.Writable). This should allow people to use implementations of streams other than the built-in.

Writable itself implements the WritableStream interface: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/globals.d.ts#L612-L619

class Writable extends Stream implements NodeJS.WritableStream {
    ...

cc @BendingBender

@BendingBender
Copy link
Contributor

BendingBender commented Mar 31, 2019

@sindresorhus What do you think about it? Sounds reasonable to me.

@sindresorhus sindresorhus changed the title Request TS interface of writable stream, not Writable TypeScript definition - Use WritableStream instead of stream.Writable Mar 31, 2019
@sindresorhus sindresorhus merged commit 8528ac5 into sindresorhus:master Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants