Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to TypeScript 4.0 #6514

Merged
merged 4 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"rules": {
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/explicit-member-accessibility": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/no-non-null-assertion": ["off"],
"@typescript-eslint/no-use-before-define": ["off"],
"@typescript-eslint/no-parameter-properties": ["off"],
Expand Down
2 changes: 1 addition & 1 deletion cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn create_compiler_snapshot(

fn ts_version() -> String {
// TODO(ry) This should be automatically extracted from typescript.js
"3.9.7".to_string()
"4.0.2".to_string()
}

fn main() {
Expand Down
116 changes: 78 additions & 38 deletions cli/dts/lib.dom.d.ts

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions cli/dts/lib.es2015.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,48 +454,48 @@ interface String {
startsWith(searchString: string, position?: number): boolean;

/**
* Returns an <a> HTML anchor element and sets the name attribute to the text value
* Returns an `<a>` HTML anchor element and sets the name attribute to the text value
* @param name
*/
anchor(name: string): string;

/** Returns a <big> HTML element */
/** Returns a `<big>` HTML element */
big(): string;

/** Returns a <blink> HTML element */
/** Returns a `<blink>` HTML element */
blink(): string;

/** Returns a <b> HTML element */
/** Returns a `<b>` HTML element */
bold(): string;

/** Returns a <tt> HTML element */
/** Returns a `<tt>` HTML element */
fixed(): string;

/** Returns a <font> HTML element and sets the color attribute value */
/** Returns a `<font>` HTML element and sets the color attribute value */
fontcolor(color: string): string;

/** Returns a <font> HTML element and sets the size attribute value */
/** Returns a `<font>` HTML element and sets the size attribute value */
fontsize(size: number): string;

/** Returns a <font> HTML element and sets the size attribute value */
/** Returns a `<font>` HTML element and sets the size attribute value */
fontsize(size: string): string;

/** Returns an <i> HTML element */
/** Returns an `<i>` HTML element */
italics(): string;

/** Returns an <a> HTML element and sets the href attribute value */
/** Returns an `<a>` HTML element and sets the href attribute value */
link(url: string): string;

/** Returns a <small> HTML element */
/** Returns a `<small>` HTML element */
small(): string;

/** Returns a <strike> HTML element */
/** Returns a `<strike>` HTML element */
strike(): string;

/** Returns a <sub> HTML element */
/** Returns a `<sub>` HTML element */
sub(): string;

/** Returns a <sup> HTML element */
/** Returns a `<sup>` HTML element */
sup(): string;
}

Expand Down
5 changes: 4 additions & 1 deletion cli/dts/lib.es2017.sharedmemory.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ interface Atomics {
/**
* Wakes up sleeping agents that are waiting on the given index of the array, returning the
* number of agents that were awoken.
* @param typedArray A shared Int32Array.
* @param index The position in the typedArray to wake up on.
* @param count The number of sleeping agents to notify. Defaults to +Infinity.
*/
notify(typedArray: Int32Array, index: number, count: number): number;
notify(typedArray: Int32Array, index: number, count?: number): number;

/**
* Stores the bitwise XOR of a value with the value at the given position in the array,
Expand Down
143 changes: 118 additions & 25 deletions cli/dts/lib.es2020.bigint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,92 @@ and limitations under the License.
/// <reference no-default-lib="true"/>


interface BigIntToLocaleStringOptions {
/**
* 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}.
*/
localeMatcher?: string;
/**
* The formatting style to use , the default is "decimal".
*/
style?: string;

numberingSystem?: string;
/**
* The unit to use in unit formatting, Possible values are core unit identifiers, defined in UTS #35, Part 2, Section 6. A subset of units from the full list was selected for use in ECMAScript. Pairs of simple units can be concatenated with "-per-" to make a compound unit. There is no default value; if the style is "unit", the unit property must be provided.
*/
unit?: string;

/**
* The unit formatting style to use in unit formatting, the defaults is "short".
*/
unitDisplay?: string;

/**
* The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — see the Current currency & funds code list. There is no default value; if the style is "currency", the currency property must be provided. It is only used when [[Style]] has the value "currency".
*/
currency?: string;

/**
* How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol".
*
* "symbol" to use a localized currency symbol such as €,
*
* "code" to use the ISO currency code,
*
* "name" to use a localized currency name such as "dollar"
*/
currencyDisplay?: string;

/**
* Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.
*/
useGrouping?: boolean;

/**
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
*/
minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;

/**
* The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information).
*/
minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;

/**
* The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0.
*/
maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;

/**
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
*/
minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;

/**
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
*/
maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;

/**
* The formatting that should be displayed for the number, the defaults is "standard"
*
* "standard" plain number formatting
*
* "scientific" return the order-of-magnitude for formatted number.
*
* "engineering" return the exponent of ten when divisible by three
*
* "compact" string representing exponent, defaults is using the "short" form
*/
notation?: string;

/**
* used only when notation is "compact"
*/
compactDisplay?: string;
}

interface BigInt {
/**
* Returns a string representation of an object.
Expand All @@ -26,7 +112,7 @@ interface BigInt {
toString(radix?: number): string;

/** Returns a string representation appropriate to the host environment's current locale. */
toLocaleString(): string;
toLocaleString(locales?: string, options?: BigIntToLocaleStringOptions): string;

/** Returns the primitive value of the specified object. */
valueOf(): bigint;
Expand Down Expand Up @@ -89,13 +175,13 @@ interface BigInt64Array {

/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns false,
* @param predicate A function that accepts up to three arguments. The every method calls
* the predicate function for each element in the array until the predicate returns false,
* or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
every(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;

/**
* Returns the this object after filling the section identified by start and end with value
Expand All @@ -109,12 +195,12 @@ interface BigInt64Array {

/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls
* the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param predicate A function that accepts up to three arguments. The filter method calls
* the predicate function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;
filter(predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;

/**
* Returns the value of the first element in the array where predicate is true, and undefined
Expand Down Expand Up @@ -260,13 +346,13 @@ interface BigInt64Array {

/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls the
* callbackfn function for each element in the array until the callbackfn returns true, or until
* @param predicate A function that accepts up to three arguments. The some method calls the
* predicate function for each element in the array until the predicate returns true, or until
* the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
some(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;

/**
* Sorts the array.
Expand Down Expand Up @@ -361,13 +447,13 @@ interface BigUint64Array {

/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns false,
* @param predicate A function that accepts up to three arguments. The every method calls
* the predicate function for each element in the array until the predicate returns false,
* or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
every(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;

/**
* Returns the this object after filling the section identified by start and end with value
Expand All @@ -381,12 +467,12 @@ interface BigUint64Array {

/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls
* the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param predicate A function that accepts up to three arguments. The filter method calls
* the predicate function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;
filter(predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;

/**
* Returns the value of the first element in the array where predicate is true, and undefined
Expand Down Expand Up @@ -532,13 +618,13 @@ interface BigUint64Array {

/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls the
* callbackfn function for each element in the array until the callbackfn returns true, or until
* @param predicate A function that accepts up to three arguments. The some method calls the
* predicate function for each element in the array until the predicate returns true, or until
* the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* @param thisArg An object to which the this keyword can refer in the predicate function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
some(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;

/**
* Sorts the array.
Expand Down Expand Up @@ -633,3 +719,10 @@ interface DataView {
*/
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
}

declare namespace Intl{
interface NumberFormat {
format(value: number | bigint): string;
resolvedOptions(): ResolvedNumberFormatOptions;
}
}
1 change: 1 addition & 0 deletions cli/dts/lib.es2020.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ and limitations under the License.
/// <reference lib="es2020.promise" />
/// <reference lib="es2020.string" />
/// <reference lib="es2020.symbol.wellknown" />
/// <reference lib="es2020.intl" />
Loading