@@ -10,7 +10,7 @@ interface MapConstructor {
10
10
) : Map < K , T [ ] > ;
11
11
}
12
12
13
- interface SetLike < T > {
13
+ interface ReadonlySetLike < T > {
14
14
/**
15
15
* Despite its name, returns an iterable of the values in the set-like.
16
16
*/
@@ -29,29 +29,29 @@ interface Set<T> {
29
29
/**
30
30
* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
31
31
*/
32
- union ( other : SetLike < T > ) : Set < T > ;
32
+ union < U > ( other : ReadonlySetLike < U > ) : Set < T | U > ;
33
33
/**
34
34
* @returns a new Set containing all the elements which are both in this Set and in the argument.
35
35
*/
36
- intersection ( other : SetLike < T > ) : Set < T > ;
36
+ intersection < U > ( other : ReadonlySetLike < U > ) : Set < T & U > ;
37
37
/**
38
38
* @returns a new Set containing all the elements in this Set which are not also in the argument.
39
39
*/
40
- difference ( other : SetLike < T > ) : Set < T > ;
40
+ difference < U > ( other : ReadonlySetLike < U > ) : Set < T > ;
41
41
/**
42
42
* @returns a new Set containing all the elements in this Set which are in this or in the argument, but not in both.
43
43
*/
44
- symmetricDifference ( other : SetLike < T > ) : Set < T > ;
44
+ symmetricDifference < U > ( other : ReadonlySetLike < U > ) : Set < T | U > ;
45
45
/**
46
46
* @returns a boolean indicating whether all the elements in this Set are also in the argument.
47
47
*/
48
- isSubsetOf ( other : SetLike < T > ) : Set < T > ;
48
+ isSubsetOf ( other : ReadonlySetLike < unknown > ) : boolean ;
49
49
/**
50
50
* @returns a boolean indicating whether all the elements in the argument are also in this Set.
51
51
*/
52
- isSupersetOf ( other : SetLike < T > ) : Set < T > ;
52
+ isSupersetOf ( other : ReadonlySetLike < unknown > ) : boolean ;
53
53
/**
54
54
* @returns a boolean indicating whether this Set has no elements in common with the argument.
55
55
*/
56
- isDisjointFrom ( other : SetLike < T > ) : Set < T > ;
56
+ isDisjointFrom ( other : ReadonlySetLike < unknown > ) : boolean ;
57
57
}
0 commit comments