Skip to content

Commit

Permalink
fix(types): improve higher-order combinator TS types (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed Aug 27, 2017
1 parent ce8a1f0 commit 097ed3b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions type-definitions/most.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ export interface Stream<A> extends Source<A> {

ap<B, C>(fs: Stream<(a: A) => B>): Stream<C>;

// Note: Without higher-kinded types, the types for these
// cannot be written in a completely safe manner; See https://github.com/Microsoft/TypeScript/issues/1290
// For better type safety, consider using most.join/switch/switchLatest with thru
join(): A;
switch(): A;
switchLatest(): A;
join<B>(this: Stream<Stream<B>>): Stream<B>;
switch<B>(this: Stream<Stream<B>>): Stream<B>;
switchLatest<B>(this: Stream<Stream<B>>): Stream<B>;

continueWith(f: (a: any) => Stream<A>): Stream<A>;
concatMap<B>(f: (a: A) => Stream<B>): Stream<B>;
mergeConcurrently<B>(concurrency: number): Stream<B>;
mergeConcurrently<B>(this: Stream<Stream<B>>, concurrency: number): Stream<B>;
merge(...ss: Array<Stream<A>>): Stream<A>;
mergeArray(streams: Array<Stream<A>>): Stream<A>;

Expand Down

0 comments on commit 097ed3b

Please sign in to comment.