From 0e28c8f90692ed63b36e9156be3758648e4854c3 Mon Sep 17 00:00:00 2001 From: Aldwin Vlasblom Date: Mon, 18 Nov 2019 18:11:05 +0100 Subject: [PATCH] Fix the TypeScript overloading for map Co-Authored-By: gcanti --- index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index ec3011e2..a37da9c8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -130,11 +130,11 @@ declare module 'fluture' { /** Set up a cleanup Future to run after the given action has settled. See https://github.com/fluture-js/Fluture#lastly */ export function lastly(cleanup: FutureInstance): (action: FutureInstance) => FutureInstance - /** Map over the resolution value of the given Future. See https://github.com/fluture-js/Fluture#map */ - export function map(mapper: (value: RA) => RB): (source: FutureInstance) => FutureInstance - - /** Map over the resolution value of the given ConcurrentFuture. See https://github.com/fluture-js/Fluture#map */ - export function map(mapper: (value: RA) => RB): (source: ConcurrentFutureInstance) => ConcurrentFutureInstance + /** Map over the resolution value of the given Future or ConcurrentFuture. See https://github.com/fluture-js/Fluture#map */ + export function map(mapper: (value: RA) => RB): { + (source: FutureInstance): FutureInstance + (source: ConcurrentFutureInstance): ConcurrentFutureInstance + } /** Map over the rejection reason of the given Future. See https://github.com/fluture-js/Fluture#maprej */ export function mapRej(mapper: (reason: LA) => LB): (source: FutureInstance) => FutureInstance