You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The argument types should be inferred by the previous stream.
pipeline(Readable.from([2,3,4]),pipe(n=>{nasnumber// Typed as numberreturn`${n} is coming!`}),pipe(message=>{messageasstring// Typed as stringreturn{ message }}),pipe(obj=>{objas{message: string}// Typed as { message: string}}),(err)=>{})
It could be controversial, but how about providing additional types by Declaration Merging only for pipeline-pipe users? We have to give up third-party transformers lose types, but we may be able to type our pipe() and the other utilities.
The text was updated successfully, but these errors were encountered:
What's expected
The argument types should be inferred by the previous stream.
Problem
Node's ReadableStream/WritableStream/ReadWriteStream are not typed. DefinitelyTyped/DefinitelyTyped#45196 and DefinitelyTyped/DefinitelyTyped#45222 tackled it, but it seems difficult to modify the base types that many other modules depend on.
Possible solution
It could be controversial, but how about providing additional types by Declaration Merging only for pipeline-pipe users? We have to give up third-party transformers lose types, but we may be able to type our
pipe()
and the other utilities.The text was updated successfully, but these errors were encountered: