{Map, WeakMap}.set and {Set, WeakSet}.add return this.

This commit is contained in:
Arnavion 2016-05-07 16:24:30 -07:00
parent 72c19ec806
commit 73590f4fb1

View File

@ -4,7 +4,7 @@ interface Map<K, V> {
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value?: V): Map<K, V>;
set(key: K, value?: V): this;
readonly size: number;
}
@ -20,8 +20,7 @@ interface WeakMap<K, V> {
delete(key: K): boolean;
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value?: V): WeakMap<K, V>;
set(key: K, value?: V): this;
}
interface WeakMapConstructor {
@ -32,7 +31,7 @@ interface WeakMapConstructor {
declare var WeakMap: WeakMapConstructor;
interface Set<T> {
add(value: T): Set<T>;
add(value: T): this;
clear(): void;
delete(value: T): boolean;
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
@ -48,11 +47,10 @@ interface SetConstructor {
declare var Set: SetConstructor;
interface WeakSet<T> {
add(value: T): WeakSet<T>;
add(value: T): this;
clear(): void;
delete(value: T): boolean;
has(value: T): boolean;
}
interface WeakSetConstructor {