Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/lib/es2015.collection.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface Map<K, V> {
interface Map<out K, out V> {
clear(): void;
/**
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
Expand Down Expand Up @@ -34,14 +34,14 @@ interface MapConstructor {
}
declare var Map: MapConstructor;

interface ReadonlyMap<K, V> {
interface ReadonlyMap<out K, out V> {
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
get(key: K): V | undefined;
has(key: K): boolean;
readonly size: number;
}

interface WeakMap<K extends WeakKey, V> {
interface WeakMap<out K extends WeakKey, out V> {
/**
* Removes the specified element from the WeakMap.
* @returns true if the element was successfully removed, or false if it was not present.
Expand All @@ -68,7 +68,7 @@ interface WeakMapConstructor {
}
declare var WeakMap: WeakMapConstructor;

interface Set<T> {
interface Set<out T> {
/**
* Appends a new element with a specified value to the end of the Set.
*/
Expand Down Expand Up @@ -100,13 +100,13 @@ interface SetConstructor {
}
declare var Set: SetConstructor;

interface ReadonlySet<T> {
interface ReadonlySet<out T> {
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
has(value: T): boolean;
readonly size: number;
}

interface WeakSet<T extends WeakKey> {
interface WeakSet<out T extends WeakKey> {
/**
* Appends a new value to the end of the WeakSet.
*/
Expand Down
18 changes: 9 additions & 9 deletions src/lib/es2015.iterable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ interface IArguments {
[Symbol.iterator](): ArrayIterator<any>;
}

interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
interface MapIterator<out T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): MapIterator<T>;
}

interface Map<K, V> {
interface Map<out K, out V> {
/** Returns an iterable of entries in the map. */
[Symbol.iterator](): MapIterator<[K, V]>;

Expand All @@ -140,7 +140,7 @@ interface Map<K, V> {
values(): MapIterator<V>;
}

interface ReadonlyMap<K, V> {
interface ReadonlyMap<out K, out V> {
/** Returns an iterable of entries in the map. */
[Symbol.iterator](): MapIterator<[K, V]>;

Expand All @@ -165,17 +165,17 @@ interface MapConstructor {
new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
}

interface WeakMap<K extends WeakKey, V> {}
interface WeakMap<out K extends WeakKey, out V> {}

interface WeakMapConstructor {
new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
}

interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
interface SetIterator<out T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): SetIterator<T>;
}

interface Set<T> {
interface Set<out T> {
/** Iterates over values in the set. */
[Symbol.iterator](): SetIterator<T>;

Expand All @@ -195,7 +195,7 @@ interface Set<T> {
values(): SetIterator<T>;
}

interface ReadonlySet<T> {
interface ReadonlySet<out T> {
/** Iterates over values in the set. */
[Symbol.iterator](): SetIterator<T>;

Expand All @@ -219,7 +219,7 @@ interface SetConstructor {
new <T>(iterable?: Iterable<T> | null): Set<T>;
}

interface WeakSet<T extends WeakKey> {}
interface WeakSet<out T extends WeakKey> {}

interface WeakSetConstructor {
new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>;
Expand All @@ -245,7 +245,7 @@ interface PromiseConstructor {
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
}

interface StringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
interface StringIterator<out T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.iterator](): StringIterator<T>;
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/es2015.symbol.wellknown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ interface Date {
[Symbol.toPrimitive](hint: string): string | number;
}

interface Map<K, V> {
interface Map<out K, out V> {
readonly [Symbol.toStringTag]: string;
}

interface WeakMap<K extends WeakKey, V> {
interface WeakMap<out K extends WeakKey, out V> {
readonly [Symbol.toStringTag]: string;
}

interface Set<T> {
interface Set<out T> {
readonly [Symbol.toStringTag]: string;
}

interface WeakSet<T extends WeakKey> {
interface WeakSet<out T extends WeakKey> {
readonly [Symbol.toStringTag]: string;
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ interface TypedPropertyDescriptor<T> {

declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;

interface PromiseLike<T> {
interface PromiseLike<out T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
Expand All @@ -1529,7 +1529,7 @@ interface PromiseLike<T> {
/**
* Represents the completion of an asynchronous operation
*/
interface Promise<T> {
interface Promise<out T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down
6 changes: 3 additions & 3 deletions src/lib/esnext.collection.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference lib="es2024.collection" />

interface ReadonlySetLike<T> {
interface ReadonlySetLike<out T> {
/**
* Despite its name, returns an iterator of the values in the set-like.
*/
Expand All @@ -15,7 +15,7 @@ interface ReadonlySetLike<T> {
readonly size: number;
}

interface Set<T> {
interface Set<out T> {
/**
* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
*/
Expand Down Expand Up @@ -46,7 +46,7 @@ interface Set<T> {
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
}

interface ReadonlySet<T> {
interface ReadonlySet<out T> {
/**
* @returns a new Set containing all the elements in this Set and also all the elements in the argument.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2693,9 +2693,9 @@
// | type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never
// | type Partial<T> = { [P in keyof T]?: T[P]; }
// | type Pick<T, K extends keyof T> = { [P in K]: T[P]; }
// | interface Promise<T>
// | interface Promise<out T>
// | type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>
// | interface PromiseLike<T>
// | interface PromiseLike<out T>
// | type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void
// | interface PropertyDescriptor
// | interface PropertyDescriptorMap
Expand Down Expand Up @@ -2873,9 +2873,9 @@
// | type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never
// | type Partial<T> = { [P in keyof T]?: T[P]; }
// | type Pick<T, K extends keyof T> = { [P in K]: T[P]; }
// | interface Promise<T>
// | interface Promise<out T>
// | type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>
// | interface PromiseLike<T>
// | interface PromiseLike<out T>
// | type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void
// | interface PropertyDescriptor
// | interface PropertyDescriptorMap
Expand Down Expand Up @@ -80790,6 +80790,14 @@
"text": "<",
"kind": "punctuation"
},
{
"text": "out",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "T",
"kind": "typeParameterName"
Expand Down Expand Up @@ -81097,6 +81105,14 @@
"text": "<",
"kind": "punctuation"
},
{
"text": "out",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "T",
"kind": "typeParameterName"
Expand Down Expand Up @@ -90261,6 +90277,14 @@
"text": "<",
"kind": "punctuation"
},
{
"text": "out",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "T",
"kind": "typeParameterName"
Expand Down Expand Up @@ -90568,6 +90592,14 @@
"text": "<",
"kind": "punctuation"
},
{
"text": "out",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "T",
"kind": "typeParameterName"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//// [tests/cases/compiler/esNextWeakRefs_IterableWeakMap.ts] ////

=== Performance Stats ===
Type Count: 1,000
Instantiation count: 2,500

=== esNextWeakRefs_IterableWeakMap.ts ===
/** `static #cleanup` */
const IterableWeakMap_cleanup = ({ ref, set }: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -245,7 +245,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -352,7 +352,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -404,7 +404,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -456,7 +456,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -508,7 +508,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|Promise|]<T> {
// <|interface [|Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|{| defId: 1 |}Promise|]<T> {
// <|interface [|{| defId: 1 |}Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down Expand Up @@ -73,7 +73,7 @@
// /**
// * Represents the completion of an asynchronous operation
// */
// <|interface [|{| defId: 1 |}Promise|]<T> {
// <|interface [|{| defId: 1 |}Promise|]<out T> {
// /**
// * Attaches callbacks for the resolution and/or rejection of the Promise.
// * @param onfulfilled The callback to execute when the Promise is resolved.
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/importTag24.types
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//// [tests/cases/conformance/jsdoc/importTag24.ts] ////

=== Performance Stats ===
Type Count: 1,000
Instantiation count: 2,500

=== types.d.ts ===
export type Foo = string;
>Foo : string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//// [tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts] ////

=== Performance Stats ===
Type Count: 1,000

=== inferFromGenericFunctionReturnTypes3.ts ===
// Repros from #5487

Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/inferTypes1.types
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//// [tests/cases/conformance/types/conditional/inferTypes1.ts] ////

=== Performance Stats ===
Type Count: 1,000
Instantiation count: 1,000

=== inferTypes1.ts ===
type Unpacked<T> =
>Unpacked : Unpacked<T>
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/mapGroupBy.types
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//// [tests/cases/compiler/mapGroupBy.ts] ////

=== Performance Stats ===
Type Count: 1,000
Instantiation count: 2,500

=== mapGroupBy.ts ===
const basic = Map.groupBy([0, 2, 8], x => x < 5 ? 'small' : 'large');
>basic : Map<"small" | "large", number[]>
Expand Down
Loading