Skip to content

Commit 91ce22b

Browse files
Update TypeScript to 4.7.2.
1 parent a22f8a3 commit 91ce22b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+122153
-105574
lines changed

tsserver/cs/diagnosticMessages.generated.json

Lines changed: 72 additions & 51 deletions
Large diffs are not rendered by default.

tsserver/de/diagnosticMessages.generated.json

Lines changed: 72 additions & 51 deletions
Large diffs are not rendered by default.

tsserver/es/diagnosticMessages.generated.json

Lines changed: 65 additions & 44 deletions
Large diffs are not rendered by default.

tsserver/fr/diagnosticMessages.generated.json

Lines changed: 54 additions & 33 deletions
Large diffs are not rendered by default.

tsserver/it/diagnosticMessages.generated.json

Lines changed: 74 additions & 53 deletions
Large diffs are not rendered by default.

tsserver/ja/diagnosticMessages.generated.json

Lines changed: 53 additions & 32 deletions
Large diffs are not rendered by default.

tsserver/ko/diagnosticMessages.generated.json

Lines changed: 73 additions & 52 deletions
Large diffs are not rendered by default.

tsserver/lib.dom.d.ts

Lines changed: 404 additions & 31 deletions
Large diffs are not rendered by default.

tsserver/lib.dom.iterable.d.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ interface DataTransferItemList {
6969
[Symbol.iterator](): IterableIterator<DataTransferItem>;
7070
}
7171

72+
interface EventCounts extends ReadonlyMap<string, number> {
73+
}
74+
7275
interface FileList {
7376
[Symbol.iterator](): IterableIterator<File>;
7477
}
@@ -130,6 +133,16 @@ interface IDBObjectStore {
130133
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
131134
}
132135

