Skip to content

Commit 82378a9

Browse files
committed
update types
1 parent d9efe96 commit 82378a9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib/esnext.collection.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface MapConstructor {
1010
): Map<K, T[]>;
1111
}
1212

13-
interface SetLike<T> {
13+
interface ReadonlySetLike<T> {
1414
/**
1515
* Despite its name, returns an iterable of the values in the set-like.
1616
*/
@@ -29,29 +29,29 @@ interface Set<T> {
2929
/**
3030
* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
3131
*/
32-
union(other: SetLike<T>): Set<T>;
32+
union<U>(other: ReadonlySetLike<U>): Set<T | U>;
3333
/**
3434
* @returns a new Set containing all the elements which are both in this Set and in the argument.
3535
*/
36-
intersection(other: SetLike<T>): Set<T>;
36+
intersection<U>(other: ReadonlySetLike<U>): Set<T & U>;
3737
/**
3838
* @returns a new Set containing all the elements in this Set which are not also in the argument.
3939
*/
40-
difference(other: SetLike<T>): Set<T>;
40+
difference<U>(other: ReadonlySetLike<U>): Set<T>;
4141
/**
4242
* @returns a new Set containing all the elements in this Set which are in this or in the argument, but not in both.
4343
*/
44-
symmetricDifference(other: SetLike<T>): Set<T>;
44+
symmetricDifference<U>(other: ReadonlySetLike<U>): Set<T | U>;
4545
/**
4646
* @returns a boolean indicating whether all the elements in this Set are also in the argument.
4747
*/
48-
isSubsetOf(other: SetLike<T>): Set<T>;
48+
isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
4949
/**
5050
* @returns a boolean indicating whether all the elements in the argument are also in this Set.
5151
*/
52-
isSupersetOf(other: SetLike<T>): Set<T>;
52+
isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
5353
/**
5454
* @returns a boolean indicating whether this Set has no elements in common with the argument.
5555
*/
56-
isDisjointFrom(other: SetLike<T>): Set<T>;
56+
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
5757
}

0 commit comments

Comments
 (0)