Skip to content

Commit

Permalink
Improve type infererence for Map
Browse files Browse the repository at this point in the history
  • Loading branch information
A0150315 authored and Netttttttttt committed Jun 27, 2022
1 parent 7cf6f8e commit 6b774e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions type-definitions/immutable.d.ts
Expand Up @@ -759,9 +759,9 @@ declare namespace Immutable {
* but since Immutable Map keys can be of any type the argument to `get()` is
* not altered.
*/
function Map<K, V>(collection?: Iterable<[K, V]>): Map<K, V>;
function Map<V>(obj: { [key: string]: V }): Map<string, V>;
function Map<K extends string | symbol, V>(obj: { [P in K]?: V }): Map<K, V>;
function Map<V>(obj: V): (V extends Map<unknown, unknown>
? V
: Map<keyof V, V[keyof V]>);

interface Map<K, V> extends Collection.Keyed<K, V> {
/**
Expand Down

0 comments on commit 6b774e3

Please sign in to comment.