136+
interface MIDIInputMap extends ReadonlyMap<string, MIDIInput> {
137+
}
138+
139+
interface MIDIOutput {
140+
send(data: Iterable<number>, timestamp?: DOMHighResTimeStamp): void;
141+
}
142+
143+
interface MIDIOutputMap extends ReadonlyMap<string, MIDIOutput> {
144+
}
145+
133146
interface MediaKeyStatusMap {
134147
[Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
135148
entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
@@ -233,10 +246,10 @@ interface StyleSheetList {
233246

234247
interface SubtleCrypto {
235248
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
236-
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
237-
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
249+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
250+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
238251
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
239-
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
252+
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
240253
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
241254
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
242255
}

tsserver/lib.es2015.core.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ interface ObjectConstructor {
283283
* @param target The target object to copy to.
284284
* @param source The source object from which to copy properties.
285285
*/
286-
assign<T, U>(target: T, source: U): T & U;
286+
assign<T extends {}, U>(target: T, source: U): T & U;
287287

288288
/**
289289
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -292,7 +292,7 @@ interface ObjectConstructor {
292292
* @param source1 The first source object from which to copy properties.
293293
* @param source2 The second source object from which to copy properties.
294294
*/
295-
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
295+
assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
296296

297297
/**
298298
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -302,7 +302,7 @@ interface ObjectConstructor {
302302
* @param source2 The second source object from which to copy properties.
303303
* @param source3 The third source object from which to copy properties.
304304
*/
305-
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
305+
assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
306306

307307
/**
308308
* Copy the values of all of the enumerable own properties from one or more source objects to a

tsserver/lib.es2015.reflect.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ declare namespace Reflect {
4444
* @param propertyKey The property name.
4545
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
4646
*/
47-
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
47+
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;
4848

4949
/**
5050
* Removes a property from an object, equivalent to `delete target[propertyKey]`,

tsserver/lib.es2020.bigint.d.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and limitations under the License.
1818
/// <reference no-default-lib="true"/>
1919

2020

21+
/// <reference lib="es2020.intl" />
22+
2123
interface BigIntToLocaleStringOptions {
2224
/**
2325
* The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.
@@ -112,7 +114,7 @@ interface BigInt {
112114
toString(radix?: number): string;
113115

114116
/** Returns a string representation appropriate to the host environment's current locale. */
115-
toLocaleString(locales?: string, options?: BigIntToLocaleStringOptions): string;
117+
toLocaleString(locales?: Intl.LocalesArgument, options?: BigIntToLocaleStringOptions): string;
116118

117119
/** Returns the primitive value of the specified object. */
118120
valueOf(): bigint;
@@ -691,31 +693,31 @@ interface DataView {
691693
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is
692694
* no alignment constraint; multi-byte values may be fetched from any offset.
693695
* @param byteOffset The place in the buffer at which the value should be retrieved.
696+
* @param littleEndian If false or undefined, a big-endian value should be read.
694697
*/
695698
getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
696699

697700
/**
698701
* Gets the BigUint64 value at the specified byte offset from the start of the view. There is
699702
* no alignment constraint; multi-byte values may be fetched from any offset.
700703
* @param byteOffset The place in the buffer at which the value should be retrieved.
704+
* @param littleEndian If false or undefined, a big-endian value should be read.
701705
*/
702706
getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
703707

704708
/**
705709
* Stores a BigInt64 value at the specified byte offset from the start of the view.
706710
* @param byteOffset The place in the buffer at which the value should be set.
707711
* @param value The value to set.
708-
* @param littleEndian If false or undefined, a big-endian value should be written,
709-
* otherwise a little-endian value should be written.
712+
* @param littleEndian If false or undefined, a big-endian value should be written.
710713
*/
711714
setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
712715

713716
/**
714717
* Stores a BigUint64 value at the specified byte offset from the start of the view.
715718
* @param byteOffset The place in the buffer at which the value should be set.
716719
* @param value The value to set.
717-
* @param littleEndian If false or undefined, a big-endian value should be written,
718-
* otherwise a little-endian value should be written.
720+
* @param littleEndian If false or undefined, a big-endian value should be written.
719721
*/
720722
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
721723
}

tsserver/lib.es2020.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ and limitations under the License.
2020

2121
/// <reference lib="es2019" />
2222
/// <reference lib="es2020.bigint" />
23+
/// <reference lib="es2020.date" />
24+
/// <reference lib="es2020.number" />
2325
/// <reference lib="es2020.promise" />
2426
/// <reference lib="es2020.sharedmemory" />
2527
/// <reference lib="es2020.string" />

tsserver/lib.es2020.date.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2020.intl" />
22+
23+
interface Date {
24+
/**
25+
* Converts a date and time to a string by using the current or specified locale.
26+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
27+
* @param options An object that contains one or more properties that specify comparison options.
28+
*/
29+
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
30+
31+
/**
32+
* Converts a date to a string by using the current or specified locale.
33+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
34+
* @param options An object that contains one or more properties that specify comparison options.
35+
*/
36+
toLocaleDateString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
37+
38+
/**
39+
* Converts a time to a string by using the current or specified locale.
40+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
41+
* @param options An object that contains one or more properties that specify comparison options.
42+
*/
43+
toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
44+
}

tsserver/lib.es2020.intl.d.ts

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ declare namespace Intl {
7878
*/
7979
type BCP47LanguageTag = string;
8080

81+
/**
82+
* The locale(s) to use
83+
*
84+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
85+
*/
86+
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
87+
8188
/**
8289
* An object with some or all of properties of `options` parameter
8390
* of `Intl.RelativeTimeFormat` constructor.
@@ -274,6 +281,10 @@ declare namespace Intl {
274281
}
275282

276283
interface Locale extends LocaleOptions {
284+
/** A string containing the language, and the script and region if available. */
285+
baseName: string;
286+
/** The primary language subtag associated with the locale. */
287+
language: string;
277288
/** Gets the most likely values for the language, script, and region of the locale based on existing values. */
278289
maximize(): Locale;
279290
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
@@ -297,15 +308,39 @@ declare namespace Intl {
297308
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
298309
*/
299310
const Locale: {
300-
new (tag?: BCP47LanguageTag, options?: LocaleOptions): Locale;
311+
new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
301312
};
302313

303-
interface DisplayNamesOptions {
314+
type DisplayNamesFallback =
315+
| "code"
316+
| "none";
317+
318+
type DisplayNamesType =
319+
| "language"
320+
| "region"
321+
| "script"
322+
| "calendar"
323+
| "dateTimeField"
324+
| "currency";
325+
326+
type DisplayNamesLanguageDisplay =
327+
| "dialect"
328+
| "standard";
329+
330+
interface DisplayNamesOptions {
331+
localeMatcher?: RelativeTimeFormatLocaleMatcher;
332+
style?: RelativeTimeFormatStyle;
333+
type: DisplayNamesType;
334+
languageDisplay?: DisplayNamesLanguageDisplay;
335+
fallback?: DisplayNamesFallback;
336+
}
337+
338+
interface ResolvedDisplayNamesOptions {
304339
locale: UnicodeBCP47LocaleIdentifier;
305-
localeMatcher: RelativeTimeFormatLocaleMatcher;
306340
style: RelativeTimeFormatStyle;
307-
type: "language" | "region" | "script" | "currency";
308-
fallback: "code" | "none";
341+
type: DisplayNamesType;
342+
fallback: DisplayNamesFallback;
343+
languageDisplay?: DisplayNamesLanguageDisplay;
309344
}
310345

311346
interface DisplayNames {
@@ -331,7 +366,7 @@ declare namespace Intl {
331366
*
332367
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
333368
*/
334-
resolvedOptions(): DisplayNamesOptions;
369+
resolvedOptions(): ResolvedDisplayNamesOptions;
335370
}
336371

337372
/**
@@ -352,7 +387,7 @@ declare namespace Intl {
352387
*
353388
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
354389
*/
355-
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: Partial<DisplayNamesOptions>): DisplayNames;
390+
new(locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
356391

357392
/**
358393
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
@@ -367,7 +402,7 @@ declare namespace Intl {
367402
*
368403
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
369404
*/
370-
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: {localeMatcher: RelativeTimeFormatLocaleMatcher}): BCP47LanguageTag[];
405+
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher }): BCP47LanguageTag[];
371406
};
372407

373408
}

tsserver/lib.es2020.number.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2020.intl" />
22+
23+
interface Number {
24+
/**
25+
* Converts a number to a string by using the current or specified locale.
26+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
27+
* @param options An object that contains one or more properties that specify comparison options.
28+
*/
29+
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
30+
}

tsserver/lib.es2021.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ and limitations under the License.
2222
/// <reference lib="es2021.promise" />
2323
/// <reference lib="es2021.string" />
2424
/// <reference lib="es2021.weakref" />
25+
/// <reference lib="es2021.intl" />

0 commit comments

Comments
 (0)