Skip to content

Commit

Permalink
Update TypeScript to 4.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Aug 25, 2022
1 parent 91ce22b commit 692988e
Show file tree
Hide file tree
Showing 37 changed files with 51,390 additions and 27,853 deletions.
35 changes: 32 additions & 3 deletions tsserver/cs/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/de/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/es/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/fr/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/it/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/ja/diagnosticMessages.generated.json

Large diffs are not rendered by default.

35 changes: 32 additions & 3 deletions tsserver/ko/diagnosticMessages.generated.json

Large diffs are not rendered by default.

315 changes: 130 additions & 185 deletions tsserver/lib.dom.d.ts

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions tsserver/lib.dom.iterable.d.ts
Expand Up @@ -121,7 +121,7 @@ interface Headers {

interface IDBDatabase {
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}

interface IDBObjectStore {
Expand All @@ -133,16 +133,6 @@ interface IDBObjectStore {
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
}

interface MIDIInputMap extends ReadonlyMap<string, MIDIInput> {
}

interface MIDIOutput {
send(data: Iterable<number>, timestamp?: DOMHighResTimeStamp): void;
}

interface MIDIOutputMap extends ReadonlyMap<string, MIDIOutput> {
}

interface MediaKeyStatusMap {
[Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
Expand Down
63 changes: 62 additions & 1 deletion tsserver/lib.es2015.collection.d.ts
Expand Up @@ -19,18 +19,38 @@ and limitations under the License.


interface Map<K, V> {

clear(): void;
/**
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
*/
delete(key: K): boolean;
/**
* Executes a provided function once per each key/value pair in the Map, in insertion order.
*/
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
/**
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
*/
get(key: K): V | undefined;
/**
* @returns boolean indicating whether an element with the specified key exists or not.
*/
has(key: K): boolean;
/**
* Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
*/
set(key: K, value: V): this;
/**
* @returns the number of elements in the Map.
*/
readonly size: number;
}

interface MapConstructor {
new(): Map<any, any>;
new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
readonly prototype: Map<any, any>;
}
declare var Map: MapConstructor;
Expand All @@ -43,9 +63,23 @@ interface ReadonlyMap<K, V> {
}

interface WeakMap<K extends object, V> {
/**
* Removes the specified element from the WeakMap.
* @returns true if the element was successfully removed, or false if it was not present.
*/
delete(key: K): boolean;
/**
* @returns a specified element.
*/
get(key: K): V | undefined;
/**
* @returns a boolean indicating whether an element with the specified key exists or not.
*/
has(key: K): boolean;
/**
* Adds a new element with a specified key and value.
* @param key Must be an object.
*/
set(key: K, value: V): this;
}

Expand All @@ -56,11 +90,28 @@ interface WeakMapConstructor {
declare var WeakMap: WeakMapConstructor;

interface Set<T> {
/**
* Appends a new element with a specified value to the end of the Set.
*/
add(value: T): this;

clear(): void;
/**
* Removes a specified value from the Set.
* @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
*/
delete(value: T): boolean;
/**
* Executes a provided function once per each value in the Set object, in insertion order.
*/
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
/**
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
*/
has(value: T): boolean;
/**
* @returns the number of (unique) elements in Set.
*/
readonly size: number;
}

Expand All @@ -77,8 +128,18 @@ interface ReadonlySet<T> {
}

interface WeakSet<T extends object> {
/**
* Appends a new object to the end of the WeakSet.
*/
add(value: T): this;
/**
* Removes the specified element from the WeakSet.
* @returns Returns true if the element existed and has been removed, or false if the element does not exist.
*/
delete(value: T): boolean;
/**
* @returns a boolean indicating whether an object exists in the WeakSet or not.
*/
has(value: T): boolean;
}

Expand Down
93 changes: 91 additions & 2 deletions tsserver/lib.es2015.proxy.d.ts
Expand Up @@ -19,23 +19,112 @@ and limitations under the License.


interface ProxyHandler<T extends object> {
/**
* A trap method for a function call.
* @param target The original callable object which is being proxied.
*/
apply?(target: T, thisArg: any, argArray: any[]): any;

/**
* A trap for the `new` operator.
* @param target The original object which is being proxied.
* @param newTarget The constructor that was originally called.
*/
construct?(target: T, argArray: any[], newTarget: Function): object;
defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;

/**
* A trap for `Object.defineProperty()`.
* @param target The original object which is being proxied.
* @returns A `Boolean` indicating whether or not the property has been defined.
*/
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;

/**
* A trap for the `delete` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to delete.
* @returns A `Boolean` indicating whether or not the property was deleted.
*/
deleteProperty?(target: T, p: string | symbol): boolean;

/**
* A trap for getting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to get.
* @param receiver The proxy or an object that inherits from the proxy.
*/
get?(target: T, p: string | symbol, receiver: any): any;

/**
* A trap for `Object.getOwnPropertyDescriptor()`.
* @param target The original object which is being proxied.
* @param p The name of the property whose description should be retrieved.
*/
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;

/**
* A trap for the `[[GetPrototypeOf]]` internal method.
* @param target The original object which is being proxied.
*/
getPrototypeOf?(target: T): object | null;

/**
* A trap for the `in` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to check for existence.
*/
has?(target: T, p: string | symbol): boolean;

/**
* A trap for `Object.isExtensible()`.
* @param target The original object which is being proxied.
*/
isExtensible?(target: T): boolean;

/**
* A trap for `Reflect.ownKeys()`.
* @param target The original object which is being proxied.
*/
ownKeys?(target: T): ArrayLike<string | symbol>;

/**
* A trap for `Object.preventExtensions()`.
* @param target The original object which is being proxied.
*/
preventExtensions?(target: T): boolean;
set?(target: T, p: string | symbol, value: any, receiver: any): boolean;

/**
* A trap for setting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to set.
* @param receiver The object to which the assignment was originally directed.
* @returns `A `Boolean` indicating whether or not the property was set.
*/
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;

/**
* A trap for `Object.setPrototypeOf()`.
* @param target The original object which is being proxied.
* @param newPrototype The object's new prototype or `null`.
*/
setPrototypeOf?(target: T, v: object | null): boolean;
}

interface ProxyConstructor {
/**
* Creates a revocable Proxy object.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };

/**
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
}
declare var Proxy: ProxyConstructor;
17 changes: 16 additions & 1 deletion tsserver/lib.es2017.intl.d.ts
Expand Up @@ -19,7 +19,22 @@ and limitations under the License.


declare namespace Intl {
type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year";

interface DateTimeFormatPartTypesRegistry {
day: any
dayPeriod: any
era: any
hour: any
literal: any
minute: any
month: any
second: any
timeZoneName: any
weekday: any
year: any
}

type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;

interface DateTimeFormatPart {
type: DateTimeFormatPartTypes;
Expand Down
35 changes: 30 additions & 5 deletions tsserver/lib.es2020.intl.d.ts
Expand Up @@ -18,6 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>


/// <reference lib="es2018.intl" />
declare namespace Intl {

/**
Expand Down Expand Up @@ -50,6 +51,25 @@ declare namespace Intl {
| "second"
| "seconds";

/**
* Value of the `unit` property in objects returned by
* `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and
* `format` methods accept either singular or plural unit names as input,
* but `formatToParts` only outputs singular (e.g. "day") not plural (e.g.
* "days").
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/
type RelativeTimeFormatUnitSingular =
| "year"
| "quarter"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second";

/**
* The locale matching algorithm to use.
*
Expand Down Expand Up @@ -120,11 +140,16 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/
interface RelativeTimeFormatPart {
type: string;
value: string;
unit?: RelativeTimeFormatUnit;
}
type RelativeTimeFormatPart =
| {
type: "literal";
value: string;
}
| {
type: Exclude<NumberFormatPartTypes, "literal">;
value: string;
unit: RelativeTimeFormatUnitSingular;
};

interface RelativeTimeFormat {
/**
Expand Down
14 changes: 11 additions & 3 deletions tsserver/lib.es2021.intl.d.ts
Expand Up @@ -20,17 +20,25 @@ and limitations under the License.

declare namespace Intl {

interface DateTimeFormatPartTypesRegistry {
fractionalSecond: any
}

interface DateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
dateStyle?: "full" | "long" | "medium" | "short" | undefined;
timeStyle?: "full" | "long" | "medium" | "short" | undefined;
dayPeriod?: "narrow" | "short" | "long" | undefined;
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
fractionalSecondDigits?: 1 | 2 | 3 | undefined;
}

interface DateTimeRangeFormatPart extends DateTimeFormatPart {
source: "startRange" | "endRange" | "shared"
}

interface DateTimeFormat {
formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[];
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[];
}

interface ResolvedDateTimeFormatOptions {
Expand All @@ -39,7 +47,7 @@ declare namespace Intl {
timeStyle?: "full" | "long" | "medium" | "short";
hourCycle?: "h11" | "h12" | "h23" | "h24";
dayPeriod?: "narrow" | "short" | "long";
fractionalSecondDigits?: 0 | 1 | 2 | 3;
fractionalSecondDigits?: 1 | 2 | 3;
}

/**
Expand Down
1 change: 1 addition & 0 deletions tsserver/lib.es2022.d.ts
Expand Up @@ -23,4 +23,5 @@ and limitations under the License.
/// <reference lib="es2022.error" />
/// <reference lib="es2022.intl" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.sharedmemory" />
/// <reference lib="es2022.string" />
4 changes: 2 additions & 2 deletions tsserver/lib.es2022.error.d.ts
Expand Up @@ -19,11 +19,11 @@ and limitations under the License.


interface ErrorOptions {
cause?: Error;
cause?: unknown;
}

interface Error {
cause?: Error;
cause?: unknown;
}

interface ErrorConstructor {
Expand Down

0 comments on commit 692988e

Please sign in to comment.