From 3135ee6f3ab8f4d482b837692c86ffad16a886f8 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Tue, 18 Sep 2018 20:53:27 -0400 Subject: [PATCH] highland: Fix typings for parallel, sequence, and merge All of these take a stream of streams. From https://stackoverflow.com/q/52390938. --- types/highland/highland-tests.ts | 6 +++--- types/highland/index.d.ts | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index fc63a23925..cc61fcf92d 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -293,15 +293,15 @@ barStream = fooStream.flatten(); fooStream = fooStream.fork(); -fooStream = _([fooStream, fooStream]).merge(); +fooStream = fooStreamStream.merge(); fooStream = fooStream.observe(); fooStream = fooStream.otherwise(fooStream); -fooStream = fooStream.parallel(num); +fooStream = fooStreamStream.parallel(num); -barStream = fooStream.sequence(); +barStream = barStreamStream.sequence(); barStream = fooStream.series(); diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index 7203e959ab..b6372f799a 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -1049,7 +1049,7 @@ declare namespace Highland { * _([txt, md]).merge(); * // => contents of foo.txt, bar.txt and baz.txt in the order they were read */ - merge(): Stream; + merge(this: Stream>): Stream; /** * Observes a stream, allowing you to handle values as they are emitted, without @@ -1087,7 +1087,7 @@ declare namespace Highland { * @param {Number} n - the maximum number of concurrent reads/buffers * @api public */ - parallel(n: number): Stream; + parallel(this: Stream>, n: number): Stream /** * Reads values from a Stream of Streams, emitting them on a Single output @@ -1100,8 +1100,7 @@ declare namespace Highland { * @name Stream.sequence() * @api public */ - //TODO figure out typing - sequence(): Stream; + sequence(this: Stream>): Stream; /** * An alias for the [sequence](#sequence) method.