feat: add constructors without type arguments.
As the constructed objects have an any type, the
resulting containers are assignable to any type:
var x: Map<string, number> = new Map();
That is useful to avoid having to specify types
twice when declaration and assignment are in
different places.
This commit is contained in:
+2
@@ -45,6 +45,7 @@ interface Map<K, V> {
|
||||
size: number;
|
||||
}
|
||||
declare var Map: {
|
||||
new (): Map<any, any>;
|
||||
new<K, V>(): Map<K, V>;
|
||||
// alexeagle: PATCHED
|
||||
new<K, V>(m: Map<K, V>): Map<K, V>;
|
||||
@@ -61,6 +62,7 @@ interface Set<T> {
|
||||
size: number;
|
||||
}
|
||||
declare var Set: {
|
||||
new (): Set<any>;
|
||||
new<T>(): Set<T>;
|
||||
// alexeagle PATCHED
|
||||
new<T>(s: Set<T>): Set<T>;
|
||||
|
||||
Reference in New Issue
Block a user