diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts index a8c62e1d7..20c512d27 100644 --- a/type-definitions/immutable.d.ts +++ b/type-definitions/immutable.d.ts @@ -759,11 +759,15 @@ declare namespace Immutable { * but since Immutable Map keys can be of any type the argument to `get()` is * not altered. */ - function Map(collection?: Iterable<[K, V]>): Map; - function Map(obj: { [key: string]: V }): Map; - function Map(obj: { [P in K]?: V }): Map; - - interface Map extends Collection.Keyed { + function Map>(collection: T): Map<{ + [P in T[number]as P[0]]: P[1] + }>; + function Map(obj: T): (T extends Map + ? T + : Map); + + interface Map extends IterableMap { } + interface IterableMap extends Collection.Keyed { /** * The number of entries in this Map. */