Unify our Map/Set typings with the ones in es6-shim (angular)

This commit is contained in:
Hristo Deshev
2016-02-18 12:05:14 +02:00
parent 7c83f704e6
commit c2b4a8bf0f

6
es-collections.d.ts vendored
View File

@ -13,6 +13,8 @@ interface Map<K, V> {
has(key: K): boolean; has(key: K): boolean;
set(key: K, value: V): Map<K, V>; set(key: K, value: V): Map<K, V>;
size: number; size: number;
keys(): Array<K>;
values(): Array<V>;
} }
declare var Map: { declare var Map: {
new <K, V>(): Map<K, V>; new <K, V>(): Map<K, V>;
@ -24,6 +26,10 @@ declare var Map: {
prototype: Map<any, any>; prototype: Map<any, any>;
} }
//For compatibility - some libs insist on the Map/Set types being named that way
declare type MapConstructor = typeof Map;
declare type SetConstructor = typeof Set;
interface Set<T> { interface Set<T> {
add(value: T): Set<T>; add(value: T): Set<T>;
clear(): void; clear(): void;