From 097ed3bc5706086c22cdb1a73916e753f90a2085 Mon Sep 17 00:00:00 2001 From: Brian Cavalier Date: Sun, 27 Aug 2017 19:22:06 -0400 Subject: [PATCH] fix(types): improve higher-order combinator TS types (#483) --- type-definitions/most.d.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/type-definitions/most.d.ts b/type-definitions/most.d.ts index 68f4ee82..06b159e2 100644 --- a/type-definitions/most.d.ts +++ b/type-definitions/most.d.ts @@ -74,16 +74,13 @@ export interface Stream extends Source { ap(fs: Stream<(a: A) => B>): Stream; - // 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(this: Stream>): Stream; + switch(this: Stream>): Stream; + switchLatest(this: Stream>): Stream; continueWith(f: (a: any) => Stream): Stream; concatMap(f: (a: A) => Stream): Stream; - mergeConcurrently(concurrency: number): Stream; + mergeConcurrently(this: Stream>, concurrency: number): Stream; merge(...ss: Array>): Stream; mergeArray(streams: Array>): Stream;